关于 Weather Forecast MCP
Weather Forecast MCP 为 MCP 客户端提供全球城市的当前天气和最长 7 天预报,支持中英文城市名并以中文返回结果。它可通过免密钥的托管端点使用,也可自行部署。
主要功能
- 01查询当前天气与 1–7 天预报
- 02接受中英文城市名
- 03中文天气信息输出
- 04主数据源故障时自动切换
- 05支持远程端点与自托管
适用场景
- 01查询旅行目的地的天气
- 02查看未来数日的降水概率与温度
- 03在 MCP 客户端中获取中文天气信息
MCP 相关
该 MCP 服务通过 `query_weather` 工具向客户端提供天气查询。可连接公开的 Streamable HTTP 端点,或自行运行服务。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://mcp.pianam.cn/weather-mcp/mcpclaude mcp add --transport http cn-pianam-mcp-weather-mcp-china https://mcp.pianam.cn/weather-mcp/mcp{"mcpServers":{"cn-pianam-mcp-weather-mcp-china":{"type":"http","url":"https://mcp.pianam.cn/weather-mcp/mcp"}}}在 Cursor 中打开{"servers":{"cn-pianam-mcp-weather-mcp-china":{"type":"http","url":"https://mcp.pianam.cn/weather-mcp/mcp"}}}在 VS Code 中打开{"mcpServers":{"cn-pianam-mcp-weather-mcp-china":{"type":"http","url":"https://mcp.pianam.cn/weather-mcp/mcp"}}}{"mcpServers":{"cn-pianam-mcp-weather-mcp-china":{"serverUrl":"https://mcp.pianam.cn/weather-mcp/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
工具
详细介绍
天气预报 MCP
查询全球城市的实时天气和最长 7 天的预报(支持中英文城市名,中文输出),并采用双数据源确保可靠性。
- 30 秒即可试用:免费的公共 MCP 端点已在运行——只需将 URL 粘贴到 MCP 客户端中(无需安装,也无需 API 密钥)。
- 也可自托管:单个 Python 文件,使用标准库 HTTP + FastMCP,无需任何付费依赖。
⚡ 使用托管端点(无需配置)
https://mcp.pianam.cn/weather-mcp/mcp
传输方式:Streamable HTTP(兼容 MCP 2025-03-26)。无需身份验证。
🔌 客户端配置
将以下内容添加到 MCP 客户端的 mcpServers 配置中(Claude Desktop 的 claude_desktop_config.json、Cursor 的 mcp.json、Cline、Cherry Studio 等):
{
"mcpServers": {
"weather": {
"type": "http",
"url": "https://mcp.pianam.cn/weather-mcp/mcp"
}
}
}
不接受
"type": "http"的客户端(部分 Cherry Studio / 较旧版本的 Cline)可使用仅包含"url"的相同配置项。
🧰 工具
| 工具 | 参数 | 返回内容 |
|---|---|---|
query_weather(city, days=3) | city:中文或英文城市名,例如 "青岛"、"北京"、"Tokyo"。days:预报天数,1–7(默认值为 3)。 | 当前天气状况(天气描述、温度、体感温度、湿度、风向/风速)+ 每日预报(日期、天气、最高/最低温、降水概率)。 |
📡 数据源、缓存与限制
- 主要数据源:Open-Meteo——免费,无需 API 密钥或注册;提供地理编码和天气预报,并支持中文城市名解析(按行政城市排序,避免与村庄重名)。
- 自动备用:主要数据源故障时切换至 wttr.in。
- 输出中的 WMO 天气代码和风向均已翻译为中文。
- 结果缓存 600 秒;托管端点的限流为每个 IP 200 次请求 / 分钟。
🐢 自托管
git clone https://github.com/boy-373/weather-mcp-china.git
cd weather-mcp-china
pip install -r requirements.txt
python weather_mcp_server.py
# the server listens on 127.0.0.1:8004 by default; override with:
# MCP_HOST=0.0.0.0 MCP_PORT=9000 python weather_mcp_server.py
# MCP_ALLOWED_HOSTS="your-domain.com,127.0.0.1:*"
# MCP_ALLOWED_ORIGINS="https://your-domain.com"
然后将 MCP 客户端指向 http://127.0.0.1:8004/mcp。
始终无需 API 密钥或账号。
🐳 使用 Docker 自托管
选项 A — 拉取预构建镜像(最快,无需构建):
docker run -d -p 8000:8000 --name weather-mcp-china ghcr.io/boy-373/weather-mcp-china:latest
选项 B — 从源代码构建:
git clone https://github.com/boy-373/weather-mcp-china.git
cd weather-mcp-china
docker build -t weather-mcp-china .
docker run -d -p 8000:8000 --name weather-mcp-china weather-mcp-china
然后将 MCP 客户端指向 http://127.0.0.1:8000/mcp。
容器默认监听 0.0.0.0:8000(可通过 -e MCP_PORT=9000 覆盖,并相应调整 -p)。无需 API 密钥或账号。
🗂️ 文件
weather_mcp_server.py— MCP 服务(FastMCP,Streamable HTTP 传输)。rate_limit.py— 轻量级的按 IP 滑动窗口限流中间件(默认每分钟 200 次请求)。requirements.txt—mcp、uvicorn、starlette。server.json— 官方 MCP Registry 清单(远程服务条目,可直接使用mcp-publisher发布)。smithery.yaml/glama.json— 目录列表元数据。
🇨🇳 中文使用说明
一句话:查询全球城市实时天气与多日预报,直接使用中文城市名查询,结果以中文输出,最长可预报 7 天。
在线直连地址(免费、无需 Key、开箱即用):https://mcp.pianam.cn/weather-mcp/mcp
在 MCP 客户端(Claude Desktop / Cursor / Cherry Studio / Cline 等)的配置中添加:
{
"mcpServers": {
"weather": {
"type": "http",
"url": "https://mcp.pianam.cn/weather-mcp/mcp"
}
}
}
工具:
query_weather(city, days):查询天气。城市名支持中文和英文(「青岛」「北京」「Tokyo」),days为预报天数(1-7,默认值为 3)。- 返回当前天气(天气状况/温度/体感温度/湿度/风向风速)+ 每日预报(日期/天气/最高最低温/降水概率)。
- 主要数据源为 Open-Meteo(免费,无需 Key),发生故障时自动切换至 wttr.in。
服务特性:所有数据源均为公开接口,无需注册或付费;服务端内存缓存,失败时自动降级/切换备用通道;单个 IP 限流为每分钟 200 次。
本地部署:
git clone https://github.com/boy-373/weather-mcp-china.git
cd weather-mcp-china
pip install -r requirements.txt
python weather_mcp_server.py
# 默认监听 127.0.0.1:8004,可用环境变量 MCP_HOST / MCP_PORT / MCP_ALLOWED_HOSTS / MCP_ALLOWED_ORIGINS 覆盖
Docker 自托管:
# 方式一:直接拉预构建镜像(最快,无需构建)
docker run -d -p 8000:8000 --name weather-mcp-china ghcr.io/boy-373/weather-mcp-china:latest
# 方式二:从源码构建
git clone https://github.com/boy-373/weather-mcp-china.git && cd weather-mcp-china
docker build -t weather-mcp-china .
docker run -d -p 8000:8000 --name weather-mcp-china weather-mcp-china
# MCP 地址填:http://127.0.0.1:8000/mcp
容器默认监听 0.0.0.0:8000(可使用 -e MCP_PORT=端口 修改),无需任何 API Key 或账号。
📄 许可证
MIT © 2026 boy-373
通过 Smithery 安装
为支持 Smithery 的客户端(Claude Desktop、Cursor 等)提供一键安装:
或运行:
npx -y @smithery/cli install 1561852680/weather-mcp-china --client claude
🔌 适用于任何 AI 客户端 — 一键 MCP 网关
我们托管了一个免费的 MCP 聚合网关:你的 AI 助手(Cherry Studio、Claude Desktop、Cursor、Cline — 任何 MCP 客户端)都可以通过一个 URL 发现并使用 MCP 工具:
https://mcp.pianam.cn/ai/mcp
添加一次,然后用自然语言交流 — AI 会自动为你搜索 → 检查 → 调用合适的 MCP。
- 🔍 搜索 22,000+ 个已索引的 MCP 服务(中文和英文)
- ⚡ 50+ 个在线托管的 MCP,开箱即可直接调用(天气、汇率、热门趋势、IP 地理位置、火车票……)
- 📦 基于 GitHub 的 MCP:搜索结果会提供链接,方便在本地安装
- ✅ 每周检查服务健康状态 — 正常运行的服务会优先显示
- 🆓 免费使用,无需密钥
📖 3 步设置指南 / 中文接入教程:https://mcp.pianam.cn/ai-gateway
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。