yilmazali325

getmcpauth

Community yilmazali325
Updated

OAuth 2.1 + Dynamic Client Registration token verification for Python MCP servers, backed by mcpauth (https://getmcpauth.dev)

getmcpauth

PyPI versionlicense

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

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

MCP Server · Populars

MCP Server · New

    cauldr0nx

    EspoCRM MCP Server

    Opensource MCP Server for EspoCRM

    Community cauldr0nx
    cisco-open

    Network Sketcher

    Network Sketcher is an AI-ready network design tool with Local MCP, Online, and Offline editions for creating network designs and exporting PowerPoint diagrams and Excel-based configuration data.

    Community cisco-open
    IvanMurzak

    ✨ AI Game Developer — Godot MCP

    Godot-MCP — Model Context Protocol (MCP) integration for the Godot Engine. AI tools for the Godot Editor in C#, with cloud connection to ai-game.dev. Apache-2.0.

    Community IvanMurzak
    cyberlife-coder

    velesdb

    The local-first memory engine for AI agents. One offline Rust binary fuses vector + graph + columnar under SQL — remember / recall / why over the Model Context Protocol. why() reconnects a decision to its context across sessions, where pure vector recall (Mem0/Zep) goes blind. Runs on server, laptop, browser, edge. Zero cloud.

    Community cyberlife-coder
    abskrj

    velane

    Velane is integration infrastructure agents actually control — 800+ OAuth integrations, sandboxed Bun and Python execution, and a full deployment pipeline managed via MCP

    Community abskrj