Authorization with Apollo MCP Server


The Apollo MCP server supports authorizing clients (e.g., LLMs) in accordance with the MCP specification.

The current implementation passes through OAuth tokens from MCP clients directly to upstream GraphQL APIs. You can read more about security considerations when using this feature.

Implement authorization with Apollo MCP Server

To implement authorization, you need an OAuth 2.1-compliant Identity Provider (for example, your own in-house IdP or a third-party IdP such as Auth0, Okta, or Keycloak). You need the following values from your IdP:

  • URL: The base URL of your Identity Provider, which is used to validate the JSON Web Tokens (JWTs) issued by it.

  • Audience: Identifies the intended recipient of the token, typically a resource server or API. Represented by the aud claim in the JWT.

  • Scopes: The scopes that the client will request. These scopes define the permissions granted to the client when it accesses the API.

Then, you configure the MCP server with auth settings and the GraphOS Router for JWT authentication using those IdP values.

For an example of how to configure Apollo MCP Server with Auth0, see Authorization with Auth0.

Configuring allowed audiences

You can specify which JWT audiences are allowed to access your MCP Server.

Specific audiences

YAML
mcp.yaml
1transport:
2  type: streamable_http
3  auth:
4    servers:
5      - https://auth.example.com
6    audiences:
7      - https://api.example.com
8      - https://mcp.example.com

Set audiences to a list of accepted audience values. The JWT's aud claim must match one of these values for the token to be considered valid.

Allow any audience

YAML
mcp.yaml
1transport:
2  type: streamable_http
3  auth:
4    servers:
5      - https://auth.example.com
6    allow_any_audience: true

If you set allow_any_audience to true (the default is false), Apollo MCP Server will skip audience validation entirely. This means tokens with any audience claim will be accepted.

caution
Skipping audience validation reduces security. Only use allow_any_audience: true when you trust all tokens issued by your configured OAuth servers, regardless of their intended audience.
Feedback

Edit on GitHub

Ask Community