curl --request POST \
--url https://{host}/api/registry/v1/servers/{server_id}/connect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"api_key": "<string>",
"token": "<string>",
"bearer_token": "<string>",
"username": "<string>",
"password": "<string>",
"additional_fields": {}
}
'import requests
url = "https://{host}/api/registry/v1/servers/{server_id}/connect"
payload = {
"api_key": "<string>",
"token": "<string>",
"bearer_token": "<string>",
"username": "<string>",
"password": "<string>",
"additional_fields": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
api_key: '<string>',
token: '<string>',
bearer_token: '<string>',
username: '<string>',
password: '<string>',
additional_fields: {}
})
};
fetch('https://{host}/api/registry/v1/servers/{server_id}/connect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/registry/v1/servers/{server_id}/connect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'api_key' => '<string>',
'token' => '<string>',
'bearer_token' => '<string>',
'username' => '<string>',
'password' => '<string>',
'additional_fields' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/registry/v1/servers/{server_id}/connect"
payload := strings.NewReader("{\n \"api_key\": \"<string>\",\n \"token\": \"<string>\",\n \"bearer_token\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"additional_fields\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{host}/api/registry/v1/servers/{server_id}/connect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"api_key\": \"<string>\",\n \"token\": \"<string>\",\n \"bearer_token\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"additional_fields\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/registry/v1/servers/{server_id}/connect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_key\": \"<string>\",\n \"token\": \"<string>\",\n \"bearer_token\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"additional_fields\": {}\n}"
response = http.request(request)
puts response.read_body{
"connection_id": "<string>",
"state": "<string>",
"message": "<string>",
"auth_url": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authenticate an already-registered server
Authenticates the caller against an MCP server that is ALREADY registered in this organization. It does not add a server: a server_id that is not yet registered returns 404, and a catalog (directory) id is never valid here — that ordering is the usual reason this endpoint 404s. Registering a server is not available as a tool; an operator adds it in the console first.
For OAuth providers it returns an authorization URL for the user to visit. For non-OAuth providers (api_key, bearer_token, basic_auth, generic) credentials go in the request body — prefer a server registered with managed credentials so no secret passes through the caller at all, and never solicit one in a chat transcript.
as_service: true connects the tenant’s shared service account rather than the calling user, which is what a server needs before it can be published, and requires an organization admin.
curl --request POST \
--url https://{host}/api/registry/v1/servers/{server_id}/connect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"api_key": "<string>",
"token": "<string>",
"bearer_token": "<string>",
"username": "<string>",
"password": "<string>",
"additional_fields": {}
}
'import requests
url = "https://{host}/api/registry/v1/servers/{server_id}/connect"
payload = {
"api_key": "<string>",
"token": "<string>",
"bearer_token": "<string>",
"username": "<string>",
"password": "<string>",
"additional_fields": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
api_key: '<string>',
token: '<string>',
bearer_token: '<string>',
username: '<string>',
password: '<string>',
additional_fields: {}
})
};
fetch('https://{host}/api/registry/v1/servers/{server_id}/connect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/registry/v1/servers/{server_id}/connect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'api_key' => '<string>',
'token' => '<string>',
'bearer_token' => '<string>',
'username' => '<string>',
'password' => '<string>',
'additional_fields' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/registry/v1/servers/{server_id}/connect"
payload := strings.NewReader("{\n \"api_key\": \"<string>\",\n \"token\": \"<string>\",\n \"bearer_token\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"additional_fields\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{host}/api/registry/v1/servers/{server_id}/connect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"api_key\": \"<string>\",\n \"token\": \"<string>\",\n \"bearer_token\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"additional_fields\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/registry/v1/servers/{server_id}/connect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_key\": \"<string>\",\n \"token\": \"<string>\",\n \"bearer_token\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"additional_fields\": {}\n}"
response = http.request(request)
puts response.read_body{
"connection_id": "<string>",
"state": "<string>",
"message": "<string>",
"auth_url": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
A Barndoor API key, sent as Authorization: Bearer <key>. Keys are prefixed bdai_ and are opaque — do not attempt to decode one. Interchangeable with an OAuth 2.0 access token.
Path Parameters
Query Parameters
Optional return URL for redirecting the user after connection completes.
Optional space-delimited runtime scope override for the OAuth auth URL. Precedence is: query scopes > server resolved scopes > directory fallback.