fgaule/python-mcp-server-template
If you are the rightful owner of python-mcp-server-template and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Python template for a Microservice Control Plane (MCP) server, featuring a health check controller and OpenAPI support.
python-mcp-server-template
A Python template for a Microservice Control Plane (MCP) server, featuring a health check controller and OpenAPI support.
Ready to run with Docker, locally, or as an MCP server for Claude Desktop.
Table of Contents
Features
- FastAPI-based Python server
- Health check endpoint
- OpenAPI (Swagger) documentation
- Docker and local development support
- Ready for integration with Claude Desktop via MCP
Prerequisites
- uv (for local runs)
- Docker (for containerized runs)
- Claude Desktop (optional, for MCP integration)
Quick Start
Run with Docker
docker-compose up --build
The API will be available at http://localhost:8000.
Validate the app is running:
curl -X GET http://localhost:8000/healthz
Expected response:
{"message":"API is up and running!!"}
Run Locally (with uv)
pip install uv
make init
make run
Or, directly:
uv run src/main.py
The API will be available at http://localhost:8000.
Validate the app is running:
curl -X GET http://localhost:8000/healthz
Expected response:
{"message":"API is up and running!!"}
Run as MCP Server for Claude Desktop
-
Open Claude Desktop configuration directory:
open ~/Library/Application\ Support/Claude
-
Go to Claude -> Settings -> Developer -> Edit Config
-
Create or edit
claude_desktop_config.json
:{ "mcpServers": { "python-mcp-server-template": { "command": "/absolute/path/to/uv", "args": [ "--directory", "/absolute/path/to/python-mcp-server-template", "run", "src/main.py" ] } } }
- Replace paths with your actual locations.
- Find your
uv
path withwhich uv
.
Example: Using npx with mcp-remote (localhost:8000)
If you want to connect Claude Desktop to a remote MCP server using npx
and mcp-remote
, you can use the following configuration in your claude_desktop_config.json
:
{
"mcpServers": {
"python-mcp-server-template": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://localhost:8000/mcp/"
]
}
}
}
- This will use
npx
to run themcp-remote
package and connect to the MCP server athttps://localhost:8000/mcp/
. - Make sure you have
npx
installed (it comes with Node.js). - You can add multiple servers under the
mcpServers
key for different environments or projects.
Makefile Commands
Command | Description |
---|---|
make init | Install dependencies |
make run | Run locally |
make run_local | Run in Docker |
make test | Run unit tests |
make coverage-test | Run coverage tests |
make integration-test | Run integration tests |
make tear_down_containers | Stop and remove Docker containers |
Contributing
Contributions are welcome!
Please see for guidelines.
License
or your preferred license.