Skip to main content

Authplane JWT validation adapter for the official MCP Python SDK

Project description

authplane-mcp

PyPI License

Authplane JWT validation for servers built on the official MCP Python SDK.

Install

pip install authplane-mcp

Compatibility

Supported mcp range: >=1.23.0, <1.28.0. MCP 1.28 renamed the elicitation field from elicitationId (camelCase) to elicitation_id (snake_case), which breaks this adapter's current wire handling. If your project needs MCP 1.28+, please open an issue — the adapter update is straightforward, we just haven't cut it yet.

Quickstart

import asyncio
from authplane_mcp import authplane_mcp_auth
from mcp.server.fastmcp import FastMCP

auth_result = asyncio.run(
    authplane_mcp_auth(
        issuer="https://auth.company.com",
        resource="https://mcp.company.com",
        scopes=["tools/query", "tools/write"],
    )
)

mcp = FastMCP("My MCP Server", json_response=True, **auth_result)

@mcp.tool()
async def query_database(query: str) -> str:
    return f"Result for: {query}"

mcp.run(transport="streamable-http")

mcp.run() starts its own event loop, so the auth setup runs synchronously via asyncio.run(...) first. auth_result holds background JWKS and metadata refresh tasks — call await auth_result.aclose() during server shutdown.

Documentation

PRM behavior, dev mode, revocation checking, manual setup, the full authplane_mcp_auth / AuthplaneTokenVerifier API, and error handling: User Guide.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

authplane_mcp-0.1.0.tar.gz (21.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

authplane_mcp-0.1.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file authplane_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: authplane_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for authplane_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a943a16c04eb14262ef71d882a646357de9610a21b5a7c36315cd256608038ac
MD5 07323d0f3dcd065baa0b959ca31b1b3a
BLAKE2b-256 9a395a4358b34246c7e10138b011f765a9394fa70cd0539547ea37576fd1f0f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for authplane_mcp-0.1.0.tar.gz:

Publisher: publish-pypi.yml on AuthPlane/python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file authplane_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: authplane_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for authplane_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f5eae9806af78274b5595f49183ad426c5421b4029a7427a1b6b73f85bfc8053
MD5 517c7d2ca81c2871e71544ed622ec471
BLAKE2b-256 2c9a9523d3ef1412841acc836eaa12bd017b4425c7d7e57d745889f5475bba88

See more details on using hashes here.

Provenance

The following attestation bundles were made for authplane_mcp-0.1.0-py3-none-any.whl:

Publisher: publish-pypi.yml on AuthPlane/python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page