Test MCP Connection

Probe a customer-supplied MCP server config without persisting anything. The server opens the configured transport, runs the `initialize` + `list_tools` handshake, and returns either the discovered tool catalogue or a structured error string. Pass `tool_id` from the edit-form flow when the auth payload carries `_set` markers but no plaintext, so the server can hydrate the stored secret from the encrypted column before probing.

Authentication

AuthorizationBearer

Enter your API key with the Bearer prefix, e.g. ‘Bearer sk_…’.

Request

This endpoint expects an object.
configobjectRequired

Config shape for kind=mcp. The worker opens the configured transport at session start, runs initialize + list_tools, and registers each discovered remote tool as a livekit-agents function_tool proxying through the long-lived ClientSession.

tool_idstringOptional

Optional tool_<crockford> id of the existing tool to hydrate stored secrets from. Raw UUIDs and other-resource prefixes are rejected.

Response

Probe result. The 200 envelope is used for both success and structured failure — inspect error to disambiguate. Network and validation failures never bubble up as non-2xx so the console can render them inline next to the form.

toolslist of objects or null
errorstring
detailsobject

Structured upstream signal for an MCP probe failure. All fields are optional; the console renders what’s present. stage names the phase the probe was in (validation, oauth2_token, mcp_connect, mcp_initialize, mcp_notify, mcp_list_tools). oauth2_error / oauth2_error_description mirror RFC 6749 §5.2 when the customer’s auth server returned the standard error shape. http_status is the upstream status code for transport failures. upstream_body is a truncated prefix (max ~1 KiB) of the upstream response body when the failure isn’t structured. field_hint names a form field (endpoint, transport, token, token_url, client_id, client_secret, scope) the console should highlight so the customer knows what to fix.

Errors

400
Bad Request Error
401
Unauthorized Error