Authplane Python SDK MCP server
Commit 26 Okt 2026Melindungi MCP dan OAuth 2.1 resource server menggunakan validasi JWT dan adapter framework khusus untuk Python.
Juga dikenal sebagai AuthPlane/python-sdk
- Stars
- 11
- Tools
- —
- Unduhan, 30 hari
- —
- Versi terbaru
- —
- Commit terakhir
- 26 Okt 2026
- Lisensi
- Apache-2.0
Apa itu Authplane Python SDK MCP?
Authplane Python SDK adalah MCP server. Melindungi MCP dan OAuth 2.1 resource server menggunakan validasi JWT dan adapter framework khusus untuk Python.
Ringkasan dibuat dari README proyek
Tentang Authplane Python SDK MCP server
Fungsi utama dari Python SDK ini adalah mengamankan Model Context Protocol resource server menggunakan OAuth 2.1 dan validasi JWT. SDK ini menyediakan adapter khusus untuk official MCP Python SDK maupun FastMCP, sehingga memungkinkan developer melakukan integrasi autentikasi dengan cepat ke dalam arsitektur server yang sudah ada. Dengan menggunakan fungsi seperti authplane_auth atau authplane_mcp_auth, Anda dapat mengotomatiskan discovery metadata, mengambil JWKS, dan memvalidasi access token dalam satu langkah.
Toolkit ini dirancang untuk lingkungan Python 3.11+ dan berfokus pada standar keamanan yang ketat. SDK ini mewajibkan penggunaan algoritma asimetris seperti RS256 dan ES256 serta menerapkan pertahanan terhadap serangan algorithm confusion dan SSRF. SDK ini mengelola tugas-tugas kompleks seperti penyegaran JWKS di background, verifikasi DPoP proof, dan token introspection secara otomatis. Hal ini memastikan resource server tetap patuh pada standar RFC seperti RFC 9068 dan RFC 9449 tanpa perlu mengimplementasikan setiap lapisan keamanan secara manual.
Apa yang bisa Anda lakukan dengannya
- 1Mengamankan akses tool FastMCPDeveloper dapat membatasi tool tertentu hanya untuk pengguna dengan OAuth scope yang sesuai menggunakan decorator require_scopes.
- 2Discovery metadata OAuth otomatisSDK ini dapat mengonfigurasi server secara otomatis dengan menemukan metadata authorization server dan mengambil key yang diperlukan.
- 3Penguatan outbound requestDeveloper dapat melindungi server mereka dari serangan SSRF melalui fitur built-in DNS pinning dan IP blocking saat melakukan fetch metadata.
- 4Implementasi sender-constrained tokensLibrary ini mendukung DPoP untuk memastikan bahwa access token terikat pada client tertentu guna mencegah serangan replay.
Ditulis berdasarkan README proyek. Setiap use case diperiksa terhadap kutipan dari README tersebut.
Pengecekan otomatis
Berjalan 14 Nov 2026Laporan lengkap →Belum diverifikasi. Sebuah server memerlukan skor 80, tidak ada temuan serius, dan data yang cukup untuk kami periksa. Cara kerja checks · Yang perlu diperbaiki untuk menambah poin
- Source repository terhubung dan dapat dijangkauauthplane/python-sdk is public and reachablegithub.com/authplane/python-sdk ↗Lolos
- Nama paket mencantumkan repositori ini sebagai sumbernyaTidak diperiksa
- Provenance build (atestasi Sigstore)Tidak diperiksa
- Lisensi open source (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗Lolos
- Ada commit atau release dalam satu tahun terakhirLast commit or release 2026-10-26github.com/authplane/python-sdk ↗Lolos
- OpenSSF ScorecardTidak diperiksa
- Nama package tidak mirip dengan package populerTidak diperiksa
- Tidak ada advisory kritis pada paket atau dependensinyaTidak diperiksa
- Tidak ada instruksi tersembunyi untuk model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersLolos
- Tools yang bersifat destruktif telah diberi labelTidak diperiksa
- Endpoint remote merespons handshake MCPTidak diperiksa
README
Lihat di GitHubAuthplane Python SDK
OAuth 2.1 JWT validation and token operations for Python resource servers, with first-class adapters for Model Context Protocol (MCP) servers.
Why Authplane
- One call wires up everything.
authplane_auth()(FastMCP) orauthplane_mcp_auth()(MCP) does RFC 8414 metadata discovery, fetches the JWKS, validates RFC 9068 access tokens, and serves RFC 9728 Protected Resource Metadata — unpacked straight into your MCP server. - Secure defaults. Asymmetric algorithms only, strict claim validation, SSRF-hardened fetches, background JWKS refresh, and a circuit breaker around the AS — out of the box.
- Standards-aligned. OAuth 2.1, DPoP (RFC 9449), Token Exchange (RFC 8693), Token Introspection (RFC 7662), Token Revocation (RFC 7009), Resource Indicators (RFC 8707).
Quickstart — FastMCP server with auth
import asyncio
from authplane_fastmcp import authplane_auth
from fastmcp import FastMCP
from fastmcp.server.auth import require_scopes
async def main() -> None:
result = await authplane_auth(
issuer="https://auth.company.com",
base_url="https://mcp.company.com",
scopes=["tools/query"],
)
mcp = FastMCP("My Server", **result)
@mcp.tool(auth=require_scopes("tools/query"))
def query(sql: str) -> str:
return f"Ran: {sql}" # replace with your real handler
try:
await mcp.run_async(transport="http", port=8080)
finally:
await result.aclose()
asyncio.run(main())
That's a complete, secure, standards-compliant MCP resource server. Swap authplane-fastmcp for authplane-mcp to use the official MCP Python SDK instead — see each adapter's README for the equivalent snippet.
Packages
| Package | Install | Purpose |
|---|---|---|
authplane-sdk |
pip install authplane-sdk |
Framework-agnostic JWT validation, AS metadata discovery, and token operations |
authplane-mcp |
pip install authplane-mcp |
Adapter for the official MCP Python SDK |
authplane-fastmcp |
pip install authplane-fastmcp |
Adapter for FastMCP |
Adapter packages depend on authplane-sdk, so installing one adapter brings the core SDK along. Adapter packages export only the adapter-specific glue (authplane_auth, AuthplaneAuthResult, AuthplaneTokenVerifier, etc.); core types (ASCredentials, FetchSettings, IntrospectionRevocation, errors) come from authplane, and TokenExchangeOptions / TokenResponse from authplane.oauth.
Requires Python 3.11+.
Compatibility
Tested against authserver 0.2.0. Introspection-based revocation (IntrospectionRevocation) requires authserver ≥ 0.1.2 and a confidential resource-server client that is either the issuing client or a runtime-client of the Resource — see the user guide.
Capabilities
Standards and RFCs
- OAuth 2.1 (draft-ietf-oauth-v2-1)
- RFC 8414 — Authorization Server Metadata discovery
- RFC 9068 — JWT Profile for OAuth 2.0 Access Tokens
- RFC 7662 — Token Introspection
- RFC 7009 — Token Revocation
- RFC 8693 — Token Exchange
- RFC 8707 — Resource Indicators
- RFC 9449 — DPoP (sender-constrained access tokens)
- RFC 9728 — OAuth 2.0 Protected Resource Metadata
- RFC 6750 — Bearer Token Usage
- RFC 7234 — HTTP caching semantics on discovery responses
- RFC 7519 / 7517 — JWT and JWKS
Security
- JWT signature, issuer, audience,
exp/nbf/iat, andtyp(at+jwt) validation; required claims enforced (sub,client_id,exp,iat,jti) - Algorithm-confusion defenses: only
RS256andES256(asymmetric) are accepted;none,HS256,HS384,HS512are always rejected at construction - AS metadata hardening: discovered
issuermust match configured issuer exactly; required endpoints must be present - SSRF hardening on outbound HTTP: DNS pinning, private/loopback/link-local/cloud-metadata IP blocking, HTTPS-only, response size limits, no redirects
- HTTPS-only by default with a
dev_modetoggle forlocalhostand private networks - JWKS resilience: stale-cache fallback, background refresh at 80% TTL, force-refresh on
kidmiss, coordinated fetches - Inbound DPoP proof verification: binding, replay,
htm/htu/athchecks - Outbound DPoP proof generation with nonce retry and pluggable nonce storage
- Circuit breaker around authorization-server calls
- Token caching with TTL buffers
Framework integrations
- Official MCP Python SDK →
authplane-mcp - FastMCP →
authplane-fastmcp
Observability
- Structured logging (
loggingmodule) across JWKS refresh, metadata discovery, circuit breaker transitions, token verification, and DPoP binding outcomes - Strict Pyright typing and immutable validated claims
Documentation
- Core SDK:
authplane/README.md· User Guide - MCP adapter:
authplane-mcp/README.md· User Guide - FastMCP adapter:
authplane-fastmcp/README.md· User Guide - Release history:
CHANGELOG.md - Security policy:
SECURITY.md - Contributing:
CONTRIBUTING.md - Release policy:
RELEASE_POLICY.md
License
Apache-2.0 — see LICENSE.
Pertanyaan tentang Authplane Python SDK MCP
Algoritma keamanan apa saja yang didukung untuk validasi JWT?
SDK ini hanya menerima algoritma asimetris, khususnya RS256 dan ES256, untuk mencegah serangan algorithm-confusion.
Apakah SDK ini mendukung DPoP?
Ya, SDK ini mendukung verifikasi inbound DPoP proof maupun pembuatan outbound DPoP proof.
Berapa versi Python minimum yang dibutuhkan?
Anda harus menggunakan Python 3.11 atau versi yang lebih tinggi.