ApiMCP Servers

Add an MCP server

POST
/mcp-servers

Add an MCP server that your assistants can use during a call. Authenticate with the headers the server expects, such as an API key or a bearer token you obtained from its provider; the platform stores them encrypted and sends them with every request. Then attach the server to an assistant with a tool of type mcp in llm_config.tools.

The URL must use https:// and resolve to a public address.

Authorization

BearerAuth
AuthorizationBearer <token>

API key authentication. Get your key from the dashboard.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/mcp-servers" \  -H "Content-Type: application/json" \  -d '{    "name": "Mailbox",    "url": "https://mcp.example.com/mcp"  }'
{
  "mcp_server": {
    "id": "2f1c9a7e-4b3d-4e8a-9c21-6d5f0b7a8e13",
    "name": "Mailbox",
    "url": "https://mcp.example.com/mcp",
    "transport": "streamable_http",
    "header_names": [
      "Authorization"
    ],
    "timeout_seconds": 20,
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}
{
  "error": "Invalid API key",
  "message": "string"
}
{
  "error": "Invalid API key",
  "message": "string"
}
{
  "error": "Invalid API key",
  "message": "string"
}