mcp_boilerplate
🚀 Production-ready Python template for building Model Context Protocol (MCP) servers with FastMCP v2. Includes comprehensive tooling, multiple transport support (STDIO/SSE), example tools/resources/prompts, testing framework, and developer experience optimizations.
claude mcp add --transport stdio boffti-mcp_boilerplate uv run python -m mcp_boilerplate.main
How to use
This MCP server is a Python-based boilerplate built with FastMCP v2. It provides a ready-to-use scaffold with example tools, resources, prompts, and robust production features such as error handling, validation, logging, and testing. The included tools cover math operations (add, subtract, multiply, divide, power, factorial), text processing (length, case conversion, word extraction, replacement), and utility functions (UUID generation, hashing, JSON validation, base64 encoding). The resources offer system metrics and an in-memory data store with sample data in multiple formats, while the prompts support code review, data analysis templates, and problem-solving frameworks. To run the server with Claude or other MCP clients, you typically invoke uv to launch the main module, exposing a transport-compatible API for requests and responses. Use the provided Makefile targets or run the module directly to start the server and begin issuing MCP commands.
How to install
Prerequisites:
- Python 3.11+
- uv package manager
Installation steps:
-
Clone or download the boilerplate repository and navigate into the project: git clone <your-repo-url> your-mcp-server cd your-mcp-server
-
Install development dependencies and set up the environment (via uv): uv sync --all-extras cp .env.example .env
-
Optionally rename or customize the project (rename package, update settings, and register new tools/resources/prompts as needed). See the Quick Start section in the README for guidance on renaming and updating configuration files.
-
Run the server (see Run commands in the Quick Start): make run
or directly:
uv run python -m mcp_boilerplate.main
-
Run tests and quality checks when needed: make test make test-cov make lint make type-check
Additional notes
Tips and notes:
- The boilerplate includes example components under src/mcp_boilerplate/. If you remove unused tools/resources/prompts, ensure you update the init imports accordingly.
- Environment variables in .env are used to customize server behavior (SERVER_NAME and any API keys or DB URLs you add).
- You can run with different transports (e.g., SSE) using the provided Make targets or by adjusting the uv command, as demonstrated in the README.
- For Claude Desktop or other MCP clients, add your server configuration with command and arguments matching the uv invocation so it can connect and send MCP requests.
- When renaming the project, prefer the automated script option to minimize manual edits, and verify imports and package references after the change.
Related MCP Servers
mcp-pinecone
Model Context Protocol server to allow for reading and writing from Pinecone. Rudimentary RAG
Gitingest
mcp server for gitingest
microsoft_fabric_mcp
MCP server wrapping around the Fabric Rest API
mcp -memos-py
A Python package enabling LLM models to interact with the Memos server via the MCP interface for searching, creating, retrieving, and managing memos.
appdog
Compose and generate effortlessly MCP servers from any OpenAPI specifications
fastmcp-builder
A comprehensive Claude Code skill for building production-ready MCP servers using FastMCP. Includes reference guides, runnable examples, and a complete implementation with OAuth, testing, and best practices.