Python MCP Server Kit
Python MCP Server Kit
Ein reines Backend-Starterset für sichere, typisierte und testbare Model-Context-Protocol-Server. Es zielt auf das MCP-Protokoll 2026-07-28 über das offizielle Python-SDK v2 ab und verwendet zustandsloses Streamable HTTP für die Bereitstellung.
Funktionen
Typisierte Tools mit strukturierter Pydantic-Ausgabe
Generische Rechner- und deterministische Katalogbeispiele
MCP-Tools, -Ressourcen und -Prompts
Bearer-Token-Grenze und Pro-Tool-Scopes
Anfragegrößen-, Host- und In-Process-Ratenlimits
Korrelations-IDs und strukturierte Anfrage-Logs
Öffentliche Health- und Readiness-Probes
Produktionsnahes Docker-Image ohne Root-Rechte
CI für Linting, Formatierung, Typprüfung, Tests, Image-Build, Secrets und Workflows
Related MCP server: MCP TypeScript SDK
Architektur
HTTP request
-> SecurityMiddleware (host, size, auth, rate limit, request ID)
-> MCP Streamable HTTP transport
-> typed tool/resource/prompt
-> scope check
-> deterministic domain functionDie Protokollregistrierung befindet sich in src/mcp_server_kit/server.py; wiederverwendbare Domänenlogik bleibt in separaten Modulen. TokenStore ist bewusst eine austauschbare Bereitstellungsgrenze und kein vollständiger Autorisierungsserver.
Schnellstart
Python 3.11+ ist erforderlich.
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -e ".[dev]"
Copy-Item .env.example .env
.\scripts\dev.ps1Der MCP-Endpunkt ist http://127.0.0.1:8000/mcp. Health-Probes sind unter /health und /ready verfügbar. Die nur lokal verfügbaren Demo-Tokens sind:
demo-reader—catalog:readdemo-operator—catalog:read,calculator:use
Führen Sie den MCP Inspector mit npx -y @modelcontextprotocol/inspector aus und setzen Sie einen Authorization: Bearer demo-operator-Header. Eine anmeldefreie Client-Vorlage ist in examples/client.json verfügbar; injizieren Sie MCP_CLIENT_TOKEN lokal.
Befehle
.\scripts\dev.ps1 # development server with reload
.\scripts\check.ps1 # lint, format check, mypy, and tests
docker compose up --buildKonfiguration
Variable | Standard | Zweck |
|
| Lehnt unsichere Demo-Authentifizierung in Produktion ab |
|
| Bindeadresse |
|
|
|
| leer | Geheimer Wert |
| lokale Hosts | Exakt akzeptierte HTTP-Hostnamen |
|
| Maximal deklarierter Request-Body |
|
| Pro Subjekt/Fenster erlaubte Anfragen |
|
| Rate-Limit-Fenster |
|
| Uvicorn-Log-Level |
Committen Sie niemals .env. Siehe Sicherheit und Bereitstellung, bevor Sie eine internetzugängliche Bereitstellung durchführen, und Tools hinzufügen, wenn Sie die Registry erweitern.
Hinweise zur Bereitstellung
Setzen Sie MCP_ENVIRONMENT=production, MCP_AUTH_MODE=bearer, einen über Secrets verwalteten Wert für MCP_BEARER_TOKENS und die exakte öffentliche Host-Allowlist. Beenden Sie TLS an einem vertrauenswürdigen Reverse-Proxy. Ersetzen Sie den Starter-Token-Store durch Ihren OAuth-2.1-Resource-Server-Verifier, wenn Benutzerdelegierung oder Token-Lebenszyklusverwaltung erforderlich ist.
Lizenz
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA TypeScript implementation of a Model Context Protocol server that provides a frictionless framework for developers to build and deploy AI tools and prompts, focusing on developer experience with zero boilerplate and automatic tool registration.1,28414MIT
- AlicenseNot gradedqualityDmaintenanceA toolkit for building Model Context Protocol servers and clients that provide standardized context for LLMs, allowing applications to expose resources, tools, and prompts through stdio or Streamable HTTP transports.35,101,265MIT
- AlicenseNot gradedqualityDmaintenanceA reusable runtime infrastructure for hosting Model Context Protocol servers and tool registries over HTTP. It provides built-in validation, authentication, and logging to simplify the deployment of AI-powered workflows.MIT
- AlicenseNot gradedqualityDmaintenanceModel Context Protocol server that standardizes tool discovery, execution, and context management for AI applications.MIT
Related MCP Connectors
A Model Context Protocol server for Wix AI tools
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Boyeep/python-mcp-server-kit'
If you have feedback or need assistance with the MCP directory API, please join our Discord server