使用说明
简单MCP服务器🚀
一个轻量级的MCP服务器,为Claude AI提供了4个工具:计算器、时间检查器、随机事实和文本分析器。
✨ Features
🧮 Calculator: Safe math evaluation
🕰️ Time checker: Current time in any timezone
📚 Random facts: From public API
📊 Text analyzer: Word/character counts
⚡ Async performance
🔒 Safe execution
🚀 Quick Start
1.安装
bash
git clone https://github.com/yourusername/simple-mcp-server
cd simple-mcp-server
pip install "mcp[cli]" httpx
2.跑步
python server.py
3.配置克劳德桌面
Create config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
Than create a config file to understand the claude which file have to run and give the proper file path of server file.
添加此配置:
json
{
"mcpServers": {
"my-tools": {
"command": "python",
"args": ["/FULL/PATH/TO/server.py"]
}
}
}
4.重新启动克劳德桌面并使用!
🛠️ Usage Examples
Ask Claude:
"Calculate 25 * 4"
"What time is it in Tokyo?"
"Tell me a random fact"
"Count words in this text: Hello world"
项目结构
text
server.py # Main MCP server
requirements.txt # Dependencies
README.md # This file
.gitignore # Git ignore
依赖项
txt
mcp[cli]>=1.0.0
httpx>=0.25.0
故障排除
Tools not showing? Restart Claude Desktop
Python not found? Use full path like /usr/bin/python3
Module errors? Run pip install "mcp[cli]" httpx
贡献
Feel free to fork and submit PRs to add more tools!
注:-
如果你不想使用Claude桌面应用程序,你也可以使用客户端CLI来测试MCP服务器,我已经将其包含在存储库中。