python-base
A cookiecutter template for quickly bootstrapping a Python-based MCP server.
claude mcp add --transport stdio tjmaynes-python-base-mcp-server python -m server
How to use
This repository provides a Python-based MCP server template (cookiecutter) that helps you bootstrap an MCP-compatible service. After generating a project from this template, you will have a runnable Python MCP server skeleton that you can customize with your own MCP handlers, routes, and configuration. The typical workflow is to generate the project with cookiecutter, install any Python dependencies, and then run the server to start handling MCP traffic. The template is designed to integrate with the MCP protocol and can be extended with command handlers, event hooks, and logging to suit your needs. The included structure usually supports configuring hosts, ports, and logging via environment variables or a config file, enabling you to tailor the deployment to your environment.
How to install
Prerequisites:
- Python (3.8+ recommended)
- Cookiecutter (or use pipx for a streamlined workflow)
Installation via pipx (recommended):
pip install pipx
pipx run cookiecutter gh:tjmaynes/python-base-mcp-server
Alternative: install cookiecutter locally and generate the project
python -m pip install --user cookiecutter
cookiecutter gh:tjmaynes/python-base-mcp-server
After generation, navigate into the new project directory, create a virtual environment if desired, install dependencies, and run the server. The exact module/entrypoint may vary depending on the generated project name and structure, but a common pattern is to start the server with:
python -m server
Practical tips:
- Use a virtual environment to isolate dependencies.
- Review the generated README and config files for project-specific instructions.
- Set environment variables for host, port, and log level as needed.
Additional notes
Notes and tips:
- This MCP server is a Python-based cookiecutter template; the actual server entry point may vary depending on the generated project name. Update the mcp_config command/args if your entry point differs.
- Common environment variables to consider: MCP_HOST, MCP_PORT, LOG_LEVEL, CONFIG_PATH.
- If you intend to run in containers, ensure the exposed ports match your MCP client configuration and that any required network permissions are granted.
- Enable verbose logging during initial development to simplify debugging of MCP message handling.
- If you encounter issues with cookiecutter, verify your Python and pipx installations are accessible in your shell path, and consider using a Python virtual environment for isolation.
Related MCP Servers
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
mcp-yfinance
Real-time stock API with Python, MCP server example, yfinance stock analysis dashboard
cloudwatch-logs
MCP server from serkanh/cloudwatch-logs-mcp
servicenow-api
ServiceNow MCP Server and API Wrapper
the -company
TheMCPCompany: Creating General-purpose Agents with Task-specific Tools
mcp-yahoo-finance
MCP server for Yahoo Finance