天气服务

一个通过MCP协议提供天气信息查询的服务,支持与Claude等客户端集成。

  • by ZhangXixiang
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 ZhangXixiang/weather

使用说明

参见:https://modelcontextprotocol.io/docs/develop/build-server#what%E2%80%99s-发生在引擎盖下

您的服务器已完成!跑 uv run weather.py 启动MCP服务器,该服务器将监听来自MCP主机的消息。 现在让我们从现有的MCP主机Claude for Desktop测试您的服务器。

类似客户端的游标配置:

{
  "mcpServers": {
    "weather": {
      "command": "uv",
      "args": [
        "--directory",
        "/ABSOLUTE/PATH/TO/PARENT/FOLDER/weather",
        "run",
        "weather.py"
      ]
    }
  }
}

引擎盖下面发生了什么

When you ask a question:
The client sends your question to Claude
Claude analyzes the available tools and decides which one(s) to use
The client executes the chosen tool(s) through the MCP server
The results are sent back to Claude
Claude formulates a natural language response
The response is displayed to you!
```# weather