mcpField
W
weather-mcp-server

weather-mcp-server

本地服务
github.com/jaredco地图与出行03 周前更新

关于 weather-mcp-server

weather-mcp-server 是面向 Claude 等 MCP 客户端的远程天气服务,提供全球地点的实时天气、多日预报和规划天气数据。

主要功能

  1. 01查询当前天气及详细信息
  2. 02最长 14 天的天气预报
  3. 037 天规划天气预报
  4. 04支持城市、邮编或坐标查询
  5. 05面向大模型的精简响应

适用场景

  1. 01查询城市当前天气
  2. 02规划旅行或户外活动
  3. 03查看施工期间的天气

MCP 相关

通过远程端点向 MCP 客户端提供 weatherTool 和 weatherPlanningTool,并支持 MCP JSON-RPC 2.0。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"jaredco-ai-weather": {
"command": "npx",
"args": [
"-y",
"@jaredco/weather-mcp-server"
]
}
}
}
启动命令npx -y @jaredco/weather-mcp-server

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npm@jaredco/weather-mcp-server1.0.1

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

🌦 WeatherTrax MCP 服务

为 Claude 和其他 MCP 客户端提供快速、可靠的天气数据。
查询全球任意地点的当前天气状况和多日预报。

🌐 远程 MCP 服务(无需安装)
https://mcp-weathertrax.jaredco.com/mcp


许可证:MIT MCP 协议 MCP 注册表


⚡ 10 秒演示

向 Claude 提问:

“明天迈阿密的天气怎么样?”

Claude 将调用 MCP 天气服务,并立即返回天气预报。

API 调用示例:

curl -X POST https://mcp-weathertrax.jaredco.com/tools/weatherTool \
  -H "Content-Type: application/json" \
  -d '{"location":"Miami","query_type":"current"}'

🚀 功能

  • 实时天气数据 – 当前天气状况、温度、湿度、风速
  • 多日预报 – 最长 14 天的预报
  • 规划工具 – 针对活动或施工优化的 7 天预报
  • 灵活的位置输入 – 城市名称、邮政编码或坐标
  • 节省令牌 – 针对大模型使用优化的精简响应
  • 可用于生产环境 – 具备速率限制和监控功能
  • 公共 API – 无需 API 密钥
  • 符合 MCP 规范 – 完整支持 JSON-RPC 2.0

⚡ 快速开始

Claude

在 Claude 或 Claude Desktop 中,打开 设置 → 连接器 → 添加连接器,并使用:

Name: WeatherTrax
URL:  https://mcp-weathertrax.jaredco.com/mcp

现在你可以提问:

What’s the weather in New York this weekend?

🌐 直接使用 API

健康检查
curl https://mcp-weathertrax.jaredco.com/healthz
MCP 清单
curl https://mcp-weathertrax.jaredco.com/.well-known/mcp/manifest

💡 使用示例

当前天气

curl -X POST https://mcp-weathertrax.jaredco.com/tools/weatherTool \
  -H "Content-Type: application/json" \
  -d '{
    "location": "San Francisco, CA",
    "query_type": "current"
  }'

响应示例:

{
  "summary": "It is currently 54°F and Clear in San Francisco.",
  "temp_high": 54,
  "temp_low": 54,
  "condition": "Clear",
  "wind": "5 mph W",
  "humidity": 65
}

多日预报

curl -X POST https://mcp-weathertrax.jaredco.com/tools/weatherTool \
  -H "Content-Type: application/json" \
  -d '{
    "location": "New York",
    "query_type": "multi_day",
    "num_days": 3
  }'

🛠 可用工具

weatherTool

获取当前天气或天气预报。

输入:

{
  "location": "city name or coordinates",
  "query_type": "current | multi_day",
  "num_days": "optional forecast length"
}

weatherPlanningTool

针对户外作业或活动的 7 天规划预报。

输入:

{
  "location": "city or place",
  "context": "construction | travel | event",
  "timeframe": "optional timeframe hint"
}

🔗 MCP 协议集成

此服务支持完整的 MCP JSON-RPC 协议。

工具调用示例:

curl -X POST https://mcp-weathertrax.jaredco.com/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc":"2.0",
    "id":1,
    "method":"tools/call",
    "params":{
      "name":"weatherTool",
      "arguments":{
        "location":"London",
        "query_type":"current"
      }
    }
  }'

🧪 测试

在一个终端中本地运行:

npm install
npm start

在另一个终端中运行协议测试:

npm test

发布冒烟测试套件:

npm run test:full

npm run test:full 目前运行相同的受支持端到端冒烟测试套件。旧版 Streamable HTTP 之前的回归测试框架仍可通过 npm run test:legacy 使用;保留该框架仅供参考,不作为发布门槛。

部署配置

设置以下服务端环境变量;切勿将其提交到版本库:

变量必需用途
WEATHER_API_KEY是World Weather Online API 密钥。
PORT否HTTP 监听端口;默认为 3000。
TRUST_PROXY视生产环境而定受信任的反向代理跳数;如果使用单个已知代理,请设为 1。
ALLOWED_ORIGINS否允许调用 MCP 的浏览器来源列表,以逗号分隔;默认为 https://claude.ai。

该服务在 /metrics 提供汇总且不含身份信息的运行指标。若未添加适当的访问控制,请勿将此端点置于公共仪表板之后。


🔒 隐私

隐私政策:

https://mcp-weathertrax.jaredco.com/privacy

要点:

  • 仅收集汇总运行指标;不记录位置和提供方原始响应
  • 短期内存缓存可减少重复的提供方请求
  • 不使用 Cookie 或跟踪技术
  • 强制使用 HTTPS

🛠 开发

克隆仓库:

git clone https://github.com/jaredco/weather-mcp-server.git
cd weather-mcp-server
npm install
npm start

服务在本地运行于:

http://localhost:3000

📦 技术栈

  • Node.js
  • Express 5
  • @modelcontextprotocol/sdk
  • World Weather Online API
  • Railway 托管

📄 许可证

MIT 许可证。


🌟 致谢

使用 Anthropic 开发的 Model Context Protocol 构建。

天气数据由 World Weather Online 提供。


📊 状态

服务:生产环境
API 版本:1.0.1
MCP 协议:2025-03-26


为 Claude 和 MCP 倾情打造 ☀️

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。