py -template
Fork this to create a working server in Python
claude mcp add --transport stdio nictuku-py-mcp-server-template uv run --python /ABSOLUTE/PATH/TO/PARENT/FOLDER/YOUR_REPOSITORY_NAME/.venv/bin/python /ABSOLUTE/PATH/TO/PARENT/FOLDER/YOUR_REPOSITORY_NAME/mcp_server.py
How to use
This MCP server template provides a Python-based MCP server built with uv for packaging and virtual environment management. The server is started via uv run, which executes mcp_server.py inside the project’s virtual environment. Once running, the server communicates over stdio in line with MCP protocol expectations, allowing clients such as Claude Desktop or Cursor to connect and issue MCP commands. You can customize the server behavior by editing mcp_server.py and related modules, and you can point your integration’s configuration to the absolute path of your repository to ensure the correct Python interpreter and server script are used.
How to install
Prerequisites:
- Python installed on your system
- uv Python packaging tool installed (see uv installation guide)
- A Git repository for the MCP server (forked from this template)
Setup steps:
- Clone your forked repository and navigate into it
git clone https://github.com/YOUR_USERNAME/YOUR_REPOSITORY_NAME.git
cd YOUR_REPOSITORY_NAME
- Ensure uv is installed and available in your PATH. If needed, install uv according to the official guide.
- Create and activate a Python virtual environment managed by uv
uv venv
# Activate the venv (example for macOS/Linux)
source .venv/bin/activate
# On Windows use: .venv\Scripts\activate
- Install project dependencies (the project is configured with pyproject.toml)
uv pip install .
- Run the MCP server directly to test
uv run python mcp_server.py
- To integrate with tools like Claude Desktop or Cursor, configure the MCP server in your tool using the template's example configuration, replacing absolute paths with your actual repository path and ensuring the virtual environment Python interpreter path is correct.
Additional notes
Tips and common considerations:
- Ensure the virtual environment path in your integration configuration points to your repository’s .venv (or the equivalent uv-managed environment).
- If uv is not found in your shell, you may need to specify the full path to the uv executable in the command field.
- The MCP server listens on stdio by default; verify that your client configuration expects stdio transport.
- When moving the repository, update the absolute paths in the integration configuration to reflect the new location.
- If you add new dependencies, run uv pip install . again to update the environment.
- Keep mcp_server.py and related modules under version control to track changes to MCP behaviors.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP