v20

OpenAPI 3.1.0raw.githubusercontent.com2026-08-035471202.8 KB
OAuth

Import OAuth tokens

Stores OAuth tokens you obtained yourself (e.g. via the SDK's runOAuthLogin — interactive loopback, headless, or client-credentials) for this server, scoped to your user, project, and server. Subsequent API calls against the server inject the stored access token automatically, and 401s from the server trigger a server-side refresh — no further caller involvement.

This closes the loop after an OAUTH_REQUIRED error.

post/projects/{projectId}/servers/{serverId}/oauth/import-tokens

Path parameters

projectIdstring required

ID of the hosted project that contains the server.

serverIdstring required

ID of the server inside the project.

Request body

serverUrlstring required

The MCP server URL the tokens were obtained for.

oauthResourceUrlstring

OAuth protected-resource URL, when it differs from serverUrl.

Response

Tokens stored.

importedtrue required
expiresAtnumber nullable

Epoch milliseconds when the stored access token expires, or null if unknown.