curl --request POST \
--url https://{organization_id}.platform.barndoor.ai/api/servers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "My Salesforce Instance",
"mcp_server_directory_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"client_id": "<string>",
"client_secret": "<string>",
"meta": {}
}
'import requests
url = "https://{organization_id}.platform.barndoor.ai/api/servers"
payload = {
"name": "My Salesforce Instance",
"mcp_server_directory_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"client_id": "<string>",
"client_secret": "<string>",
"meta": {}
}
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({
name: 'My Salesforce Instance',
mcp_server_directory_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
slug: '<string>',
client_id: '<string>',
client_secret: '<string>',
meta: {}
})
};
fetch('https://{organization_id}.platform.barndoor.ai/api/servers', 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://{organization_id}.platform.barndoor.ai/api/servers",
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([
'name' => 'My Salesforce Instance',
'mcp_server_directory_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'slug' => '<string>',
'client_id' => '<string>',
'client_secret' => '<string>',
'meta' => [
]
]),
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://{organization_id}.platform.barndoor.ai/api/servers"
payload := strings.NewReader("{\n \"name\": \"My Salesforce Instance\",\n \"mcp_server_directory_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"slug\": \"<string>\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"meta\": {}\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://{organization_id}.platform.barndoor.ai/api/servers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My Salesforce Instance\",\n \"mcp_server_directory_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"slug\": \"<string>\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"meta\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{organization_id}.platform.barndoor.ai/api/servers")
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 \"name\": \"My Salesforce Instance\",\n \"mcp_server_directory_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"slug\": \"<string>\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"meta\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"connection_id": "<string>",
"auth_url": "<string>"
}{
"error": "ServerNotFound",
"message": "Server with ID '123' not found",
"details": {}
}{
"error": "ServerNotFound",
"message": "Server with ID '123' not found",
"details": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Create MCP Server
Create a new MCP server instance from a server directory template.
The server will be created in pending status until OAuth credentials are configured.
If client_id and client_secret are provided, the server will be set to active status.
curl --request POST \
--url https://{organization_id}.platform.barndoor.ai/api/servers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "My Salesforce Instance",
"mcp_server_directory_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"client_id": "<string>",
"client_secret": "<string>",
"meta": {}
}
'import requests
url = "https://{organization_id}.platform.barndoor.ai/api/servers"
payload = {
"name": "My Salesforce Instance",
"mcp_server_directory_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"client_id": "<string>",
"client_secret": "<string>",
"meta": {}
}
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({
name: 'My Salesforce Instance',
mcp_server_directory_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
slug: '<string>',
client_id: '<string>',
client_secret: '<string>',
meta: {}
})
};
fetch('https://{organization_id}.platform.barndoor.ai/api/servers', 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://{organization_id}.platform.barndoor.ai/api/servers",
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([
'name' => 'My Salesforce Instance',
'mcp_server_directory_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'slug' => '<string>',
'client_id' => '<string>',
'client_secret' => '<string>',
'meta' => [
]
]),
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://{organization_id}.platform.barndoor.ai/api/servers"
payload := strings.NewReader("{\n \"name\": \"My Salesforce Instance\",\n \"mcp_server_directory_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"slug\": \"<string>\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"meta\": {}\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://{organization_id}.platform.barndoor.ai/api/servers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My Salesforce Instance\",\n \"mcp_server_directory_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"slug\": \"<string>\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"meta\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{organization_id}.platform.barndoor.ai/api/servers")
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 \"name\": \"My Salesforce Instance\",\n \"mcp_server_directory_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"slug\": \"<string>\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"meta\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"connection_id": "<string>",
"auth_url": "<string>"
}{
"error": "ServerNotFound",
"message": "Server with ID '123' not found",
"details": {}
}{
"error": "ServerNotFound",
"message": "Server with ID '123' not found",
"details": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
JWT token obtained through Barndoor's OAuth 2.0 authorization-code flow with PKCE.
The token should be included in the Authorization header:
Authorization: Bearer <your-jwt-token>
Use the Barndoor SDK's loginInteractive() function to obtain tokens automatically.
Body
Human-readable name for the server
"My Salesforce Instance"
ID of the server directory template to create from
Optional URL-friendly identifier (auto-generated if not provided)
^[a-z0-9-]+$OAuth client ID (for OAuth-enabled servers)
OAuth client secret (for OAuth-enabled servers)
Additional metadata for the server