本项目是一个天气 MCP 服务器,为用户提供与天气相关的服务,可结合 Claude for Desktop 客户端进行测试使用。
可使用以下命令运行服务:
uv run weather.py
打开并编辑文件:~/Library/Application\ Support/Claude/claude_desktop_config.json,内容如下:
{
"mcpServers": {
"weather": {
"command": "/ABSOLUTE/PATH/TO/uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/mcp-weather-server",
"run",
"weather.py"
]
}
}
}
重启不报错,且有锤子图标显示两个 Available MCP Tools,即为成功;否则,查看日志排查。
文档链接:https://modelcontextprotocol.io/quickstart/server
~/Library/Logs/Claudemcp-server-weather.logmcp.log