authplane-mcp
Authplane JWT validation for servers built on the official MCP Python SDK.
Install
pip install authplane-mcp
Compatibility
Supported mcp range: >=1.28.1, <2.0.0. The floor is 1.28.1 because earlier releases (<=1.28.0) are affected by PYSEC-2026-3483, fixed in 1.28.1. The adapter targets the mcp 1.x server API (mcp.server.fastmcp.FastMCP) and the camelCase URL-elicitation field (ElicitRequestURLParams(elicitationId=...)), which are the shape of the current 1.x line. As a belt-and-braces measure the adapter does not hard-code that spelling: it resolves the elicitation-id field name from the model's own schema — a known spelling is checked at import, then resolved per call — so a rename within 1.x would be picked up automatically rather than breaking the consent path. mcp 2.0 is not yet supported: it removes mcp.server.fastmcp and renames the elicitation field to snake_case elicitation_id, which is a separate port. If your project needs mcp 2.0, please open an issue.
Quickstart
import asyncio
from authplane_mcp import authplane_mcp_auth, install_request_context, require_scope
from mcp.server.fastmcp import FastMCP
async def main() -> None:
auth_result = await authplane_mcp_auth(
issuer="https://auth.company.com",
resource="https://mcp.company.com",
scopes=["tools/query", "tools/write"],
)
mcp = FastMCP("My MCP Server", port=8080, json_response=True, **auth_result)
# Wires Authplane's per-app hooks onto the server: advertises the issuer /
# resource identifiers verbatim in the Protected Resource Metadata and
# installs the request-context middleware used by inbound DPoP enforcement.
install_request_context(mcp)
@mcp.tool()
async def query_database(query: str) -> str:
require_scope("tools/query")
return f"Result for: {query}"
try:
await mcp.run_streamable_http_async()
finally:
await auth_result.aclose()
asyncio.run(main())
auth_result holds background JWKS and metadata refresh tasks bound to the running event loop. Keep the setup, server, and aclose() inside a single asyncio.run(main()) so those tasks stay alive for the server's lifetime.
Documentation
PRM behavior, dev mode, revocation checking, manual setup, the full authplane_mcp_auth / AuthplaneTokenVerifier API, and error handling: User Guide.
Metadata
Release files for authplane-mcp 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| authplane_mcp-0.5.0.tar.gz | 27.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| authplane_mcp-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 57.6 kB
Release files / authplane_mcp-0.5.0.tar.gz
| Download URL | authplane_mcp-0.5.0.tar.gz |
|---|---|
| Size | 27.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5f1049bde2c8fc62cf7358536c144e7022a7205790ab9fa1347c4002456516aa
|
|
BLAKE2b-256 checksum How to use checksums |
586ceb245f82eab313cc59d1b9f1fe6e2d5cdc83c7ab5981c0b3d999ee5fbb8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.
Transparency logRelease files / authplane_mcp-0.5.0-py3-none-any.whl
| Download URL | authplane_mcp-0.5.0-py3-none-any.whl |
|---|---|
| Size | 30.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2a36182d3f34ef2240e68aa0d547d4dba7411b539c9f79c4a14d1566c9f0d767
|
|
BLAKE2b-256 checksum How to use checksums |
7d0a4fa8a3a62938c96a6bacf81f98e1ef74068fd56cf126f4b45cbec3629f51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.
Transparency log