Skip to content

MCP server

Authorization

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

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://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) 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
MCP client
MCP server
Authorization server
  1. MCP client to MCP server: POST /mcp without a token
  2. MCP server to MCP client: 401 with WWW-Authenticate
  3. MCP client to MCP server: Read the protected resource metadata
  4. MCP server to MCP client: authorization_servers and scopes_supported
  5. MCP client to Authorization server: Read the authorization server metadata
  6. MCP client to Authorization server: Register the client (Dynamic Client Registration)
  7. Authorization server to MCP client: client_id
  1. POST /mcp without a token

    Usually the first time you add the server.

  2. 401 with WWW-Authenticate

    The header names the protected resource metadata URL and the scopes to request.

    Show the 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. Read the protected resource metadata

    GET /.well-known/oauth-protected-resource/mcp on the MCP server (RFC 9728).

  4. 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.

Dashed: a reply, or an asynchronous call such as a webhook.

Sign-in and token

How an MCP client gets its access token, part 2: sign-in and the token
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
  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>
  7. MCP server to MCP client: Tool result
  1. Sign in, choose the organization, click Allow

    The organization you choose is the account the agent acts for.

  2. 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.

Dashed: a reply, or an asynchronous call such as a webhook.

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

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.

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. 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:

MessageMeaning
Missing bearer tokenThe request has no Authorization: Bearer header.
Token is revoked or expiredSignatureAPI 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:

MessageMeaning
Application has been disconnectedSomeone disconnected this application in Settings → Applications. Remove and add the server in your client to connect again.
Account is inactiveThe account is suspended or blocked. Contact support.
Account not found, User has no organizationThe organization on the token is not linked to a SignatureAPI account. Sign in again and choose another organization.