Skip to Content
API ReferenceMCP Servers API

MCP Servers API

Endpoints for discovering MCP server state.

GET /api/mcp-servers

Returns all configured MCP servers with their runtime state and loaded tools.

GET /api/mcp-servers Authorization: Bearer <token>
{ "servers": [ { "id": "github", "name": "GitHub", "type": "stdio", "enabled": true, "requireApproval": true, "tools": [ { "id": "github_create_issue", "name": "Create Issue", "description": "..." }, { "id": "github_list_repos", "name": "List Repos", "description": "..." } ], "error": null } ] }

Each server object contains:

FieldTypeDescription
idstringServer identifier (from config)
namestringDisplay name
type'stdio' | 'http'Transport type
enabledbooleanWhether the server is enabled
requireApprovalbooleanWhether tool calls need user approval
tools{ id, name, description }[]Tools loaded from this server
errorstring?Connection or load error, if any
authUrlstring?OAuth authorization URL when authorization is pending

Managing MCP Servers

MCP servers are managed through the Configuration API. Add, update, or remove servers by patching the mcpServers key:

Adding a server

PATCH /api/config Authorization: Bearer <token> Content-Type: application/json { "mcpServers": { "github": { "command": "bunx", "args": ["@modelcontextprotocol/server-github"], "name": "GitHub", "env": ["GITHUB_PERSONAL_ACCESS_TOKEN"], "enabled": true, "requireApproval": true } } }

Adding a remote server with headers

PATCH /api/config Authorization: Bearer <token> Content-Type: application/json { "mcpServers": { "remote-tools": { "url": "https://example.com/mcp", "name": "Remote Tools", "headers": { "Authorization": "Bearer sk-abc123" }, "enabled": true, "requireApproval": true } } }

Adding a remote server with OAuth

PATCH /api/config Authorization: Bearer <token> Content-Type: application/json { "mcpServers": { "oauth-server": { "url": "https://example.com/mcp", "name": "OAuth Server", "oauth": true, "enabled": true, "requireApproval": true } } }

After adding, check GET /api/mcp-servers for the authUrl field. Direct the user to that URL to complete authorization.

Disabling a server

PATCH /api/config Authorization: Bearer <token> Content-Type: application/json { "mcpServers": { "github": { "enabled": false } } }

Removing a server

PATCH /api/config Authorization: Bearer <token> Content-Type: application/json { "mcpServers": { "github": null } }

Server config fields

FieldRequiredDescription
commandOne of command or urlCommand to execute for stdio transport
argsNoArguments for the command
urlOne of command or urlURL for HTTP transport
enabledNoWhether the server is active (default: true)
nameNoDisplay name (defaults to server ID)
envNoEnvironment variable names to forward from host to the server process
requireApprovalNoWhether tool calls need approval (default: true)
headersNoKey-value pairs sent as HTTP headers to remote servers
oauthNoEnable OAuth authentication for remote servers (default: false)

SDK Types

These types are available from @pandorakit/sdk/api:

import type { McpServerInfo, McpToolOverview, AddMcpServerInput } from '@pandorakit/sdk/api'

See SDK Client for the typed client that wraps these endpoints.

Last updated on