---
docId: doc_7de82a95cdcd40c09de8384a01a3e5c5
title: Start OAuth for an MCP server
description: "Get the link for a person to authorize an MCP server with OAuth."
api:
  group: herramientas/servidores-mcp
  auth: bearer
  operations:
    - operationId: startMcpServerOAuth
      method: POST
      path: '/v1/tools/mcp/{mcpId}/oauth/start'
      postmanName: Start OAuth for an MCP server
---

<script>
  import { Ways, Note } from '$lib/components';
</script>

# Start OAuth for an MCP server

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

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X POST https://api.platic.ai/v1/tools/mcp/$MCP_ID/oauth/start \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

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

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `mcpId` | string | Id of the MCP server | ✓ |

## Request body

It has no body.

## Response

```json
{
  "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 |

<Note type="important">

The call changes nothing on the server and can be repeated. Use it also to check whether it has been authorized yet.

</Note>

## Notes

- Whoever opens `authorizeIn` needs a Platica session with access to the workspace.
- After authorizing, continue with [test an MCP server](/api-reference/mcp-servers/test): that is where the server says which tools it offers. Then [choose tools](/api-reference/mcp-servers/select-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.
