OAuth MCP Server
A complete OAuth 2.1 server implementation for FastMCP with PKCE support.
⚠️ Security Warning
This is an advanced authentication pattern. Building a secure OAuth server requires deep expertise in authentication protocols, cryptography, and security best practices. The FastMCP documentation strongly recommends using Remote OAuth or OAuth Proxy instead unless you have compelling requirements.
See OAUTH_README.md for complete documentation.
Quick Start
Installation
Run the Server
The server will start on http://localhost:8000 with a demo OAuth client registered.
Test the OAuth Flow
In a separate terminal:
This will demonstrate the complete OAuth 2.1 flow including:
PKCE challenge/verifier generation
Authorization code exchange
Access token usage
Token refresh
Demo Credentials
OAuth Client:
Client ID:
demo_clientClient Secret:
demo_secret
Demo User:
Username:
demo_userPassword:
demo_password
Project Structure
Features
✅ Full OAuth 2.1 implementation
✅ PKCE (Proof Key for Code Exchange)
✅ Authorization code flow
✅ Token refresh with rotation
✅ Token revocation
✅ Scope validation
✅ State parameter for CSRF protection
Documentation
See OAUTH_README.md for:
Detailed architecture
Security considerations
Production deployment guide
Database schema
Testing strategies
Troubleshooting
References
License
Copyright Anysphere Inc.
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
A complete OAuth 2.1 server implementation for FastMCP with PKCE support, enabling secure authentication and authorization flows. Provides authorization code exchange, token management, and refresh capabilities for building authenticated MCP applications.