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.
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
Unique identifier for the MCP client (optional, auto-generated if not provided)
Display name for the MCP client
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.
true"http"Authentication type for the MCP connection
"none" | "headers" | "oauth" | "per_user_oauth"OAuth config ID for OAuth authentication. Set after OAuth flow is completed. References the oauth_configs table. Only relevant when auth_type is "oauth".
Custom headers to include in requests. Only used when auth_type is "headers".
Empty Object
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.
Include-only list for tools. ["*"] => all tools are included [] => no tools are included ["tool1", "tool2"] => include only the specified tools
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
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.
falseHTTP URL (required for HTTP connection type)
Unique identifier for the MCP client (optional, auto-generated if not provided)
Display name for the MCP client
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.
true"sse"Authentication type for the MCP connection
"none" | "headers" | "oauth" | "per_user_oauth"OAuth config ID for OAuth authentication. Set after OAuth flow is completed. References the oauth_configs table. Only relevant when auth_type is "oauth".
Custom headers to include in requests. Only used when auth_type is "headers".
Empty Object
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.
Include-only list for tools. ["*"] => all tools are included [] => no tools are included ["tool1", "tool2"] => include only the specified tools
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
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.
falseSSE URL (required for SSE connection type)
Unique identifier for the MCP client (optional, auto-generated if not provided)
Display name for the MCP client
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.
true"stdio"Authentication type for the MCP connection
"none" | "headers" | "oauth" | "per_user_oauth"OAuth config ID for OAuth authentication. Set after OAuth flow is completed. References the oauth_configs table. Only relevant when auth_type is "oauth".
Custom headers to include in requests. Only used when auth_type is "headers".
Empty Object
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.
Include-only list for tools. ["*"] => all tools are included [] => no tools are included ["tool1", "tool2"] => include only the specified tools
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
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.
falseSTDIO 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"
}
}