FastMCP Python Boilerplate
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@FastMCP Python BoilerplateScaffold a new FastMCP server project with the boilerplate"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
FastMCP Python Boilerplate
Production-ready FastMCP Python boilerplate for building MCP servers that work with Claude, GPT, Cursor, and any MCP-compatible agent.
What's included
FastMCP server setup with proper tool schemas
Pydantic v2 config validation — reads from
.env, never hardcodes secretsToken-bucket rate limiter — thread-safe, per-client windows
structlog to stderr — structured logging that doesn't break MCP protocol framing
pytest suite, 36 tests — config, rate limiter, tools, and a subprocess-level check that stdout never carries anything but JSON-RPC
Docker packaging, CI, pre-commit, and the Claude Desktop config ship with the full package.
Related MCP server: MCP Server Template (Python)
The stdout/stderr gotcha
MCP uses stdout for JSON-RPC frames. Any print() that lands on stdout corrupts the protocol — the client sees malformed JSON and either drops the message or errors out. All logging goes to stderr.
This boilerplate has it wired by default:
import structlog, sys
structlog.configure(logger_factory=structlog.PrintLoggerFactory(file=sys.stderr))Quick start
git clone https://github.com/srmcguirt/fastmcp-python-boilerplate
cd fastmcp-python-boilerplate
cp .env.example .env
pip install -r requirements.txt
python server.pyStructure
fastmcp-python-boilerplate/
├── mcp_server/
│ ├── __main__.py # Entrypoint: python -m mcp_server
│ ├── server.py # FastMCP server + example tools
│ ├── config.py # Pydantic v2 settings (reads from .env)
│ ├── logger.py # structlog wired to stderr
│ └── rate_limiter.py # Thread-safe token bucket
├── tests/
│ ├── test_config.py
│ ├── test_rate_limiter.py
│ ├── test_server.py
│ └── test_logging_stdout_purity.py # proves stdout stays JSON-RPC only
├── .env.example
├── pyproject.toml
└── LICENSEEverything above is MIT licensed and runs as-is. pytest passes 36 tests,
including a suite that spawns a subprocess and asserts at the file-descriptor
level that no log output ever reaches stdout.
Get the Full Boilerplate
The free core above is a working server with the patterns wired up.
The full $35 package adds the deployment layer:
Multi-stage Dockerfile with health check, non-root user
Docker Compose with env file support
Three real tool implementations beyond the examples here
Per-tool rate limits with configurable burst
Request ID tracing through the structlog pipeline
Integration tests against a mocked MCP client
Pre-commit hooks (ruff, mypy)
GitHub Actions CI workflow
Claude Desktop + Claude Code config
Deployment guide with troubleshooting
-> Get FastMCP Python Boilerplate — $35
Related tools
MCP Server Starter Kit — TypeScript MCP server with Zod + Docker ($49)
MCP Vertical Server Bundle — GitHub, Slack, Notion MCP servers ($99)
Multi-Agent Orchestration Kit — pipeline + fan-out patterns ($79)
Claude Agent Boilerplate — tool-use loop core ($29)
Full lineup: srmcguirt.dev
License
MIT — use it in production, keep it if you never buy anything.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceProduction-ready API server template integrating FastAPI with Model Context Protocol (MCP) for LLM integration, structured logging, and comprehensive testing.2
- Alicense-qualityDmaintenanceA minimal, well-structured starter template for building Model Context Protocol (MCP) servers using Python and the FastMCP framework. It includes boilerplate for tools, testing setup, and modern Python packaging to accelerate server development.MIT
- AlicenseAqualityCmaintenanceA production-ready foundation for building secure, observable MCP servers with built-in authentication, rate limiting, and reference tools like database-query and semantic-search.1568MIT
- Flicense-qualityCmaintenanceA FastAPI + FastMCP integrated template for quickly building MCP servers that expose custom business logic as AI-accessible tools.
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
An MCP server for Arcjet - the runtime security platform that ships with your AI code.
Primarily to be used as a template repository for developing MCP servers with FastMCP in Python, P…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/srmcguirt/fastmcp-python-boilerplate'
If you have feedback or need assistance with the MCP directory API, please join our Discord server