Weather

io.github.Thx93由 GitHub 帳號 Thx93 發布v1.2.1更新於 Oct 26, 2026

US NWS weather alerts and 5-day forecasts for AI agents. $0.01 per call.

已驗證Streamable HTTP可網頁執行位置與生活網頁搜尋與抓取

概覽

AI 產生的概覽

唯讀 MCP 伺服器,讓助理依州別查詢美國國家氣象局的生效警報,並依經緯度取得五期天氣預報。

可以做什麼
  • 依兩位州代碼查詢該州所有生效天氣警報,含事件類型、涵蓋區域、嚴重程度、說明與官方指示
  • 依經緯度取得未來五個預報時段,含時段名稱、氣溫、風速風向與淺白預報文字
  • 在託管端點免費檢查服務健康狀態
  • 回傳結構化物件輸出,氣象局缺少的欄位顯示為 Unknown 而非 null
適用情境
適合助理需要美國即時天氣警報或短期預報時使用,例如回答某州或某座標的天氣與災害狀況。它只是輕量、免金鑰、唯讀的補充,並非通用或全球天氣資料來源。
執行需求
可使用以 streamable HTTP 提供的託管遠端端點,或透過 npx 從 npm 套件在本機執行(需 Node.js 24+ 與 npm)。不需要 API 金鑰、帳號或環境變數。需要能連線至 api.weather.gov。
安裝前請注意
託管端點透過 x402 在 Base 上按每次呼叫收取 0.01 USDC,涉及錢包與付費;自行在本機執行則免費。兩個工具都會向 api.weather.gov 發出請求。僅涵蓋美國,失敗會以工具結果而非協定錯誤回傳。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Weather,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.Thx93%2Fweather/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "weather": {
      "type": "http",
      "url": "https://agent-evidence.thx93.dev/weather/mcp"
    }
  }
}

README

MCP Weather Server — US alerts and forecasts for AI agents

[CI] [M8ven Score] [Listed on mcpservers.org] [MCPRush]

A minimal Model Context Protocol server that exposes US weather data from the National Weather Service API as two read-only tools.

The NWS API is free, keyless and US-only, so this server needs no credentials and no account to run.

ToolInputReturns
get-alertsstate — two-letter code, e.g. CAActive weather alerts for that state
get-forecastlatitude, longitudeThe next five forecast periods for that point

Both tools are annotated readOnlyHint: true and destructiveHint: false, so a host that respects tool annotations can invoke them without asking first. Both reach out to api.weather.gov and are marked openWorldHint: true for that reason.

Use it hosted, paid per call

Running it yourself costs nothing. There is also a hosted version, paid per call in USDC on Base over x402, for agents that would rather not carry a Node process and a data layer:

https://agent-evidence.thx93.dev/weather/mcp

It serves the same two tools, with the same output schemas and the same null fallbacks, plus a free health tool and free tools/list so the service can be discovered and probed before paying. Discovery is free; a tools/call for get-alerts or get-forecast returns 402 with the price. Both are declared read-only, so a host that respects annotations will not ask twice.

The server.json in this repository advertises that remote, so an MCP client can install it by registry name rather than by cloning anything.

Prerequisites

  • Node.js 24+
  • npm

Build, test and run

bash
npm installnpm test          # builds, then runs the suitenpm run build     # compile onlynode build/index.js

The suite drives the real server over InMemoryTransport with the NWS API stubbed, so npm test touches no network and needs no credentials. It covers tool discovery and annotations, the get-alerts and get-forecast data paths, the fallbacks for fields the NWS sends as null, the failure contract, and input validation.

Running node build/index.js speaks the MCP protocol over stdio: it prints to stderr and waits for a client on stdin, so it is meant to be launched by a host rather than by hand.

Adding it to a client

Most MCP hosts use the same three-line shape:

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

Or straight from npm — published 2026-10-19:

bash
npx -y @thx93/mcp-weather-server

Or, equivalently, as a client config entry:

json
{  "mcpServers": {    "weather": { "command": "npx", "args": ["-y", "@thx93/mcp-weather-server"] }  }}

Or straight from the repository, with no registry account needed:

bash
npm install github:Thx93/mcp-weather-server

That path works because prepare builds the server during the install; build/ is not committed, so without it the bin would point at a file that does not exist. It was verified end to end — install from GitHub, then speak MCP to the result, and both tools list with object output schemas.

Verified against the source

The tools return the National Weather Service's own data, so correctness is checkable rather than asserted. On 2026-10-19, api.weather.gov reported one active alert for TX and a paid call to the hosted get-alerts returned exactly one - Event: Flood Advisory - for the same state.

That matters more than it sounds: the sibling evidence service carries a documented reliability gap in its verdict (see its docs/evidence-quality.md), while these tools have no inferred judgement to get wrong. They fetch and reshape; the values are the NWS's.

Behaviour worth knowing

Failures are tool results, not protocol errors. A request the NWS cannot answer — a non-US location, an outage, a timeout — comes back as { isError: true, content: [{ type: "text", text: "<what failed>" }] }. That is the MCP contract for "this call was well formed and the work failed", as distinct from a JSON-RPC error, which means the call itself was broken. A client can show the text to a user and retry.

The NWS is slow to give up and we are not. Every request carries a 10-second timeout, so a stalled upstream surfaces as a failed tool call instead of a hung one.

Missing fields fall back rather than printing null. The NWS returns null for fields it does not have. A missing event name renders as Unknown, a missing temperature as Unknown — never the literal string null.

get-forecast returns at most five periods. Enough to answer "what is the weather like", short enough for a context window.

Structured content

Both tools declare an outputSchema and return structuredContent, and both schemas are objects: get-forecast returns { latitude, longitude, periods }, get-alerts returns { alerts: [...] }.

get-alerts previously declared a top-level array, which protocol revision 2026-07-28 does permit. It was changed because a client on the widely-deployed MCP SDK rejects the entire tools/list response when it meets an array schema — invalid_value: expected "object" — so such a client cannot connect to the server at all. Wrapping the array in an object is what makes these tools reachable from ordinary clients; the textual summary a model reads is unchanged.

FAQ

What is this? An MCP (Model Context Protocol) server that exposes US weather data from the National Weather Service as two read-only tools, get-alerts and get-forecast. It runs over stdio when you install it, and the same code is served over streamable HTTP at https://agent-evidence.thx93.dev/weather/mcp where it is paid per call.

Do I need an API key? No. The National Weather Service API needs no key, and neither the local server nor the hosted endpoint asks for one, for an account, or for a signup.

How much does it cost? Running it yourself is free — it is ISC-licensed and published as @thx93/mcp-weather-server on npm. The hosted endpoint charges 0.01 USDC per call on Base through x402, which is how an agent with a wallet but no ability to sign up for anything can still call it.

Which locations are supported? US only. The data is the National Weather Service's, which covers the United States and its territories. A coordinate outside that coverage returns an error rather than a guess.

What do the tools return? get-alerts takes a two-letter state code and returns every active alert: event, area, severity, description and the official instruction. get-forecast takes a latitude and longitude and returns five forecast periods: name, temperature, wind speed and direction, and the plain-language forecast. Both declare an object output schema.

How do I add it to Claude Desktop, Cursor or another MCP client?

json
{  "mcpServers": {    "weather": { "command": "npx", "args": ["-y", "@thx93/mcp-weather-server"] }  }}

Why does it exist? It began as the MCP "Build a server" tutorial and was extended: typed output schemas, read-only annotations, a bounded fetch, an explicit failure contract and a test suite.

Provenance

Started from the Build an MCP server tutorial and then went past it: typed output schemas, read-only tool annotations, a bounded fetch with an explicit failure contract, and a test suite. Licensed ISC.

來源:README.md,提交 fafa8ad

工具

3

get-alerts

Get Weather Alerts

Get active weather alerts for a US state. Give the two-letter state code (for example CA or NY) and get every active National Weather Service alert for it: the event type, the area it covers, its severity, what is happening, and the official instruction. US locations only. No API key and no account: discovery is free, a call costs $0.01 in USDC on Base via x402, and nothing is charged when the request returns no data. Free tools: health and tools/list.

輸入參數state必填

get-forecast

Get Weather Forecast

Get the weather forecast for a point on the map. Give latitude and longitude and get the next five forecast periods for it: the period name, its temperature, wind speed and direction, and the plain-language forecast. US locations only. No API key and no account: discovery is free, a call costs $0.01 in USDC on Base via x402, and nothing is charged when the request returns no data. Free tools: health and tools/list.

輸入參數latitude必填longitude必填

health

Health

Check that the service is up. Costs nothing.

無需輸入參數。

版本歷史

4
  1. v1.2.1最新Oct 23, 2026
  2. v1.1.3Oct 21, 2026
  3. v1.1.0Oct 18, 2026
  4. v1.0.0Sep 24, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分