v4

latestOpenAPI 3.1.02026-08-0255174167.5 KB
contextMcp

Connect a Context MCP server

Registers an MCP server and wires its tools into the account's voice agent. Dial probes the server's URL to determine how it authenticates:

  • Unauthenticated or static — the connection is wired immediately and returned with status: "connected".

  • OAuth 2.1–protected — the response includes an authorizationUrl and status: "pending_auth". Open that URL in a browser to grant consent; Dial completes the connection on the OAuth callback and then manages token refresh for you. The server's authorization server must support Dynamic Client Registration (RFC 7591).

If the server is unreachable, or responds to the probe with a server error (HTTP 5xx), the request is rejected with 400 and a message naming the status Dial observed — the fault is on your server, so fix it and try again.

post/api/v1/context-mcps

Headers

Authorizationstring required

Your Dial API key, sent as Authorization: Bearer sk_live_...

Request body

namestring required

Display name for the connection.

urlstring uri required

HTTPS MCP server URL (http allowed only for localhost in development).

headersobject

Extra static headers to send on every connection. For an OAuth-protected server, any Authorization header you set is ignored — Dial manages it.

queryParamsobject

Query parameters to append to the connection URL.

timeoutMsinteger

Connection timeout in ms. Defaults to 120000.

Response

The created connection. For OAuth servers, authorizationUrl is present and the connection stays pending_auth until consent completes.

authorizationUrlstring uri nullable

Present only for OAuth-protected servers. Open in a browser to grant consent and finish connecting.