Python MCP Server Starter Template
A template repository for creating Python applications using the Model Context Protocol (MCP) and the MCP Python SDK.
Agenten stärken
Installation vom Herausgeber. Kein PlugMCP-Endpunkt.
Host a copy with our keys and logs.
Noch kein paketiertes Release in der Registry. Folgen Sie der README des Repositorys.
Remote-URL oder ein Befehl auf Ihrem Rechner? Worin sich die beiden Installationen unterscheiden
Auf PlugMCP ausführen
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
StartenVom Herausgeber
A template repository for creating Python applications using the Model Context Protocol (MCP) and the MCP Python SDK.
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
mcp Python SDK (FastMCP).uv for environment/package management)Clone or Use as Template: Get the code.
git clone https://github.com/ltwlf/python-mcp-starter.git your-repo-name # Or use GitHub's "Use this template" button
cd your-repo-name
Rename the Project: Rename the core components:
hello_mcp_server directory to your desired Python package name (e.g., my_awesome_mcp).hello-mcp-server (in pyproject.toml, README.md, Dockerfile, docker-compose.yml) with your project name (e.g., my-awesome-mcp).hello_mcp_server (in Python import statements like in main.py, tests/test_server.py, pyproject.toml scripts section) with your new package name.APP_ID in your renamed server.py file..vscode/launch.json configuration file to reflect your new project and package names.Create Virtual Environment:
# Create the virtual environment
uv venv
# Activate the environment (Windows PowerShell)
.venv\Scripts\Activate.ps1
# Or for other shells:
# source .venv/bin/activate (Linux/macOS)
# .venv\Scripts\activate.bat (Windows Command Prompt)
Install Dependencies:
uv pip install -e ".[dev]"
You can run the server directly using uv run or the mcp CLI tool provided by the SDK. This allows testing with tools like the MCP Inspector.
Method 1: Using uv run
# Ensure your virtual environment is active first
# Replace 'hello-mcp-server' with the script name defined in your pyproject.toml
uv run your-script-name
Method 2: Using the mcp CLI tool
# Ensure your virtual environment is active first
# Replace 'hello_mcp_server' with your renamed package directory
mcp dev ./your_package_name/server.py
# Ensure your virtual environment is active first
# Replace 'hello-mcp-server' with your script name
uv run your-script-name --sse
Or with custom host and port:
# Ensure your virtual environment is active first
# Replace 'hello-mcp-server' with your script name
uv run your-script-name --sse --host 127.0.0.1 --port 9000
Update the Dockerfile and docker-compose.yml to reflect your renamed project/package before building.
# Build and run with Docker Compose
docker-compose up -d
# Or build and run directly with Docker
# Replace 'hello-mcp-server' with your image name
docker build -t your-image-name .
docker run -p 8000:8000 your-image-name
This project includes built-in debugging capabilities using debugpy. There are two main ways to debug your MCP server:
The project includes a dedicated debug module that makes debugging easy:
# Using uv (recommended)
uv run mcp-debug
Connect to the MCP Inspector first, and once connected, use the VS Code debug configuration Attach to MCP worker to attach the debugger for debugging
VS Code debugging is configured with several launch configurations:
For the best experience:
uv run mcp-debug in a terminalNote: Make sure you have your virtual environment set up with
uv venvanduv pip install -e .[dev]before debugging.
To use these configurations:
Add new tools using the @mcp.tool() decorator in your_package_name/server.py:
# your_package_name/server.py
from mcp.server.fastmcp import FastMCP, Context
mcp = FastMCP("your-app-id") # Ensure APP_ID matches your project
# ... existing tools ...
# Add your new tool
@mcp.tool()
async def my_new_tool(param1: str, param2: int, ctx: Context) -> dict:
"""
Description of what your tool does.
Use the ctx object to report progress, log info, or read resources.
"""
ctx.info(f"Running my_new_tool with {param1=}, {param2=}")
# Tool implementation
result = f"Processed {param1} {param2} times"
await ctx.report_progress(1, 1) # Example progress
return {"result": result}
Add new resources using the @mcp.resource() decorator in your_package_name/server.py:
# your_package_name/server.py
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("your-app-id") # Ensure APP_ID matches your project
# ... existing resources ...
# Add resources
@mcp.resource("your-resource-uri")
def your_resource_func():
"""Returns application settings."""
return {"theme": "dark", "language": "en"}
Make sure the import statements in tests/test_server.py point to your renamed package.
pytest
This project is licensed under the MIT License - see the LICENSE file for details.
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
Tools
Noch keine Tool-Liste. Remote-Server erhalten eine nach dem ersten Health-Check.
FAQ
Kopieren Sie auf dieser Seite die stdio-Konfiguration für Cursor, Claude Desktop, Claude Code oder VS Code. Sie nutzt die Installation des Herausgebers, keinen PlugMCP-Proxy.
In diesem Eintrag ist keine erforderliche Umgebungsvariable aufgeführt.
Python MCP Starter läuft lokal über stdio.
Zuletzt geprüft: 2026-10-28. 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