天气MCP服务
这是一个用于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 Yorklanguage:可选,默认zhtemperature_unit:可选,默认celsius
weather_forecast
查询城市 1-7 天天气预报。
参数:
city:城市名称days:预报天数,默认3language:可选,默认zhtemperature_unit:可选,默认celsius
外部依赖
本服务使用 Open-Meteo 公共 API:
https://geocoding-api.open-meteo.com/v1/searchhttps://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