MCP

Edit MCP client

Updates an existing MCP client's configuration. Unlike client creation, tool_pricing can be included to set per-tool execution costs since tools are already fetched. Optionally provide vk_configs to manage which virtual keys have access to this MCP server and with which tools. When provided, this fully replaces all existing VK assignments in a single atomic transaction. Set disabled: true to shut down the client's connection and workers without removing it. Set disabled: false to reconnect a previously disabled client.

PUT
/api/mcp/client/{id}
AuthorizationBearer <token>

Bearer token authentication. Use your MPilot virtual-key JWT or admin JWT. Virtual keys (prefixed with sk-bf-) can also be passed here.

In: header

Path Parameters

idstring

MCP client ID

client_id?string

Unique identifier for the MCP client

name?string

Display name for the MCP client

is_code_mode_client?boolean

Whether this client is available in code mode

connection_type?string

Connection type for MCP client

Value in"http" | "stdio" | "sse" | "inprocess"
connection_string?string

HTTP or SSE URL (required for HTTP or SSE connections)

stdio_config?object

STDIO configuration for MCP client

auth_type?string

Authentication type for the MCP connection

Value in"none" | "headers" | "oauth" | "per_user_oauth"
oauth_config_id?string

OAuth config ID for OAuth authentication. References the oauth_configs table. Only relevant when auth_type is "oauth".

headers?object

Custom headers to include in requests. Only used when auth_type is "headers".

Empty Object

tools_to_execute?array<string>

Include-only list for tools. ["*"] => all tools are included [] => no tools are included ["tool1", "tool2"] => include only the specified tools

tools_to_auto_execute?array<string>

List of tools that can be auto-executed without user approval. Must be a subset of tools_to_execute. ["*"] => all executable tools can be auto-executed [] => no tools are auto-executed ["tool1", "tool2"] => only specified tools can be auto-executed

tool_pricing?object

Per-tool cost in USD for execution. Key is the tool name, value is the cost per execution. Example: {"read_file": 0.001, "write_file": 0.002} Note: Only available when updating an existing client after tools have been fetched.

Empty Object

allow_on_all_virtual_keys?boolean

When true, this MCP client's tools are accessible to all virtual keys without requiring explicit per-key assignment. All tools are allowed by default. If a virtual key has an explicit MCP config for this client, that config takes precedence and overrides this behaviour.

Defaultfalse
disabled?boolean

When true, the client's connection, health monitor, and tool syncer are shut down. The client entry is preserved so it can be re-enabled later by sending disabled: false. Disabled clients do not expose tools to inference requests.

Defaultfalse
vk_configs?array<object>

When provided, replaces all virtual key assignments for this MCP client. Each entry specifies a virtual key and the tools it is allowed to call. To remove all VK access, provide an empty array []. Omit this field to leave existing VK assignments unchanged.

Response Body

curl -X PUT "https://loading/{AI_GATEWAY_URL}/api/mcp/client/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "status": "success",
  "message": "Operation completed successfully"
}
{
  "event_id": "string",
  "type": "string",
  "is_bifrost_error": true,
  "status_code": 0,
  "error": {
    "type": "string",
    "code": "string",
    "message": "string",
    "param": "string",
    "event_id": "string"
  },
  "extra_fields": {
    "provider": "openai",
    "model_requested": "string",
    "request_type": "string"
  }
}
{
  "event_id": "string",
  "type": "string",
  "is_bifrost_error": true,
  "status_code": 0,
  "error": {
    "type": "string",
    "code": "string",
    "message": "string",
    "param": "string",
    "event_id": "string"
  },
  "extra_fields": {
    "provider": "openai",
    "model_requested": "string",
    "request_type": "string"
  }
}
On this page

On this page

No Headings