Start OAuth for an MCP server

SDK platic.tools.mcp.startOAuth()

For a server with auth.type: "oauth2", return authorizeIn: the Platica page where a signed-in person completes authorization. The API does not receive or return tokens. Consent is completed in the browser on that person's behalf.

Example

await platic.tools.mcp.startOAuth("mcp_123");

Path parameters

ParameterTypeDescriptionRequired
mcpIdstringId of the MCP server✓

Request body

It has no body.

Response

{
  "status": "success",
  "message": "A person must authorize this server in Platica",
  "data": {
    "mcpId": "QZPHpckDPC58JIVLQA3Z",
    "authorized": false,
    "authorizeIn": "https://app.platica.mx/workspace/ws_123/integrations/functions/mcp/QZPHpckDPC58JIVLQA3Z",
    "nextStep": "This server uses OAuth: a person signed in to Platica has to authorize it at https://app.platica.mx/workspace/ws_123/integrations/functions/mcp/QZPHpckDPC58JIVLQA3Z. Then test it."
  }
}

Response fields

FieldTypeDescription
mcpIdstringId of the server
authorizedbooleantrue if the server is already authorized
authorizeInstringThe Platica page where a person authorizes. Open it in a browser
nextStepstringEnglish text that says what is missing. Do not program against its wording

message is Already authorized when authorized is true, and A person must authorize this server in Platica when it is not.

Errors

Statusdetails.codeWhen it happens
403FORBIDDENThe person behind the token does not have access to Integrations
404NOT_FOUNDThe server does not exist in this workspace
409NOT_OAUTHThe server does not use OAuth

Notes

  • Whoever opens authorizeIn needs a Platica session with access to the workspace.
  • After authorizing, continue with test an MCP server: that is where the server says which tools it offers. Then choose tools.
  • If the server ends up in needs_reauth, repeat the process.
  • A clientSecret is never sent inside auth: it answers 400 SECRET_REFERENCE_REQUIRED. If the server uses its own client, its secret is the auth.clientSecret slot.