mcp-oauth
Verified Safeby giantswarm
Overview
An OAuth 2.1 Authorization Server library for Model Context Protocol (MCP) servers, designed to manage user authentication and authorization across multiple identity providers.
Installation
go build && ./mcp-2025-11-25Environment Variables
- GOOGLE_CLIENT_ID
- GOOGLE_CLIENT_SECRET
Security Notes
The server exhibits strong security posture, including mandatory PKCE enforcement, refresh token rotation with reuse detection and immediate revocation of all associated tokens, comprehensive redirect URI validation to prevent SSRF and open redirect attacks (including DNS resolution checks), and generic error messages to prevent information leakage. It incorporates a two-layer PKCE architecture (client-to-server and server-to-provider) for defense-in-depth. Critical secrets like client secrets are hashed using bcrypt. The project explicitly warns against using environment variables for secrets in production and recommends secret managers, demonstrating high security awareness. OpenTelemetry tracing is implemented with explicit warnings against logging sensitive data, and reserved attribute keys prevent accidental logging of credentials. Rate limiting is applied to discovery endpoints, IP addresses, and user IDs. The code includes internal security warnings for development-only features (e.g., stdout exporters, insecure OTLP transport).
Similar Servers
guidance-for-deploying-model-context-protocol-servers-on-aws
Deploy secure, OAuth 2.0 authenticated Model Context Protocol (MCP) servers on AWS using CDK.
sagemcp
A scalable platform for hosting Multi-tenant Model Context Protocol (MCP) servers with multi-tenant support, OAuth integration, and connector plugins for various services.
oauth-mcp-proxy
OAuth 2.1 authentication library for Go-based Model Context Protocol (MCP) servers, supporting multiple SDKs and providers.
mcp-server-playground
A Model Context Protocol (MCP) server that acts as an OAuth proxy for 3rd party authorization servers like Auth0, provides stateful session management, and exposes various tools for system time, streaming, project keyword searching, and AWS services (S3, ECS, CloudWatch Logs, Bedrock).