-
Notifications
You must be signed in to change notification settings - Fork 59
Description
Description:
Currently, the Apollo MCP Server enforces OAuth 2.1 authentication for all incoming client connections according to the MCP Authorization Specification. This requires every client to provide a valid OAuth token or go through the OAuth flow.
We have two configurations currently:
- Skip OAuth completely (for internal/local usage):
schema:
source: local
path: /data/schema/schema.graphql
operations:
source: local
paths:
- /data/operations/query/applicationById.graphql
transport:
type: streamable_http
address: 0.0.0.0
port: 5000
forward_headers:
- Authorization
endpoint: http://api-endpoint:8080/graphql
- Enforce OAuth (for external clients):
transport:
type: streamable_http
auth:
servers:
- https://auth.example.com
audiences:
- https://api.example.com
- https://mcp.example.com
Use Case / Problem:
We have real-time applications with internal MCP clients (e.g., chatbots) that are accessed after login to the main application. These internal clients do not need to go through the OAuth flow again.
However, external clients (e.g., VS Code, Claude) connecting to the same MCP server should follow the standard OAuth flow.
Proposed Feature:
Introduce an option called allow_external_auth_header inside auth field in yaml config to conditionally enforce OAuth validation:
If allow_external_auth_header is true→ skip OAuth validation.
If allow_external_auth_header header is false→ initiate standard OAuth flow.
transport:
type: streamable_http
auth:
servers:
- https://auth.example.com
allow_external_auth_header: true //Default to false
audiences:
- https://api.example.com
- https://mcp.example.com
forward_headers:
- Authorization
This would allow MCP servers to support both internal trusted clients and external clients securely. As if we have token exchange also in place before hit actual API so any way it will be secure for internal clients too.
References / Notes:
FastMCP already supports this feature for conditional OAuth enforcement in the middleware.
This would improve developer experience for internal applications while maintaining security for external access.
Currently, there is no way to conditionally enforce OAuth validation based on the presence of the Authorization header. FastMCP supports this feature, allowing internal clients to bypass OAuth if they already provide a valid authorization header.