---
title: "Authorization"
description: "How the SignatureAPI MCP server authenticates agents with OAuth 2.1: discovery, Dynamic Client Registration, consent, tokens, and the errors clients see."
canonical: "https://signatureapi.com/docs/ai-toolkit/mcp/authorization"
source: "https://signatureapi.com/docs/ai-toolkit/mcp/authorization.md"
last_verified_api_version: "1.18.1"
last_modified: "2026-11-18T16:06:16Z"
---

# Authorization

How the SignatureAPI MCP server authenticates agents with OAuth 2.1: discovery, Dynamic Client Registration, consent, tokens, and the errors clients see.

_Last verified against API version 1.18.1._

The MCP server authenticates every request with an **OAuth 2.1 access token** issued through Dynamic Client Registration. Interactive MCP clients (Claude, ChatGPT, Cursor, and others) run the flow automatically the first time you connect. After that, the client refreshes tokens on its own.

## Discovery endpoints

Standards-compliant MCP clients only need the server URL. A request without a token gets a `401` whose `WWW-Authenticate` header points to the protected resource metadata ([RFC 9728](https://datatracker.ietf.org/doc/html/rfc9728)):

```text
https://mcp.signatureapi.com/.well-known/oauth-protected-resource/mcp
```

That document names the authorization server in `authorization_servers` and lists the scopes to request in `scopes_supported`. The client then reads the authorization server's own metadata ([RFC 8414](https://datatracker.ietf.org/doc/html/rfc8414)) from that issuer. `mcp.signatureapi.com` serves no authorization server metadata itself.

## The authorization flow

### Discovery and registration

**How an MCP client gets its access token, part 1: discovery and registration**

Participants: MCP client, MCP server, Authorization server.

1. **MCP client** to **MCP server**: `POST /mcp` without a token
   Usually the first time you add the server.
2. **MCP server** to **MCP client**: `401` with `WWW-Authenticate`
   The header names the protected resource metadata URL and the scopes to request.

   ```http
   HTTP/1.1 401 Unauthorized
   WWW-Authenticate: Bearer resource_metadata="https://mcp.signatureapi.com/.well-known/oauth-protected-resource/mcp", scope="openid profile email offline_access user:org:read"
   ```
3. **MCP client** to **MCP server**: Read the protected resource metadata
   `GET /.well-known/oauth-protected-resource/mcp` on the MCP server (RFC 9728).
4. **MCP server** to **MCP client**: `authorization_servers` and `scopes_supported`
5. **MCP client** to **Authorization server**: Read the authorization server metadata
   From the issuer that `authorization_servers` names (RFC 8414). The MCP server's own domain serves no authorization server metadata.
6. **MCP client** to **Authorization server**: Register the client (Dynamic Client Registration)
7. **Authorization server** to **MCP client**: `client_id`

### Sign-in and token

**How an MCP client gets its access token, part 2: sign-in and the token**

Participants: MCP client, MCP server, Authorization server, You, in a browser.

1. **MCP client** to **You, in a browser**: Open the authorization URL
2. **You, in a browser** to **Authorization server**: Sign in, choose the organization, click Allow
   The organization you choose is the account the agent acts for.
3. **Authorization server** to **MCP client**: Redirect with an authorization code
4. **MCP client** to **Authorization server**: Exchange the code with the PKCE verifier
5. **Authorization server** to **MCP client**: Access token and refresh token
6. **MCP client** to **MCP server**: `POST /mcp` with `Authorization: Bearer <token>`
   From here on the client refreshes the token on its own. You sign in again only after you disconnect the app or the refresh token stops working.
7. **MCP server** to **MCP client**: Tool result

PKCE is required. The `offline_access` scope gives the client a refresh token, so you sign in once per client.

![Authorizing an MCP client on SignatureAPI](https://signatureapi.com/docs/ai-toolkit/images/authorize.webp)

## Token contents

Tokens issued for the MCP server carry:

- `sub`: the SignatureAPI user.
- `org_id`: the organization (account) the user chose on the consent screen. The server resolves the account from this claim, so a user in several organizations authorizes one at a time.
- `client_id`: the OAuth client. It appears under each connection in the Dashboard's **Settings → Applications** list.

SignatureAPI checks the token and the connection on every request. A token that is still valid stops working the moment you disconnect its application. See [Managing connections](https://signatureapi.com/docs/ai-toolkit/mcp/managing-connections).

## Patterns

### Personal use (an end user connecting their own agent)

This is the default and what every supported MCP client implements. The user runs a client, the client performs Dynamic Client Registration, and the user signs in once. Nothing else to configure.

### Service provider running an agent on behalf of users

The hosted MCP server is for end users connecting their own agent to their own SignatureAPI account. It is not suited for multi-tenant products.

If you are building a product that serves many customers, build your own MCP tools on top of the [SignatureAPI REST API](https://signatureapi.com/docs/api/overview). Your backend holds your SignatureAPI key, and your tools enforce which tenant can see what.

## Errors

The MCP endpoint answers `401` when the client must authorize again:

| Message                       | Meaning                                            |
| ----------------------------- | -------------------------------------------------- |
| `Missing bearer token`        | The request has no `Authorization: Bearer` header. |
| `Token is revoked or expired` | SignatureAPI no longer accepts the token.          |

Both responses carry the `WWW-Authenticate` header that points to the discovery document, so clients start the flow again on their own.

Other refusals arrive as the tool call's error, with a message the agent can show you:

| Message                                         | Meaning                                                                                                                          |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `Application has been disconnected`             | Someone disconnected this application in **Settings → Applications**. Remove and add the server in your client to connect again. |
| `Account is inactive`                           | The account is suspended or blocked. [Contact support](https://signatureapi.com/contact-us).                                     |
| `Account not found`, `User has no organization` | The organization on the token is not linked to a SignatureAPI account. Sign in again and choose another organization.            |
