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
curl -X POST https://api.platic.ai/v1/tools/mcp/$MCP_ID/oauth/start \
-H "Authorization: Bearer $PLATIC_API_KEY" await platic.tools.mcp.startOAuth("mcp_123"); Path parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
mcpId | string | Id 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
| Field | Type | Description |
|---|---|---|
mcpId | string | Id of the server |
authorized | boolean | true if the server is already authorized |
authorizeIn | string | The Platica page where a person authorizes. Open it in a browser |
nextStep | string | English 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
| Status | details.code | When it happens |
|---|---|---|
403 | FORBIDDEN | The person behind the token does not have access to Integrations |
404 | NOT_FOUND | The server does not exist in this workspace |
409 | NOT_OAUTH | The server does not use OAuth |
Important
The call changes nothing on the server and can be repeated. Use it also to check whether it has been authorized yet.
Notes
- Whoever opens
authorizeInneeds 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
clientSecretis never sent insideauth: it answers400 SECRET_REFERENCE_REQUIRED. If the server uses its own client, its secret is theauth.clientSecretslot.