Skip to main content
Glama
wu-weather-mcp

wu-weather-mcp

by Rankintosh

wu-weather-mcp

一个 MCP 服务器,将任何 Weather Underground 个人气象站 (PWS) 作为工具公开给 Claude。向 Claude 询问当前状况、每日摘要、每小时历史记录和气象站元数据——所有数据均从您的气象站实时获取。

先决条件

  • Node.js 18+

  • 拥有 PWS 的 Weather Underground 账户

  • Weather Underground API 密钥(免费)

  • 您的气象站 ID(在您的 WU 仪表板中可见,例如 KCALAKEF92)

Related MCP server: weather-mcp-server

设置

1. 克隆并安装

git clone https://github.com/your-username/wu-weather-mcp.git
cd wu-weather-mcp
npm install

2. 配置环境

cp .env.example .env

编辑 .env:

WU_API_KEY=your_api_key_here
WU_STATION_ID=your_station_id_here
WU_STATION_NAME=My Weather Station   # optional — defaults to station ID

3. 构建

npm run build

4. 测试

node build/index.js

服务器在 stdio 上启动并等待 MCP 消息。按 Ctrl-C 退出。


Claude Desktop 集成

将此内容添加到您的 claude_desktop_config.json 中:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "wu-weather": {
      "command": "node",
      "args": ["/absolute/path/to/wu-weather-mcp/build/index.js"]
    }
  }
}

将 /absolute/path/to/wu-weather-mcp 替换为您克隆仓库的实际路径。 在 macOS 上,您可以在克隆的文件夹内运行 pwd 来获取该路径。

保存后重启 Claude Desktop。您的天气工具将自动出现。

替代方案:通过配置而非 .env 传递凭据

{
  "mcpServers": {
    "wu-weather": {
      "command": "node",
      "args": ["/absolute/path/to/wu-weather-mcp/build/index.js"],
      "env": {
        "WU_API_KEY": "your_api_key_here",
        "WU_STATION_ID": "your_station_id_here",
        "WU_STATION_NAME": "My Weather Station"
      }
    }
  }
}

可用工具

工具

参数

描述

get_current_conditions

—

当前温度、湿度、风速、气压、紫外线、降水率、露点、太阳辐射

get_daily_summary

days (1–7, 默认 7)

每日最高/最低/平均温度、最大阵风、总降水量

get_hourly_history

hours (1–24, 默认 24)

每小时的温度、湿度、风速和降水量

get_station_info

—

气象站名称、ID、坐标、海拔、社区

示例提示词

  • “现在天气怎么样?”

  • “给我看看过去 3 天的天气情况。”

  • “昨天下午每小时的天气明细是什么?”

  • “我的气象站海拔是多少?”


开发

npm run dev      # watch mode — recompiles on save
npm run build    # one-off build

源代码位于 src/index.ts。进行任何更改后请重新构建 (npm run build)。

发布到 npm

npm publish

发布后,用户无需克隆即可运行:

{
  "mcpServers": {
    "wu-weather": {
      "command": "npx",
      "args": ["-y", "wu-weather-mcp"],
      "env": {
        "WU_API_KEY": "your_api_key_here",
        "WU_STATION_ID": "your_station_id_here"
      }
    }
  }
}

注意: 在发布之前,请先检查 npmjs.com 以确认包名 wu-weather-mcp 是否可用。

许可证

MIT

Available Tools

4 tools
get_current_conditionsA

Get current weather conditions from the KCALAKEF92 personal weather station (KCALAKEF92) in Lake Forest, CA. Returns temperature, humidity, wind, pressure, precipitation rate, UV index, dew point, and solar radiation.

Inputs: no named parameters.

get_daily_summaryA

Get daily high/low/avg temperature, total precipitation, and max wind gust for up to the last 7 days from KCALAKEF92 (KCALAKEF92).

Inputs: days.

get_hourly_historyA

Get hour-by-hour weather history for up to the last 24 hours from KCALAKEF92 (KCALAKEF92). Includes temperature, humidity, wind, and precipitation.

Inputs: hours.

get_station_infoA

Get metadata for the KCALAKEF92 weather station: name, ID, neighborhood, country, GPS coordinates, and elevation.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool targets a distinct aspect of weather data: current conditions, daily summary, hourly history, and station metadata. No overlap in purpose.

    Naming Consistency5/5

    All tool names follow a consistent 'get_' prefix followed by a clear noun phrase, maintaining snake_case throughout.

    Tool Count5/5

    4 tools is appropriate for a personal weather station MCP server, covering the core data retrieval needs without unnecessary bloat.

    Completeness4/5

    The set covers current conditions, daily summaries, hourly history, and station info. Missing features like alerts or forecast are reasonable gaps for a station-focused server.

    Related MCP Connectors

    Related MCP Servers