Content
# 🧠 MCP Aggregated Tool Service




A modular, extensible and FastAPI-based MCP (Multi-Component Platform) tool aggregation service. Easily connect and expose independent tools through standardized APIs. Perfect for frontend integration or large language model (LLM) orchestration.
---
## 🌟 Features
- ✅ Automatic registration of multiple tools (based on directory scanning)
- ✅ All interfaces use unified POST method + BaseModel validation
- ✅ Asynchronous httpx interface calls supported
- ✅ Standardized JSON response format (success/error)
- ✅ One-click Docker deployment support
- ✅ Accompanying development documentation for easy expansion of tool modules
---
## 📁 Project Structure
```bash
.
├── main.py # FastAPI main program, including MCP registration logic
├── tools/ # Tool directory, one function per file
├── Dockerfile # For building images
├── docker-compose.yml # One-click deployment support
├── mcp_tool_开发说明.md # Developer usage specification document (Chinese)
└── README.md
```
---
## 🚀 Quick Start
### 🧰 Requirements
- Python 3.8+
- pip
- Docker / Docker Compose (optional)
### 📦 Local Dev
```bash
# Install dependencies
pip install -r requirements.txt
# Start service
python main.py
```
Default service address: http://localhost:8000/mcp
### 🐳 Docker Deployment
```bash
# Build & Run
docker-compose up --build -d
# Access MCP tool service
http://localhost:8000/mcp
```
---
## 🧱 Tool Module Guidelines
Each tool should be placed in the `tools/` directory (can be nested multiple layers) and include:
1. Define parameters using `pydantic.BaseModel`;
2. Register the tool function using `@__mcp_server__.tool()`;
3. Return `success_response()` or `error_response()`;
4. (Optional) Asynchronously call external interfaces + cache results.
Example reference:
```python
from pydantic import BaseModel
from main import __mcp_server__, success_response
class MyParams(BaseModel):
name: str
@__mcp_server__.tool()
async def hello_tool(params: MyParams):
return success_response({"message": f"Hello {params.name}!"})
```
---
## 🔗 API Usage
All tool interfaces are accessed through the `/mcp` path, automatically registered according to the module.
Request method: `POST`
Request format: `application/json`
Response format:
```json
{
"status": "success",
"result": {
...
}
}
```
---
## 📚 Docs
- [📘 开发说明文档 (中文)](./mcp_tool_开发说明.md)
- Example module path: `tools/xxx/tool_name.py`
---
## 📄 License
MIT License © 2025 [your-name]
Connection Info
You Might Also Like
everything-claude-code
Complete Claude Code configuration collection - agents, skills, hooks,...
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
firecrawl
Firecrawl MCP Server enables web scraping, crawling, and content extraction.
cc-switch
All-in-One Assistant for Claude Code, Codex & Gemini CLI across platforms.
servers
Model Context Protocol Servers
servers
Model Context Protocol Servers