Python MCP Server Kit
Python MCP Server Kit
バックエンド専用の、セキュアで型付けされ、テスト可能なModel Context Protocolサーバー向けスターターです。公式Python SDK v2を介してMCP 2026-07-28 プロトコルを対象とし、デプロイにはステートレスなStreamable HTTPを使用します。
機能
構造化されたPydantic出力を持つ型付きツール
汎用計算機と決定論的カタログの例
MCPツール、リソース、プロンプト
ベアラートークンの境界とツール単位のスコープ
リクエストサイズ、ホスト、インプロセスのレート制限
相関IDと構造化リクエストログ
公開のヘルスプローブとレディネスプローブ
ユニットテストとHTTP統合テスト
本番向け非root Dockerイメージ
lint、フォーマット、型チェック、テスト、イメージビルド、シークレット、ワークフロー向けCI
Related MCP server: MCP TypeScript SDK
アーキテクチャ
HTTP request
-> SecurityMiddleware (host, size, auth, rate limit, request ID)
-> MCP Streamable HTTP transport
-> typed tool/resource/prompt
-> scope check
-> deterministic domain functionプロトコル登録は src/mcp_server_kit/server.py にあります。再利用可能なドメインロジックは別モジュールに置かれます。TokenStore は意図的に置き換え可能なデプロイ境界であり、完全な認可サーバーではありません。
クイックスタート
Python 3.11+ が必要です。
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -e ".[dev]"
Copy-Item .env.example .env
.\scripts\dev.ps1MCPエンドポイントは http://127.0.0.1:8000/mcp です。ヘルスプローブは /health と /ready で利用できます。ローカル専用のデモトークンは次のとおりです:
demo-reader—catalog:readdemo-operator—catalog:read,calculator:use
MCP Inspector を npx -y @modelcontextprotocol/inspector で実行し、Authorization: Bearer demo-operator ヘッダーを設定してください。資格情報を必要としないクライアント定義は examples/client.json にあります。ローカルでは MCP_CLIENT_TOKEN を注入してください。
コマンド
.\scripts\dev.ps1 # development server with reload
.\scripts\check.ps1 # lint, format check, mypy, and tests
docker compose up --build設定
変数 | デフォルト | 目的 |
|
| 本番環境で安全でないデモ認証を拒否します |
|
| バインドアドレス |
|
|
|
| 空 |
|
| ローカルホスト | 完全一致で受け入れるHTTPホスト名 |
|
| 宣言されたリクエストボディの最大サイズ |
|
| サブジェクト/ウィンドウごとに許可されるリクエスト数 |
|
| レート制限ウィンドウ |
|
| Uvicornのログレベル |
.env をコミットしないでください。インターネットに公開するデプロイの前に セキュリティとデプロイ を参照し、レジストリを拡張するときは ツールの追加 を参照してください。
デプロイに関する注意
MCP_ENVIRONMENT=production、MCP_AUTH_MODE=bearer、シークレット管理されたMCP_BEARER_TOKENS値、および正確な公開ホスト許可リストを設定してください。信頼できるリバースプロキシでTLSを終端してください。ユーザー委任またはトークンのライフサイクル管理が必要な場合は、スターターのトークンストアをご自身のOAuth 2.1リソースサーバーベリファイアに置き換えてください。
ライセンス
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