Skip to main content
Glama
yilmazali325

getmcpauth

by yilmazali325

getmcpauth

PyPI version license

Drop-in OAuth 2.1 + Dynamic Client Registration (RFC 7591) token verification for Python MCP servers, backed by mcpauth.

Implements the official mcp SDK's TokenVerifier protocol — the official SDK ships a full bearer-auth middleware stack (BearerAuthBackend, RequireAuthMiddleware) but no ready-made verifier that actually checks a token against a real authorization server. This package is that verifier.

Install

pip install getmcpauth

Related MCP server: MCP Server OAuth Toy

Usage

import os
from mcp.server.fastmcp import FastMCP
from getmcpauth import McpAuthTokenVerifier, build_auth_settings

mcp = FastMCP(
    "my-server",
    token_verifier=McpAuthTokenVerifier(
        "https://getmcpauth.dev/api/oauth/introspect",
        registration_secret=os.environ["MCPAUTH_SECRET"],
    ),
    auth=build_auth_settings(
        "https://getmcpauth.dev",
        resource_server_url="https://my-server.example.com",
    ),
)

Get a registration_secret by creating a project at getmcpauth.dev/dashboard.

API

  • McpAuthTokenVerifier — implements mcp.server.auth.provider.TokenVerifier. Successful verifications are cached in-process (default 30s) so a chatty agent conversation doesn't trigger a network round trip on every tool call.

  • build_auth_settings(issuer_url, *, resource_server_url, required_scopes=None) — builds an AuthSettings for FastMCP with Dynamic Client Registration enabled.

  • required_scope_for_call(body) / is_authorized(required_scope, granted_scopes) / check_batch(bodies, granted_scopes) — helpers for MCP-native tool scoping (tool:<name> scope strings mapped directly to tools/call requests).

Full docs: getmcpauth.dev/docs

Development

pip install -e ".[test]"
pytest

License

MIT

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    -
    quality
    D
    maintenance
    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.
  • A
    license
    -
    quality
    D
    maintenance
    Drop-in OAuth 2.1 + Dynamic Client Registration for MCP servers, providing authentication middleware and token verification.
    20
    MIT

View all related MCP servers

Related MCP Connectors

  • Self-hosted federated MCP gateway: one OAuth 2.1 MCP server in front of N apps, user-level scopes.

  • MCP server for verifying EUDI/Talao wallet data via OIDC4VP (pull) for AI agents.

  • MCP server for Argo RPG Platform — connects AI assistants to campaign data via OAuth2

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yilmazali325/getmcpauth-python'

If you have feedback or need assistance with the MCP directory API, please join our Discord server