Authplane JWT validation adapter for the official MCP Python SDK
Project description
authplane-mcp
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, 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)
@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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file authplane_mcp-0.2.0.tar.gz.
File metadata
- Download URL: authplane_mcp-0.2.0.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01f356b82c53195c3c32fb19feab9e1073bc5257e914533b623e7cabf79f28ff
|
|
| MD5 |
ef95523be0d5cdeec7f3403663be11a7
|
|
| BLAKE2b-256 |
16d7b1531b023f46f0ff03ee9b12027f21b2fc80db1939a8abae5dccf05600a5
|
Provenance
The following attestation bundles were made for authplane_mcp-0.2.0.tar.gz:
Publisher:
publish-pypi.yml on AuthPlane/python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
authplane_mcp-0.2.0.tar.gz -
Subject digest:
01f356b82c53195c3c32fb19feab9e1073bc5257e914533b623e7cabf79f28ff - Sigstore transparency entry: 1583299067
- Sigstore integration time:
-
Permalink:
AuthPlane/python-sdk@26c28ed5eec94ac83f853a69ecca137f65d50a0e -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/AuthPlane
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@26c28ed5eec94ac83f853a69ecca137f65d50a0e -
Trigger Event:
push
-
Statement type:
File details
Details for the file authplane_mcp-0.2.0-py3-none-any.whl.
File metadata
- Download URL: authplane_mcp-0.2.0-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50504ba8d99447d279a5bea1901846243c99d3ee839edba63678849ee34485a7
|
|
| MD5 |
5c5a717e82bd6fd24192c6ff342f4398
|
|
| BLAKE2b-256 |
15bb7ed86a0f86cfd7b0cdc496fecd93dd69963be68747a7d68cf6b5362ae4ef
|
Provenance
The following attestation bundles were made for authplane_mcp-0.2.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on AuthPlane/python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
authplane_mcp-0.2.0-py3-none-any.whl -
Subject digest:
50504ba8d99447d279a5bea1901846243c99d3ee839edba63678849ee34485a7 - Sigstore transparency entry: 1583299179
- Sigstore integration time:
-
Permalink:
AuthPlane/python-sdk@26c28ed5eec94ac83f853a69ecca137f65d50a0e -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/AuthPlane
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@26c28ed5eec94ac83f853a69ecca137f65d50a0e -
Trigger Event:
push
-
Statement type: