MCP Multi-Tool Server
Provides calculator tools for mathematical operations, document resources for accessing TypeScript SDK documentation, and prompt templates for generating structured meeting summaries. Built with FastMCP to demonstrate comprehensive MCP capabilities including tools, resources, and prompts in a single implementation.
README
MCP Multi-Tool Server
A comprehensive Model Context Protocol (MCP) server built with FastMCP that provides calculator tools, document resources, and prompt templates. This server demonstrates multiple MCP capabilities including tools, resources, and prompts in a single implementation.
Features
🧮 Calculator Tools
- Basic Operations: Addition, subtraction, multiplication, division
- Advanced Math: Power, square root, factorial calculations
- Utility Functions: Percentage calculations
- Error Handling: Division by zero protection, negative square root protection, factorial range limits
📖 Document Resources
- TypeScript SDK Resource: Access to MCP TypeScript SDK documentation
- Dynamic File Reading: Reads from configurable file paths
- Error Handling: Graceful handling of missing files
📝 Prompt Templates
- Meeting Summary Template: Executive meeting summary generator
- Variable Substitution: Dynamic template variable replacement
- Structured Output: Professional meeting summary format
Quick Start
Prerequisites
- Python 3.12 or later
uvpackage manager
Installation
-
Clone the repository
git clone <your-repo-url> cd mcp-multi-tool-server -
Install dependencies
uv sync -
Test the server
uv run mcp dev server.pyOpen http://localhost:3000 to test the server in MCP Inspector.
Usage
Calculator Tools
The server provides 8 calculator tools:
| Tool | Description | Example |
|---|---|---|
add |
Add two numbers | add(5, 3) → 8 |
subtract |
Subtract second from first | subtract(10, 4) → 6 |
multiply |
Multiply two numbers | multiply(6, 7) → 42 |
divide |
Divide first by second | divide(15, 3) → 5 |
power |
Raise to power | power(2, 8) → 256 |
square_root |
Calculate square root | square_root(16) → 4 |
factorial |
Calculate factorial | factorial(5) → 120 |
calculate_percentage |
Calculate percentage | calculate_percentage(200, 15) → 30 |
TypeScript SDK Resource
Access the TypeScript SDK documentation:
# Resource URI: file://typesdk
# Returns the contents of the TypeScript SDK documentation
Configuration: Update DESKTOP_FILE_PATH in server.py to point to your documentation file:
DESKTOP_FILE_PATH = r"C:\Users\VipanKumar\Desktop\typesdk.md"
Meeting Summary Prompt
Generate structured meeting summaries:
# Prompt: meeting_summary
# Required parameters:
# - meeting_date: Date of the meeting
# - meeting_title: Title or purpose of the meeting
# - transcript: Meeting transcript or notes
Output Structure:
- Overview (purpose, participants, topics)
- Key Decisions (major decisions, strategic changes)
- Action Items (next steps, responsibilities, deadlines)
- Follow-up Required (pending discussions, future meetings)
Claude Desktop Integration
Configuration
Add to your Claude Desktop config file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"multi-tool-server": {
"command": "uv",
"args": [
"--directory",
"/path/to/your/server/directory",
"run",
"python",
"server.py"
],
"env": {
"UV_PROJECT_ENVIRONMENT": ".venv"
}
}
}
}
Restart Claude Desktop
After updating the configuration, restart Claude Desktop to load the server.
Development
Project Structure
mcp-multi-tool-server/
├── server.py # Main server implementation
├── templates/
│ └── Prompt.md # Meeting summary template
├── pyproject.toml # Project configuration
├── claude_desktop_config.json # Claude Desktop config example
├── README.md # This file
└── .venv/ # Virtual environment
Testing
MCP Inspector (Recommended)
uv run mcp dev server.py
Direct Server Testing
python server.py
Testing Individual Components
- Calculator Tools: Use MCP Inspector to call each tool with test parameters
- Resource Access: Check the resource tab in MCP Inspector for
file://typesdk - Prompt Templates: Test the
meeting_summaryprompt with sample data
Customization
Adding New Calculator Tools:
@mcp.tool()
def new_calculation(param1: float, param2: float) -> float:
"""Description of the new calculation."""
return param1 + param2 # Your calculation logic
Adding New Resources:
@mcp.resource("file://your-resource")
async def get_your_resource() -> str:
"""Description of your resource."""
# Your resource logic
return "Resource content"
Adding New Prompts:
@mcp.prompt("your_prompt")
async def your_prompt(param1: str, param2: str) -> str:
"""Description of your prompt."""
# Your prompt logic
return f"Processed: {param1}, {param2}"
Error Handling
The server includes comprehensive error handling:
- Division by Zero: Returns appropriate error message
- Negative Square Roots: Prevents invalid operations
- Factorial Limits: Restricts calculations to reasonable ranges (n ≤ 100)
- File Not Found: Graceful handling of missing resource files
- Template Errors: Proper error reporting for prompt template issues
Configuration Options
File Paths
Update these paths in server.py for your environment:
# TypeScript SDK documentation path
DESKTOP_FILE_PATH = r"C:\Users\YourUser\Desktop\typesdk.md"
# Prompt template path (relative to server.py)
PROMPT_TEMPLATE_PATH = os.path.join(os.path.dirname(__file__), "templates", "Prompt.md")
Server Name
Change the server name in server.py:
mcp = FastMCP("Your Server Name")
Troubleshooting
Common Issues
Server won't start:
- Check Python version (3.12+ required)
- Verify
uvinstallation:uv --version - Check virtual environment:
uv sync
Tools not appearing in Claude:
- Verify Claude Desktop config file location
- Check file paths in configuration
- Restart Claude Desktop after config changes
Resource file not found:
- Verify
DESKTOP_FILE_PATHpoints to correct file - Check file permissions
- Ensure file exists and is readable
Prompt template errors:
- Verify
templates/Prompt.mdexists - Check template syntax
- Ensure proper variable placeholders:
{{ variable_name }}
Debug Mode
Run with debug output:
uv run python server.py --debug
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Add tests for new functionality
- Submit a pull request
License
This project is licensed under the MIT License. See LICENSE file for details.
Resources
Built with FastMCP - A high-level Python library for building MCP servers.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。