Skip to main content
POST
Complete MCP OAuth flow

Authorizations

Authorization
string
header
required

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

Path Parameters

server_id
string
required

The ID of the MCP server.

Body

application/json
code
string
required

Authorization code returned by the OAuth authorization server on the callback.

Maximum string length: 4096
state
string
required

The state value the OAuth authorization server echoed on the callback. Must match the value returned from start-oauth.

Maximum string length: 512
redirect_uri
string<uri>
required

The same redirect_uri passed to start-oauth. HTTPS is required except for loopback (http://localhost, http://127.0.0.1, http://[::1]).

Maximum string length: 2048

Response

OAuth flow completed

object
enum<string>
required
Available options:
mcp_oauth_callback
oauth_configured
enum<boolean>
required

Always true when the endpoint returns success; the flow only completes if the token exchange succeeded.

Available options:
true
tools_synced
boolean
required

True if Datagrid automatically re-synced the MCP server's tool manifest after the OAuth exchange. False if the caller lacks organization-edit permissions or the sync itself failed.

message
string

Human-readable outcome. Optional product copy — branch on oauth_configured and tools_synced rather than matching this text.