Version 2.5
MCP servers

MCP servers

Manage the MCP servers registered in the workspace — the tool providers agents attach to. To attach a server to a specific agent, see Agents. To talk to an agent as an MCP server, see Agent MCP.

All paths are relative to the base URL and require an Authorization: Bearer YOUR_API_KEY header.

The MCP server object

PublicMcpServer:

FieldTypeDescription
idstringServer ID.
namestringDisplay name.
transportstringHow the server is reached (e.g. streamable-http, sse, stdio).
urlstringEndpoint URL (remote transports).
headersobjectHeaders sent with each request (remote transports).
commandstringExecutable to run (local stdio transport).
argsarrayArguments for the command.
envobjectEnvironment variables for the command.
cwdstringWorking directory for the command.
force_serial_tool_callsbooleanRun this server's tool calls one at a time.
oauth_client_configobjectOAuth client configuration attached to the server, with the client secret masked. null when the server doesn't use OAuth.

List MCP servers

GET /mcp-servers

Returns a PaginatedResponse of MCP servers.

Get an MCP server

GET /mcp-servers/{mcp_server_id}

Returns a single PublicMcpServer.

Create an MCP server

POST /mcp-servers

Registers a new MCP server. Provide the connection details for the server's transport — url/headers for a remote server, or command/args/env/cwd for a local one.

Body

FieldTypeRequiredDescription
namestringYesDisplay name.
transportstringNoauto (default), streamable-http, sse, or stdio.
urlstringNoEndpoint URL (remote).
headersobjectNoRequest headers (remote).
commandstringNoExecutable (local stdio).
argsarrayNoCommand arguments.
envobjectNoCommand environment variables.
cwdstringNoCommand working directory.
force_serial_tool_callsbooleanNoSerialize this server's tool calls.
type / icon / organization_typestringNoDisplay and categorization metadata.
oauth_client_configobjectNoOAuth client configuration for servers that authenticate with OAuth 2.0.
validate_mcp_serverbooleanNoValidate the server configuration as part of the request (default false).
curl -X POST 'https://{your-deployment-host}/api/v2/mcp-servers' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Weather",
    "transport": "streamable-http",
    "url": "https://mcp.example.com/weather"
  }'

Returns the created PublicMcpServer.

Update an MCP server

PUT /mcp-servers/{mcp_server_id}

Updates a server. Takes the same body as create (minus validate_mcp_server). Returns the updated PublicMcpServer.

OAuth client configuration

Servers that authenticate with OAuth 2.0 carry an oauth_client_config. Set it on create or update; reads return it with the client secret masked.

FieldTypeRequiredDescription
typestringYesOAuth 2.0 flow — oauth2-client-credentials or oauth2-authorization-code.
dcr_enabledbooleanYesUse Dynamic Client Registration.
resource_server_urlstringYesURL of the resource server the client is registered with.
client_idstringNoOAuth 2.0 client ID.
client_secretstringNoOAuth 2.0 client secret — write-only, see below.
scopestringNoSpace-separated OAuth 2.0 scopes.
token_endpointstringNoToken endpoint URL.
authorization_endpointstringNoAuthorization endpoint URL (authorization-code flow only).
token_endpoint_auth_methodstringNoclient_secret_post, client_secret_basic, or none. none is the public-client method (no secret, PKCE only) and is valid only for the authorization-code flow.

The client secret is write-only: responses always mask it as ********** (and null means no secret is stored). On update, sending the mask — or omitting the field — keeps the currently stored secret, so you can round-trip a read response without losing the secret. On create the mask is rejected. Responses name the flow field auth_type rather than type, and additionally include redirect_uri — the redirect URI registered with the provider when the configuration was created.

curl -X POST 'https://{your-deployment-host}/api/v2/mcp-servers' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "CRM",
    "transport": "streamable-http",
    "url": "https://mcp.example.com/crm",
    "oauth_client_config": {
      "type": "oauth2-client-credentials",
      "dcr_enabled": false,
      "resource_server_url": "https://mcp.example.com/crm",
      "client_id": "my-client",
      "client_secret": "shhh",
      "token_endpoint": "https://auth.example.com/oauth/token"
    }
  }'

Delete an MCP server

DELETE /mcp-servers/{mcp_server_id}

Deletes a server. Returns 204 No Content.