Python MCP Server Kit
Python MCP Server Kit
A backend-only starter for secure, typed, and testable Model Context Protocol
servers. It targets the MCP 2026-07-28 protocol through the official Python
SDK v2 and uses stateless Streamable HTTP for deployment.
Features
Typed tools with structured Pydantic output
Generic calculator and deterministic catalog examples
MCP tools, resources, and prompts
Bearer-token boundary and per-tool scopes
Request-size, host, and in-process rate limits
Correlation IDs and structured request logs
Public health and readiness probes
Unit and HTTP integration tests
Production-style non-root Docker image
CI for lint, formatting, typing, tests, image build, secrets, and workflows
Related MCP server: EasyMCP
Architecture
HTTP request
-> SecurityMiddleware (host, size, auth, rate limit, request ID)
-> MCP Streamable HTTP transport
-> typed tool/resource/prompt
-> scope check
-> deterministic domain functionProtocol registration lives in src/mcp_server_kit/server.py; reusable domain
logic stays in separate modules. TokenStore is intentionally a replaceable
deployment boundary, not a full authorization server.
Quick start
Python 3.11+ is required.
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -e ".[dev]"
Copy-Item .env.example .env
.\scripts\dev.ps1The MCP endpoint is http://127.0.0.1:8000/mcp. Health probes are available at
/health and /ready. The local-only demo tokens are:
demo-reader—catalog:readdemo-operator—catalog:read,calculator:use
Run MCP Inspector with npx -y @modelcontextprotocol/inspector and set an
Authorization: Bearer demo-operator header. A credential-free client shape
is available in examples/client.json; inject MCP_CLIENT_TOKEN locally.
Commands
.\scripts\dev.ps1 # development server with reload
.\scripts\check.ps1 # lint, format check, mypy, and tests
docker compose up --buildConfiguration
Variable | Default | Purpose |
|
| Rejects unsafe demo auth in production |
|
| Bind address |
|
|
|
| empty |
|
| local hosts | Exact accepted HTTP hostnames |
|
| Maximum declared request body |
|
| Requests allowed per subject/window |
|
| Rate-limit window |
|
| Uvicorn log level |
Never commit .env. See security and deployment before an
internet-facing deployment and adding tools when
extending the registry.
Deployment notes
Set MCP_ENVIRONMENT=production, MCP_AUTH_MODE=bearer, a secret-managed
MCP_BEARER_TOKENS value, and the exact public host allowlist. Terminate TLS at
a trusted reverse proxy. Replace the starter token store with your OAuth 2.1
resource-server verifier when user delegation or token lifecycle management is
required.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
A Model Context Protocol server for Wix AI tools
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables developers to create and serve Model Context Protocol servers in TypeScript by declaratively defining tools, resources, resource templates, prompts, and roots with minimal boilerplate. It provides an Express-like API or experimental decorators, with optional context access for logging and progress reporting.5 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables developers to build Model Context Protocol servers in TypeScript with minimal boilerplate, declaring tools, prompts, resources, resource templates, and roots through either an Express-like API or an experimental decorators API that infers types and input schemas automatically. It also provides a context object for logging, progress reporting, and reading resources within tool handlers.5 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables developers to create Model Context Protocol servers in TypeScript with minimal boilerplate through an Express-like API or experimental decorators. It supports defining tools, prompts, resources, resource templates, and roots, with type safety and MCP capabilities like logging and progress reporting.5 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables developers to build Model Context Protocol servers in TypeScript with a simple Express-like API or experimental decorators for defining tools, prompts, resources, resource templates, and roots with minimal boilerplate.5 npmMIT