使用说明
MCP天气
一个简单的MCP服务器,为给定的美国州提供天气信息。
需求
- 紫外线
- Python 3.10+
curl -LsSf https://astral.sh/uv/install.sh | sh
安装
git clone git@github.com:hedon-ai-road/mcp-weather.git
cd mcp-weather
uv venv
source .venv/bin/activate
uv add "mcp[cli]" httpx
uv run weather.py
Claude桌面配置
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"weather": {
"command": "{ABSOLUTE_PATH_TO_uv}",
"args": ["--directory", "{ABSOLUTE_PATH_TO_PROJECT}", "run", "weather.py"]
}
}
}