Set up Claude as an Affinidi Agent Gateway client

Add an Agent Gateway MCP surface to Claude as a custom connector, so people sign in with your identity provider and use the surface’s tools from claude.ai and Claude Desktop.

This guide adds an Agent Gateway MCP surface to Claude as a custom connector, so people use the surface’s tools from claude.ai and Claude Desktop after signing in with your identity provider. For how the gateway tells MCP clients where to sign in, see How MCP clients find where to sign in.

Claude reaches a surface that requires authentication by signing each person in with OAuth, so the gateway sees who is calling. Where your organisation has Claude’s request headers feature, which is in beta, a connector can instead send a fixed header such as an API key, but then every person’s requests share one identity. The surface tells Claude where to sign in, Claude sends the token your identity provider issues with each request, and the gateway checks the token and applies the surface’s policies to each person’s requests.

Use this guide when:

  • People in your organisation use Claude and need the tools an MCP surface offers.
  • Each person signs in with your identity provider, so the gateway can attribute and authorise every request to that person.

Prerequisites

  • A Claude plan that allows custom connectors. Free plans allow one custom connector. On Team plans, an Owner or Primary Owner adds the connector for the organisation, and on Enterprise plans, so can people with a custom role that includes Manage access to Libraries. See Anthropic’s Get started with custom connectors using remote MCP for the plans and roles.
  • An MCP surface whose Entry point URL is an https URL with no port number in it. Claude connects from Anthropic’s servers on the standard HTTPS port, so the surface must be reachable from the internet. To create one, follow Route MCP clients to your MCP server.
  • Authorization server discovery turned on for the surface, as in Enable authorization server discovery for MCP clients.
  • An authorization server that issues access tokens whose aud claim is the surface’s Entry point URL, and that gives Claude an OAuth client in one of these ways:
    • Client ID Metadata Documents: the server’s metadata advertises "client_id_metadata_document_supported": true and lists none in token_endpoint_auth_methods_supported. Without both, Claude falls back to Dynamic Client Registration.
    • Dynamic Client Registration: the server lets Claude register itself.
    • Your own client: you register a client for Claude, as in step 2.

Steps

Copy the surface’s Entry point URL

  1. In the Agent Gateway dashboard, open the MCP surface on the canvas and select its Access Point node.
  2. Copy the Entry point URL from the banner at the top of the panel, for example https://gateway.example/mcp/alpha.

Register Claude with your authorization server

Skip this step if your authorization server accepts Claude’s published client identity or registers Claude itself.

Otherwise, register an OAuth client for Claude at your authorization server with these settings:

  • Redirect URI: https://claude.ai/api/mcp/auth_callback.
  • Grant type: authorization code, with Proof Key for Code Exchange (PKCE) using S256.

Configure your authorization server so tokens Claude requests for the surface carry the Entry point URL in aud. Claude names it in the token request’s resource parameter, and some servers need extra configuration to copy it into aud.

Note the client ID, and the client secret if the server issues one.

Keep the client secret out of shared places

Store the client secret in your organisation’s secrets manager, and enter it only in Claude’s connector dialog, so it stays out of shared documents, chats, and tickets. Rotate it at your authorization server on your usual schedule, then remove and add the connector again with the new secret. Check that your authorization server’s logs mask the secret.

Add the custom connector in Claude

Open the connector dialog for your plan:

  • Free, Pro, Max, or Ultra: in Claude, open Customize › Connectors, select Add, then Add custom connector.
  • Team or Enterprise: as an Owner or another role that can add connectors, open Organization settings › Connectors, select Add, then Custom, then Web if Claude asks for the connector type.

Then fill in the dialog:

  1. Enter a name, such as Orders tools, and paste the Entry point URL as the MCP server URL. Select Continue if the dialog shows it.
  2. Under Authentication, choose a sign-in option, such as Sign in when needed. No sign in leaves the surface’s authentication unanswered, so the gateway refuses Claude’s requests.
  3. Under OAuth client, choose how Claude gets its client:
    • Use Claude’s published identity: your server advertises Client ID Metadata Document support, as in the prerequisites.
    • Register automatically: your server supports Dynamic Client Registration.
    • Use your own OAuth client: enter the Client ID, and the Client Secret if your server issued one, from step 2.
  4. Select Add.

The dialog’s layout can differ by organisation, with the OAuth client settings under Advanced.

Connect and sign in

  1. On the connector, select Connect. On Team and Enterprise plans, each member does this from their own Customize › Connectors page.
  2. Sign in at your authorization server’s sign-in page, which Claude opens.

Claude returns to the connector, which now lists the surface’s tools.

Turn the connector on in a chat

In a new chat, select + at the lower left of the message box, open Connectors, and turn on the connector.

Confirm

Test 1: Claude lists the surface’s tools after sign-in

Open the connector in Customize › Connectors.

Expected: the connector shows as connected and lists the tools of the MCP server behind the surface.

Test 2: chat request calls a tool through the surface

In a chat with the connector on, ask Claude to do something that needs one of the surface’s tools.

Expected: Claude calls the tool and uses its result. On the surface’s Monitoring tab, the request appears with a successful status.

Troubleshooting

SymptomLikely causeFix
Claude can’t connect, or doesn’t offer a sign-in.Authorization server discovery is off, the Entry point URL carries a port number, or the surface isn’t reachable from the internet.Turn on discovery for the surface, and use an https Entry point URL on the standard port that the internet can reach.
Your authorization server refuses the sign-in because of the redirect URI.The client’s redirect URIs don’t include Claude’s.Add https://claude.ai/api/mcp/auth_callback to the client.
Register automatically fails.Your authorization server doesn’t support Dynamic Client Registration.Register a client for Claude as in step 2, then add the connector again with Use your own OAuth client. Claude keeps a connector’s sign-in settings, so remove the old one first.
Sign-in succeeds, but every request fails, and the gateway answers 401 with error="invalid_token".The token’s aud claim isn’t the Entry point URL, or its issuer doesn’t match the surface’s JWT verification strategy.Configure your authorization server to issue tokens whose aud is the Entry point URL, and check the strategy’s Expected Issuer.
Claude lists fewer tools than the MCP server offers.A per-tool policy or tool gating hides tools from this caller.Check the surface’s tool controls and policies for the signed-in person’s claims.

Next steps