Add your description here
Project description
MCP Base
A solid, foundational starting point for MCP projects. MCP Base is a production-ready, extensible template for building Model Context Protocol (MCP) servers in Python. Rapidly create, extend, and deploy MCP servers that expose tools, prompts, and resources to LLMs and agentic clients.
๐ What is This?
This is a Python starter baseโnot a specific server implementation. It provides a modular, well-documented foundation for building your own MCP servers in Python, supporting multiple transport layers (STDIO, SSE, HTTP, etc.), and demonstrating best practices for security, extensibility, and maintainability.
๐๏ธ Architecture Overview
.
โโโ src/
โ โโโ base/ # Base classes for tools, prompts, resources
โ โโโ tools/ # Example tools (filesystem, API, prompt, etc.)
โ โโโ resources/ # Example resources (static/dynamic)
โ โโโ prompts/ # Example prompts (text generation, summarization)
โ โโโ transports/ # Transport layer implementations & docs
โ โ โโโ stdio/
โ โ โ โโโ README.md
โ โ โโโ sse/
โ โ โ โโโ README.md
โ โ โโโ ...
โ โโโ config.py # Configuration and environment management
โ โโโ server.py # Server instantiation and registration
โ โโโ main.py # Entrypoint: selects transport, starts server
โโโ tests/ # Example tests for tools/resources
โโโ Dockerfile # Containerized deployment
โโโ requirements.txt / pyproject.toml
โโโ README.md # This file
โโโ CONTRIBUTING.md
โโโ ...
โจ Features
- Multi-Transport Support: STDIO, SSE, HTTP, and more (see
/src/transports/) - Modular Tools/Prompts/Resources: Add new features by creating a class and registering it
- Type-Safe Input Validation: Uses Pydantic for schemas
- Security Best Practices: Directory sandboxing, input validation, error handling
- Extensible & Maintainable: Clean separation of concerns, base classes, and registries
- Production-Ready: Logging, environment management, Docker support
- Comprehensive Documentation: For users and contributors
๐ ๏ธ Getting Started
1. Install Dependencies
pip install -r requirements.txt
2. Configure Environment
Copy .env.example to .env and fill in required values.
3. Run the Server
STDIO Transport:
python main.py --transport=stdio
SSE/HTTP Transport:
See /src/transports/sse/README.md and /src/transports/http/README.md for details.
๐งฉ Adding Tools, Prompts, and Resources
Tools
- Create a new class in
/src/tools/inheriting fromBaseTool - Implement the required methods and input schema
- Register the tool in the tool registry
Prompts
- Create a new class in
/src/prompts/inheriting fromBasePrompt - Implement the required methods and input schema
- Register the prompt in the prompt registry
Resources
- Add static or dynamic resources in
/src/resources/ - Register them in the resource registry
๐ Supported Transports
- STDIO: For CLI and agentic integration (see
/src/transports/stdio/README.md) - SSE: For server-sent events and web clients (see
/src/transports/sse/README.md) - HTTP: For RESTful or web-based integration (see
/src/transports/http/README.md)
Each transport is modular and can be extended or replaced.
๐ก๏ธ Security & Best Practices
- All file and directory operations are sandboxed to allowed paths
- Input validation is enforced for all tool/resource inputs
- Error handling is consistent and user-friendly
- Sensitive configuration is managed via environment variables
๐งช Testing
- Example tests are provided in
/tests/ - Use Pytest as the test runner
- See CONTRIBUTING.md for test guidelines
๐ค Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines, code style, and PR process.
๐ Further Reading
- Model Context Protocol Documentation
- Official MCP Python SDK
- Reference MCP Servers Gallery
- Transport Layer Docs
๐ License
MIT License. See LICENSE for details.
๐ฌ Community & Support
MCP Base is the recommended starting point for all new Python MCP server projects. Fork, extend, and contribute improvements!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iflow_mcp_josharsh_mcp_server-0.1.2.tar.gz.
File metadata
- Download URL: iflow_mcp_josharsh_mcp_server-0.1.2.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a127d9e04c98e8aed2d4ac8c5b5f361dd5f031f631b6315a9af494eeaca348c
|
|
| MD5 |
4f132122fc014cf167c1448272fe4fcb
|
|
| BLAKE2b-256 |
432281f21c0157fc2a7d8a07aa9b7f9c0f133bcbebe546c396c782cfe675301d
|
File details
Details for the file iflow_mcp_josharsh_mcp_server-0.1.2-py3-none-any.whl.
File metadata
- Download URL: iflow_mcp_josharsh_mcp_server-0.1.2-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0b4ceb9ed9a03ead5c2d337d8778a8387963adaa8247bb82c58c98753680e06
|
|
| MD5 |
050f4f86c747f7571391b36bd45a0f58
|
|
| BLAKE2b-256 |
bbd8b65127e5a9dffb1d0b17880f6681032dcc7995bcedcb7b9322754409d2a9
|