python
๐ Plug-and-play auth for Python MCP servers.
claude mcp add --transport stdio mcp-auth-python python -m mcpauth
How to use
The MCP Auth Python SDK provides an integration layer for authenticating users via OAuth 2.1 within the MCP framework. It offers tooling to connect to a supported identity provider, obtain access tokens, and manage token lifecycles in your MCP-based applications. This server/package acts as a library that you can import and configure in your Python applications to enable MCP-compliant authentication flows, provider compatibility checks, and straightforward token handling in your service.
To use the capabilities, install the mcpauth package in your project and initialize the client with your provider details. You can then initiate authorization requests, exchange authorization codes for access tokens, and validate tokens as part of your MCP workflow. The SDK is designed to work with MCPโs guidance on OAuth 2.1 and related RFCs, ensuring a standards-aligned integration with trusted providers. Documentation alongside the package will guide you through provider configuration, redirect handling, and token validation steps.
How to install
Prerequisites:
- Python 3.8+ (or as required by mcpauth)
- Optional: virtual environment management (venv, poetry, etc.)
- Internet access to install packages from PyPI
Install the package:
pip install mcpauth
Alternative installation methods (recommended for project isolation):
# With poetry
poetry add mcpauth
Configure your environment and initialize the client in your application as shown in the documentation. For local development, you can start by importing the library and creating a simple client using your provider configuration as per the docs.
Additional notes
Tips and common considerations:
- Ensure youโre using a Python version compatible with mcpauth and the OAuth 2.1 requirements.
- Review provider compatibility via the MCP-compatible providers list to confirm that your chosen provider is supported.
- Keep your client credentials secure and do not hard-code secrets in source files; consider using environment variables or a secrets manager.
- If youโre deploying, follow best practices for securing redirect URIs and token storage in your MCP environment.
- Check the projectโs documentation for any provider-specific nuances, scopes, and granted permissions required by your MCP integration.
Related MCP Servers
fastapi_mcp
Expose your FastAPI endpoints as Model Context Protocol (MCP) tools, with Auth!
web-eval-agent
An MCP server that autonomously evaluates web applications.
web-agent-protocol
๐Web Agent Protocol (WAP) - Record and replay user interactions in the browser with MCP support
fhir
FHIR MCP Server โ helping you expose any FHIR Server or API as a MCP Server.
unitree-go2
The Unitree Go2 MCP Server is a server built on the MCP that enables users to control the Unitree Go2 robot using natural language commands interpreted by a LLM.
js
๐ Plug-and-play auth for Node.js MCP servers.