Skip to main content
POST
Finish connecting an external MCP server

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Body for POST /mcp-connections/complete. The state identifies the authorization flow to finish; the authorization code itself is already held server-side and is never sent by the client.

state
string
required

The one-time state issued by POST /mcp-connections and forwarded to the app by GET /mcp-connections/callback. Consumed once the connection completes.

Maximum string length: 512
Example:

"Yk8fQ2Zsb3dTdGF0ZQ"

Response

Connection completed. Returns the status view, normally with status: connected and the access token's expires_at.

Status view of one connection. Deliberately credential-free — the registered client secret and the encrypted access/refresh tokens are never returned.

connection_id
string<uuid>
required
Example:

"b3f1c2a4-5d6e-47f8-9a0b-1c2d3e4f5a6b"

server_url
string<uri>
required

The external MCP server this connection targets.

Example:

"https://huggingface.co/mcp"

alias
string
required
Example:

"huggingface"

authorization_server
string<uri>
required

The OAuth issuer discovered for the server.

Example:

"https://huggingface.co"

status
enum<string>
required

Lifecycle. pending after creation, and while waiting on the user's consent and the completion call; connected once the token exchange succeeds and tools/list validates; error for a failed connection.

Available options:
pending,
connected,
error
Example:

"connected"

created_at
string<date-time>
required
Example:

"2026-07-12T17:00:00Z"

updated_at
string<date-time>
required
Example:

"2026-07-12T17:02:11Z"

expires_at
string<date-time> | null

When the current access token expires, if the server issued an expiry. The platform refreshes it automatically before use when a refresh token is available.

Example:

"2026-07-12T18:30:00Z"