MCP

Add MCP client

Adds a new MCP client with the specified configuration. Note: tool_pricing is not available when creating a new client as tools are fetched after client creation.

POST
/api/mcp/client
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

client_id?string

Unique identifier for the MCP client (optional, auto-generated if not provided)

namestring

Display name for the MCP client

is_code_mode_client?boolean
is_ping_available?boolean

Whether the MCP server supports ping for health checks. If true, uses lightweight ping method for health checks. If false, uses listTools method for health checks instead.

Defaulttrue
connection_typestring
Value in"http"
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. Set after OAuth flow is completed. 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

oauth_config?OAuthConfigRequest

OAuth configuration for initiating OAuth flow. Only include this when creating a client with auth_type "oauth". This will trigger the OAuth flow and return an authorization URL.

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

allow_on_all_virtual_keys?boolean

When true, this MCP client's tools are available to all virtual keys by default, without requiring an explicit virtual key assignment. An explicit virtual key config always overrides this setting for that key.

Defaultfalse
connection_stringstring

HTTP URL (required for HTTP connection type)

client_id?string

Unique identifier for the MCP client (optional, auto-generated if not provided)

namestring

Display name for the MCP client

is_code_mode_client?boolean
is_ping_available?boolean

Whether the MCP server supports ping for health checks. If true, uses lightweight ping method for health checks. If false, uses listTools method for health checks instead.

Defaulttrue
connection_typestring
Value in"sse"
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. Set after OAuth flow is completed. 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

oauth_config?OAuthConfigRequest

OAuth configuration for initiating OAuth flow. Only include this when creating a client with auth_type "oauth". This will trigger the OAuth flow and return an authorization URL.

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

allow_on_all_virtual_keys?boolean

When true, this MCP client's tools are available to all virtual keys by default, without requiring an explicit virtual key assignment. An explicit virtual key config always overrides this setting for that key.

Defaultfalse
connection_stringstring

SSE URL (required for SSE connection type)

client_id?string

Unique identifier for the MCP client (optional, auto-generated if not provided)

namestring

Display name for the MCP client

is_code_mode_client?boolean
is_ping_available?boolean

Whether the MCP server supports ping for health checks. If true, uses lightweight ping method for health checks. If false, uses listTools method for health checks instead.

Defaulttrue
connection_typestring
Value in"stdio"
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. Set after OAuth flow is completed. 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

oauth_config?OAuthConfigRequest

OAuth configuration for initiating OAuth flow. Only include this when creating a client with auth_type "oauth". This will trigger the OAuth flow and return an authorization URL.

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

allow_on_all_virtual_keys?boolean

When true, this MCP client's tools are available to all virtual keys by default, without requiring an explicit virtual key assignment. An explicit virtual key config always overrides this setting for that key.

Defaultfalse
stdio_configobject

STDIO configuration (required for STDIO connection type)

Response Body

curl -X POST "https://loading/{AI_GATEWAY_URL}/api/mcp/client" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "connection_type": "http",    "connection_string": "string"  }'
{
  "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