Skip to main content
POST
Connect an MCP server

Authorizations

Authorization
string
header
required

A long-lived, privileged API key (ek_... prefix), minted once from the dashboard. Intended for trusted server-side use only; never expose it in client-side code. Send as Authorization: Bearer ek_.... Required by every Calls, Batches, Agents, Tools, MCP Servers, Documents, and Realtime route.

Body

application/json
name
string
required
transport
enum<string>
required
Available options:
sse,
streamable_http
url
string
required
description
string
default:""
auth_type
enum<string>
default:none
Available options:
none,
static,
oauth2
static_auth
V1McpStaticAuthInput · object | null
oauth_config
V1McpOAuthConfigInput · object | null

Only the pre-authorization fields a dev supplies to connect an OAuth2 MCP server. access_token/refresh_token/expires_at are never client input — they're populated by the /oauth/authorize + /oauth/callback flow (see api/v1/_mcp_servers.py) and preserved across a later update.

Response

Successful Response

mcp_server_id
string
required
name
string
required
description
string
required
transport
string
required
url
string
required
auth_type
string
required
enabled
boolean
required
static_auth
Static Auth · object | null
oauth_config
Oauth Config · object | null
created_at
string | null
last_tested_at
string | null
last_test_status
enum<string> | null
Available options:
ok,
error
last_test_error
string | null
last_test_tool_count
integer | null
last_test_tool_names
string[]