Back to Home
giantswarm icon

mcp-oauth

Verified Safe

by giantswarm

Overview

Provider-agnostic OAuth 2.1 Authorization Server library for Model Context Protocol (MCP) servers, enabling URL-based client identifiers with dynamic metadata discovery (CIMD).

Installation

Run Command
go run main.go

Environment Variables

  • GOOGLE_CLIENT_ID
  • GOOGLE_CLIENT_SECRET
  • OTLP_ENDPOINT
  • REGISTRATION_ACCESS_TOKEN
  • ENCRYPTION_KEY

Security Notes

The library demonstrates a high degree of security consciousness, implementing PKCE enforcement (S256 only), refresh token rotation, token encryption at rest (AES-256-GCM), comprehensive redirect URI validation with SSRF protection, per-domain rate limiting for CIMD fetches, and audit logging. It applies secure-by-default configurations and explicitly warns about insecure practices (e.g., using environment variables for secrets in production, enabling insecure HTTP, allowing plain PKCE). Strict validation is performed on URLs, scopes, and various inputs to prevent common attack vectors like XSS, SSRF, and injection. JWKS endpoints are also protected against SSRF. Overall, the architecture and code show a strong focus on security best practices.

Similar Servers

Stats

Interest Score34
Security Score9
Cost ClassLow
Stars3
Forks1
Last Update2026-01-18

Tags

OAuthAuthorization ServerMCPSecurityOpenTelemetryCIMD