Skip to main content
POST
/
api
/
servers
Create MCP server
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": {}
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "connection_id": "<string>",
  "auth_url": "<string>"
}

Authorizations

Authorization
string
header
required

JWT token obtained through Auth0 OAuth 2.0 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

application/json
name
string
required

Human-readable name for the server

Example:

"My Salesforce Instance"

mcp_server_directory_id
string<uuid>
required

ID of the server directory template to create from

slug
string

Optional URL-friendly identifier (auto-generated if not provided)

client_id
string

OAuth client ID (for OAuth-enabled servers)

client_secret
string

OAuth client secret (for OAuth-enabled servers)

meta
object

Additional metadata for the server

Response

Server created successfully

id
string<uuid>

ID of the newly created server

connection_id
string | null

Connection ID if a connection was created

auth_url
string | null

OAuth authorization URL if authentication is required