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: MCP TypeScript SDK
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 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