天气MCP服务

lukewange/Weather-MCP-Server
0 Stars 15 次浏览 更新于 2026-08-23

这是一个用于ModelScope MCP广场发布的天气查询MCP服务。它提供指定城市的当前天气和1-7天的天气预报信息,并允许自定义响应的语言和温度单位。

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "weather": {
      "args": [
        "langgraph_minimal/weather-mcp-server/server.py"
      ],
      "command": "python"
    }
  }
}

服务介绍

Weather MCP Server

这是一个用于 ModelScope MCP 广场发布的天气查询 MCP 服务。

服务代码位于:

langgraph_minimal/weather-mcp-server/

服务配置信息

{
  "mcpServers": {
    "weather": {
      "command": "python",
      "args": ["langgraph_minimal/weather-mcp-server/server.py"]
    }
  }
}

服务启动方式

python langgraph_minimal/weather-mcp-server/server.py

MCP 工具

weather_now

查询城市当前天气。

参数:

  • city:城市名称,例如 北京上海New York
  • language:可选,默认 zh
  • temperature_unit:可选,默认 celsius

weather_forecast

查询城市 1-7 天天气预报。

参数:

  • city:城市名称
  • days:预报天数,默认 3
  • language:可选,默认 zh
  • temperature_unit:可选,默认 celsius

外部依赖

本服务使用 Open-Meteo 公共 API:

  • https://geocoding-api.open-meteo.com/v1/search
  • https://api.open-meteo.com/v1/forecast

默认不需要 API Key。

本地验证

cd langgraph_minimal
python scripts/chapter10_weather_mcp_demo.py

发布包结构

langgraph_minimal/weather-mcp-server/
├── README.md
├── LICENSE
├── Dockerfile
├── pyproject.toml
├── requirements.txt
├── smithery.yaml
└── server.py

相关 MCP 服务