MCP.so
ログイン

Python MCP Server Starter Template

@ltwlf

Python MCP Server Starter Template について

Opinionated starter kit for building Model-Context-Protocol (MCP) server in Python — clean project scaffold, typed code, VS Code debug config, Docker & GitHub Actions ready out-of-the-box

基本情報

カテゴリ

開発者ツール

ライセンス

MIT license

ランタイム

python

トランスポート

stdio

公開者

ltwlf

設定

以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。

{
  "mcpServers": {
    "python-mcp-starter": {
      "command": "uv",
      "args": [
        "venv"
      ]
    }
  }
}

ツール

ツールは検出されませんでした

ツールは README から自動的に抽出されます。メンテナーは ## Tools という見出しの下に記載することで、このタブに反映できます。

概要

What is Python MCP Server Starter Template?

It is a template repository for building Python applications using the Model Context Protocol (MCP) and the MCP Python SDK. It provides a clean, modular architecture for exposing MCP Tools and Resources, along with development tooling, debugging, and Docker support, targeting developers creating MCP servers.

How to use Python MCP Server Starter Template?

Clone the repository and rename the project package and scripts. Create a virtual environment with uv venv, activate it, then install dependencies with uv pip install -e ".[dev]". Run the server in stdio mode using uv run your-script-name or mcp dev ./your_package_name/server.py, or in SSE mode with uv run your-script-name --sse. Optionally, deploy with Docker via docker-compose up -d.

Key features of Python MCP Server Starter Template

  • Implements MCP server using FastMCP from the Python SDK.
  • Exposes MCP Tools and Resources for LLM interaction.
  • Command-line interface with customizable options (stdio/SSE).
  • Built-in debug capabilities with debugpy and VS Code integration.
  • Development environment managed with uv.
  • Docker support for containerized deployment.

Use cases of Python MCP Server Starter Template

  • Quickly scaffold a new MCP server for AI assistants.
  • Prototype MCP Tools and Resources for LLM-powered applications.
  • Provide a starting point for production-grade MCP integrations.
  • Establish a consistent development workflow with debugging and testing.

FAQ from Python MCP Server Starter Template

What are the prerequisites to use this template?

Python 3.10 or higher and uv (for environment/package management) are required. The MCP Inspector is recommended for testing, and Git and Docker are optional.

How do I run the server in SSE mode versus stdio mode?

In stdio mode, run uv run your-script-name (or use the mcp dev CLI). For SSE mode, add the --sse flag, optionally setting custom host and port with --host and --port.

How can I debug the MCP server?

Use the uv run mcp-debug command, then attach the VS Code debugger with the "Attach to MCP worker" configuration. The template includes debugpy integration. Never enable debug mode in production.

How do I add new tools or resources?

Add tools using the @mcp.tool() decorator and resources using the @mcp.resource() decorator inside your renamed package’s server.py file. The template provides example implementations.

How do I deploy the server with Docker?

Update the Dockerfile and docker-compose.yml with your renamed project/package, then run docker-compose up -d or build and run directly with docker build and docker run.

コメント

「開発者ツール」の他のコンテンツ