Components
Modes at a glance
Current flow (Bearer tokens)
- Developer or user runs
mcp-agent login. - Browser-based auth returns an API key (
lm_mcp_api_*), stored locally. - CLI and MCP clients use the key in the
Authorization: Bearerheader. - Deployment validates the token before executing tools/workflows.
Upcoming OAuth architecture
The forthcoming OAuth implementation follows the MCP Authorization specification:/.well-known/oauth-authorization-servermetadata endpoint (RFC 8414).- Authorization endpoint (
/oauth2/authorize) supporting Google, GitHub, and custom IdPs. - Token endpoint (
/oauth2/token) returning access + refresh tokens. - Resource server metadata (
/.well-known/oauth-protected-resource) for deployments advertising supported methods (bearer_methods_supported, scopes). - Token introspection and JWKS endpoints for JWT validation.
Choosing an authentication mode
- Internal tools or staging → keep bearer tokens (fastest path).
- Publishing to ChatGPT Apps → deploy with
--no-auth, optionally combine with rate limiting in code. - Customer-facing apps → use bearer tokens initially, migrate to OAuth when available to integrate with existing identity providers.
- Agents calling other MCP servers → configure outbound auth in
mcp_agent.config.yaml. This is independent of how end-users authenticate to your deployment.
