> ## Documentation Index
> Fetch the complete documentation index at: https://docs.seamless.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> Authenticate to the Seamless MCP server with OAuth 2.1 or an API key.

The Seamless.AI MCP server supports two authentication methods.

<Tabs>
  <Tab title="OAuth 2.1 (recommended)">
    OAuth is the primary method. MCP clients that support the [MCP authorization specification](https://modelcontextprotocol.io/specification/2025-03-26/basic/authorization) handle the flow automatically:

    1. **Discovery** — Client fetches `https://mcp.seamless.ai/.well-known/oauth-authorization-server`.
    2. **Authorization** — Browser login to Seamless.AI and MCP authorization.
    3. **Token exchange** — Authorization code exchanged with PKCE (S256).
    4. **Automatic refresh** — Client refreshes expired tokens.

    All requests use `Authorization: Bearer <token>`.

    ### Client identification

    * **Auto-discovery (CIMD / DCR)** — Most clients register automatically. Provide only the server URL.
    * **Explicit Client ID** — Optional `client_id` from **Settings > Public API Connections > OAuth Connection** in the [Seamless app](https://login.seamless.ai/settings/public-api).

    ### OAuth endpoints

    | Parameter              | Value                                   |
    | ---------------------- | --------------------------------------- |
    | Authorization endpoint | `https://mcp.seamless.ai/mcp/authorize` |
    | Token endpoint         | `https://mcp.seamless.ai/mcp/token`     |
    | Registration endpoint  | `https://mcp.seamless.ai/mcp/register`  |
    | Revocation endpoint    | `https://mcp.seamless.ai/mcp/revoke`    |
    | Grant types            | `authorization_code`, `refresh_token`   |
    | Code challenge method  | `S256` (PKCE required)                  |
    | Scope                  | `mcp.all`                               |

    ### Organization setup

    1. Go to **Settings > Public API Connections > OAuth Connection** in the [Seamless app](https://login.seamless.ai/settings/public-api)
    2. Click **+ Create New Connection**
    3. Select **OAuth Connection**
    4. Enter a **Connection Name** (e.g. "MCP Access")
    5. Under **Scopes**, check **MCP** (and **Public API v1** if you also need REST)
    6. Choose the **Group** with access and **Save Connection**

    <Note>
      Contact your administrator if you see *"organization has not enabled MCP access"*.
    </Note>
  </Tab>

  <Tab title="API key">
    For clients without MCP OAuth, pass an API key in the `Token` header.

    1. Go to **Settings > Public API Connections > API Key** in the [Seamless app](https://login.seamless.ai/settings/public-api)
    2. Click **+ Create New Connection**
    3. Enter a **Connection Name** and optional **Description**
    4. Under **Scopes**, check **MCP**
    5. Choose the **Group** and **Save Connection**
    6. Copy the API key and pass it on every request to `https://mcp.seamless.ai/mcp`

    ### Client configuration

    ```json theme={null}
    {
      "mcpServers": {
        "seamless": {
          "url": "https://mcp.seamless.ai/mcp",
          "headers": {
            "Token": "<YOUR_API_KEY>"
          }
        }
      }
    }
    ```

    ### Test with curl

    ```bash theme={null}
    curl https://mcp.seamless.ai/mcp \
      -H "Content-Type: application/json" \
      -H "Token: <YOUR_API_KEY>" \
      -d '{
        "jsonrpc": "2.0",
        "method": "tools/list",
        "params": {},
        "id": 1
      }'
    ```
  </Tab>
</Tabs>
