Authplane JWT validation adapter for FastMCP
Project description
authplane-fastmcp
Authplane JWT validation for servers built on FastMCP.
Install
pip install authplane-fastmcp
Quickstart
import asyncio
from authplane_fastmcp import authplane_auth
from fastmcp import FastMCP
from fastmcp.server.auth import AccessToken, require_scopes
from fastmcp.dependencies import CurrentAccessToken
async def main():
mcp = FastMCP(
"My MCP Server",
**await authplane_auth(
issuer="https://auth.company.com",
base_url="https://mcp.company.com",
scopes=["tools/query", "tools/write"],
),
)
@mcp.tool(auth=require_scopes("tools/query"))
async def query_database(
query: str, token: AccessToken = CurrentAccessToken()
) -> str:
user_id = token.claims.get("sub")
return f"Query: {query}, User: {user_id}"
await mcp.run_async(transport="http", host="0.0.0.0", port=8080)
asyncio.run(main())
authplane_auth() holds background JWKS and metadata refresh tasks; call aclose() on the returned client during server shutdown.
Documentation
PRM behavior, dev mode, revocation checking, manual setup, scope enforcement semantics, claim access, the full authplane_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_fastmcp-0.1.0.tar.gz.
File metadata
- Download URL: authplane_fastmcp-0.1.0.tar.gz
- Upload date:
- Size: 21.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b507c5ac29a7d546f3d58d6b7b1f2489f98938e842c7fd0015b187dcfb860b2
|
|
| MD5 |
e52096d94953533f136931cfe84b890a
|
|
| BLAKE2b-256 |
6788011b2f585240ad8a4164067bf7d635f77317371e0850cb07be8946001bd5
|
Provenance
The following attestation bundles were made for authplane_fastmcp-0.1.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_fastmcp-0.1.0.tar.gz -
Subject digest:
1b507c5ac29a7d546f3d58d6b7b1f2489f98938e842c7fd0015b187dcfb860b2 - Sigstore transparency entry: 1508441958
- Sigstore integration time:
-
Permalink:
AuthPlane/python-sdk@34f030a20d315643b549d1f65868da333c20ecdc -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/AuthPlane
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@34f030a20d315643b549d1f65868da333c20ecdc -
Trigger Event:
push
-
Statement type:
File details
Details for the file authplane_fastmcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: authplane_fastmcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.2 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 |
4f047c4d6d397138a6938770d0c5c506143cf36964f4035129199395f0faa978
|
|
| MD5 |
f599e4744ba36e660c046822c23692c3
|
|
| BLAKE2b-256 |
780fb40cb2366ddfc55366c470d545413d6437a3bced909f0cabd772d093b22b
|
Provenance
The following attestation bundles were made for authplane_fastmcp-0.1.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_fastmcp-0.1.0-py3-none-any.whl -
Subject digest:
4f047c4d6d397138a6938770d0c5c506143cf36964f4035129199395f0faa978 - Sigstore transparency entry: 1508442003
- Sigstore integration time:
-
Permalink:
AuthPlane/python-sdk@34f030a20d315643b549d1f65868da333c20ecdc -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/AuthPlane
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@34f030a20d315643b549d1f65868da333c20ecdc -
Trigger Event:
push
-
Statement type: