{
  "markdown": "<div align=\"center\">\n  <h1>@cyanheads/nws-weather-mcp-server</h1>\n  <p><b>Get US weather forecasts, active alerts, and current observations via the National Weather Service API. STDIO or Streamable HTTP.</b>\n  <div>7 Tools • 1 Resource</div>\n  </p>\n</div>\n\n<div align=\"center\">\n\n[![Version](https://img.shields.io/badge/Version-0.9.2-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/nws-weather-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.0.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/nws-weather-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/nws-weather-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3+-blueviolet.svg?style=flat-square)](https://bun.sh/)\n\n</div>\n\n<div align=\"center\">\n\n[![Install in Claude Desktop](https://img.shields.io/badge/Install_in-Claude_Desktop-D97757?style=for-the-badge&logo=anthropic&logoColor=white)](https://github.com/cyanheads/nws-weather-mcp-server/releases/latest/download/nws-weather-mcp-server.mcpb) [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=nws-weather-mcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjeWFuaGVhZHMvbndzLXdlYXRoZXItbWNwLXNlcnZlciJdfQ==) [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode:mcp/install?%7B%22name%22%3A%22nws-weather-mcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cyanheads/nws-weather-mcp-server%22%5D%7D)\n\n[![Framework](https://img.shields.io/badge/Built%20on-@cyanheads/mcp--ts--core-67E8F9?style=flat-square)](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)\n\n</div>\n\n<div align=\"center\">\n\n**Public Hosted Server:** [https://nws.caseyjhand.com/mcp](https://nws.caseyjhand.com/mcp)\n\n</div>\n\n---\n\n## Tools\n\nSeven tools for real-time US weather data:\n\n| Tool | Description |\n|:----------|:------------|\n| `nws_get_forecast` | 7-day or hourly forecast for coordinates. Resolves NWS grid internally. |\n| `nws_search_alerts` | Active weather alerts filtered by area, point, zone, event, severity, urgency, certainty, and status. |\n| `nws_get_observations` | Current conditions by coordinates (nearest station) or station ID. |\n| `nws_find_stations` | Nearby observation stations sorted by distance with bearing. |\n| `nws_list_alert_types` | All valid alert event type names for filter discovery. |\n| `nws_get_office_discussion` | Latest narrative product (AFD, HWO, ZFP, SPS) from a Weather Forecast Office. |\n| `nws_get_zone_forecast` | Text forecast periods for a public NWS forecast zone. |\n\n### `nws_get_forecast`\n\nGet the weather forecast for a US location.\n\n- Default returns named 12-hour periods (14 total, ~7 days)\n- Hourly mode returns 48 one-hour periods per page with dewpoint and humidity — the upstream feed carries ~156, and the pre-page total (`totalCount`, against this page's `shown`) plus a truncation notice are surfaced in the enrichment block\n- Pass the returned `nextCursor` back as `cursor` to reach the remaining periods; it is omitted on the last page\n- Coordinates resolve to NWS grid internally via `/points` endpoint\n- Formatted timestamps use the resolved local time zone\n- Returns forecast zone and county zone codes for chaining into `nws_search_alerts`\n\n---\n\n### `nws_search_alerts`\n\nSearch active weather alerts with flexible filtering.\n\n- Filter by area (state/territory/marine codes), point (lat,lon), zone, land/marine `region_type`, marine `region` groups, event type, severity, urgency, certainty, or status\n- `area`, `point`, `zone`, `region_type`, and `region` are mutually exclusive; specify at most one location filter\n- National search when no filters provided\n- A filter provided with no usable value — a blank `area`/`point`/`zone`, or an empty `event`/`severity`/`urgency`/`certainty`/`region` array — is rejected rather than dropped, so a search never silently widens to national results\n- Each `affectedZones` entry carries its NWS zone `type` (`forecast`, `county`, or `fire`) alongside the `code`, so callers can tell which codes chain into `nws_get_zone_forecast`\n- Alerts include the CAP message lifecycle — `sent`, `effective`, `status`, `messageType`, and the prior messages an update `references` — distinct from the hazard's own `onset`/`ends`\n- Event matching is case-insensitive and partial, so `\"tornado\"` matches both watches and warnings\n- `status` defaults to live `Actual` alerts, but can be set to `Exercise`, `System`, `Test`, or `Draft`\n- Optional `limit` (1–25, default 25) sizes the page; `totalCount` reports the full match count and `shown` the size of this page, with a truncation notice and guidance to narrow filters\n- Alerts NWS repeats verbatim within one fetch are collapsed on `id`, so `totalCount` counts distinct alerts and a duplicate never straddles a page boundary\n- Pass the returned `nextCursor` back as `cursor` to reach matches beyond the page. Consecutive pages are contiguous within one response only — every call re-fetches `/alerts/active`, and that set changes continuously as alerts are issued and expire\n- Validates area, point, and zone locally before the API call — malformed values fail fast as `invalid_area_code`, `invalid_point`, or `invalid_zone` instead of leaking a raw upstream 400\n\n---\n\n### `nws_get_observations`\n\nCurrent measured conditions from a weather station.\n\n- Look up by coordinates (finds nearest station) or station ID directly\n- A blank or whitespace-only `station_id` is rejected rather than dropped, so coordinates never silently answer for a station that was asked for by name\n- Coordinate lookups choose the nearest station from the candidates returned by NWS\n- Dual-unit display: F/C, mph/km/h, inHg/hPa, mi/km\n- Observation timestamps use the station's local time zone when available\n- Warns when most measurements are unavailable from a station\n\n---\n\n### `nws_find_stations`\n\nDiscover nearby observation stations.\n\n- Sorted by haversine distance from query point\n- Returns distance (km) and compass bearing\n- Includes zone codes, elevation, time zone\n- Optional `limit` (1–50, default 10) sizes the page; `totalCount` reports every station near the point and holds steady across pages, while `shown` is the size of this page\n- Pass the returned `nextCursor` back as `cursor` to reach stations beyond the page; it is omitted on the last page\n- Useful for finding station IDs for `nws_get_observations`\n\n---\n\n### `nws_list_alert_types`\n\nList all valid NWS alert event type names.\n\n- Returns the full set of event types the NWS API recognizes (e.g., \"Tornado Warning\", \"Heat Advisory\")\n- Use to discover valid values for the `event` filter in `nws_search_alerts`\n\n---\n\n### `nws_get_office_discussion`\n\nGet the latest narrative product from a Weather Forecast Office (WFO).\n\n- `office`: 3-letter WFO code (e.g., `SEW` for Seattle) — returned as the `office` field by `nws_get_forecast`\n- `product_type`: `AFD` (Area Forecast Discussion, default), `HWO` (Hazardous Weather Outlook), `ZFP` (Zone Forecast Product), `SPS` (Special Weather Statement)\n- Two-hop fetch: lists products by office/type (newest first), then retrieves full product text\n- Returns `productText` plus `issuanceTime`, `issuingOffice`, `productName`, `productCode`, `wmoCollectiveId`\n- Unknown office returns a clear error with recovery instructions (the NWS API returns HTTP 200 with an empty list, not a 404)\n\n---\n\n### `nws_get_zone_forecast`\n\nGet the text forecast for a public NWS forecast zone.\n\n- `zone_id`: forecast zone code (e.g., `WAZ315`) — returned by `nws_get_forecast` (`forecastZone`), `nws_find_stations` (`forecastZone` column), and `nws_search_alerts` (the `code` of an `affectedZones` entry with `type: \"forecast\"`)\n- Returns named periods (e.g., \"Today\", \"Tonight\", \"Monday\") with narrative text from local forecasters\n- Completes the alert-to-forecast chain: look up alert zones, then retrieve zone forecasts\n- County (`XXC###`) and fire zone codes are not supported here — NWS publishes no text forecast for them. They remain valid values for the `zone` filter on `nws_search_alerts`\n\n## Resources\n\n| URI Pattern | Description |\n|:------------|:------------|\n| `nws://alert-types` | Static list of all valid NWS alert event type names. |\n\n## Features\n\nBuilt on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core):\n\n- Declarative tool definitions — single file per tool, framework handles registration and validation\n- Unified error handling across all tools\n- Pluggable auth (`none`, `jwt`, `oauth`)\n- Swappable storage backends: `in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2/D1`\n- Structured logging with optional OpenTelemetry tracing\n- Runs locally (stdio/HTTP) or on Cloudflare Workers from the same codebase\n\nNWS-specific:\n\n- Zero-auth access to the NWS API — no API keys required\n- Automatic coordinate-to-grid resolution with caching (1h TTL)\n- Request timeouts plus retry/backoff for transient NWS API failures\n- Dual-unit display for observations (F/C, mph/km/h, inHg/hPa, mi/km)\n- Continental US, Alaska, Hawaii, and US territories coverage\n\n## Getting started\n\n### Public Hosted Instance\n\nA public instance is available at `https://nws.caseyjhand.com/mcp` — no installation required. Point any MCP client at it via Streamable HTTP:\n\n```json\n{\n  \"mcpServers\": {\n    \"nws-weather-mcp-server\": {\n      \"type\": \"streamable-http\",\n      \"url\": \"https://nws.caseyjhand.com/mcp\"\n    }\n  }\n}\n```\n\n### Self-Hosted / Local\n\nAdd the following to your MCP client configuration file.\n\n```json\n{\n  \"mcpServers\": {\n    \"nws-weather-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"bunx\",\n      \"args\": [\"@cyanheads/nws-weather-mcp-server@latest\"],\n      \"env\": {\n        \"MCP_TRANSPORT_TYPE\": \"stdio\",\n        \"MCP_LOG_LEVEL\": \"info\"\n      }\n    }\n  }\n}\n```\n\nOr with npx (no Bun required):\n\n```json\n{\n  \"mcpServers\": {\n    \"nws-weather-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@cyanheads/nws-weather-mcp-server@latest\"],\n      \"env\": {\n        \"MCP_TRANSPORT_TYPE\": \"stdio\",\n        \"MCP_LOG_LEVEL\": \"info\"\n      }\n    }\n  }\n}\n```\n\nOr with Docker:\n\n```json\n{\n  \"mcpServers\": {\n    \"nws-weather-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"docker\",\n      \"args\": [\"run\", \"-i\", \"--rm\", \"-e\", \"MCP_TRANSPORT_TYPE=stdio\", \"ghcr.io/cyanheads/nws-weather-mcp-server:latest\"]\n    }\n  }\n}\n```\n\nFor Streamable HTTP, set the transport and start the server:\n\n```sh\nMCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http\n# Server listens at http://localhost:3010/mcp\n```\n\n### Prerequisites\n\n- [Node.js v24+](https://nodejs.org/) or [Bun v1.3+](https://bun.sh/)\n\n### Installation\n\n1. **Clone the repository:**\n\n```sh\ngit clone https://github.com/cyanheads/nws-weather-mcp-server.git\n```\n\n2. **Navigate into the directory:**\n\n```sh\ncd nws-weather-mcp-server\n```\n\n3. **Install dependencies:**\n\n```sh\nbun install\n```\n\n## Configuration\n\n| Variable | Description | Default |\n|:---------|:------------|:--------|\n| `NWS_USER_AGENT` | User-Agent for NWS API requests. The API requires this header. | `(nws-weather-mcp-server, ...)` |\n| `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |\n| `MCP_HTTP_PORT` | Port for HTTP server. | `3010` |\n| `MCP_HTTP_HOST` | Hostname for HTTP server. | `127.0.0.1` |\n| `MCP_SESSION_MODE` | HTTP session mode: `stateful`, `stateless`, or `auto`. | `stateless` |\n| `MCP_LOG_LEVEL` | Log level: `debug`, `info`, `notice`, `warning`, `error`. | `info` |\n\nSee [`.env.example`](.env.example) for the full list including auth, storage, and OpenTelemetry options.\n\n## Running the server\n\n### Local development\n\n- **Build and run the production version:**\n\n  ```sh\n  # One-time build\n  bun run rebuild\n\n  # Run the built server\n  bun run start:http\n  # or\n  bun run start:stdio\n  ```\n\n- **Run checks and tests:**\n\n  ```sh\n  bun run devcheck     # Lints, formats, type-checks\n  bun run test         # Runs test suite\n  ```\n\n## Project structure\n\n| Directory | Purpose |\n|:----------|:--------|\n| `src/mcp-server/tools/definitions/` | Tool definitions (`*.tool.ts`). |\n| `src/mcp-server/resources/definitions/` | Resource definitions (`*.resource.ts`). |\n| `src/services/nws/` | NWS API client and response types. |\n| `src/config/` | Environment variable parsing and validation with Zod. |\n\n## Development guide\n\nSee [`CLAUDE.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:\n\n- Handlers throw, framework catches — no `try/catch` in tool logic\n- Use `ctx.log` for domain-specific logging, `ctx.state` for storage\n- Add new tools/resources to the barrel exports and the `createApp()` arrays in `src/index.ts`\n\n## Contributing\n\nIssues and pull requests are welcome. Run checks before submitting:\n\n```sh\nbun run devcheck\nbun run test\n```\n\n## License\n\nApache-2.0 — see [LICENSE](LICENSE) for details.\n",
  "bytes": 13423,
  "sha": "d324448232b0035772139d9d01ee45282c027e0a213770c8c734c3d55958d2ba",
  "repo_slug": "cyanheads/nws-weather-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_cyanheads_nws_weather_mcp_serv_24a1e6a5/readme"
}