Get US weather forecasts, active alerts, and current observations.
Get US weather forecasts, active alerts, and current observations via the National Weather Service API. STDIO or Streamable HTTP.
Public Hosted Server: https://nws.caseyjhand.com/mcp
US weather data from the National Weather Service API (api.weather.gov). Get forecasts, active alerts, current observations, forecast-office narrative products, and zone-level text forecasts for any coordinate in the 50 states, US territories, and adjacent marine areas. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above.
| Tool | Description |
|---|---|
nws_get_forecast | 7-day or hourly forecast for coordinates. Resolves NWS grid internally. |
nws_search_alerts | Active weather alerts filtered by area, point, zone, event, severity, urgency, certainty, and status. |
nws_get_observations | Current conditions by coordinates (nearest station) or station ID. |
nws_find_stations | Nearby observation stations sorted by distance with bearing. |
nws_list_alert_types | All valid alert event type names for filter discovery. |
nws_get_office_discussion | Latest narrative product (AFD, HWO, ZFP, SPS) from a Weather Forecast Office. |
nws_get_zone_forecast | Text forecast periods for a public NWS forecast zone. |
| Resource | Description |
|---|---|
nws://alert-types | Static list of all valid NWS alert event type names. |
Also reachable via the nws_list_alert_types tool, for MCP clients that don't support resources.
nws_get_forecast tooltotalCount, against this page's shown) plus a truncation notice are surfaced in the enrichment blocknextCursor back as cursor to reach the remaining periods; it is omitted on the last page/pointsnws_search_alertsnws_search_alerts toolarea, point, zone, region_type, and region are mutually exclusive location filters (at most one, or none for a national search); event matches case-insensitively and partially ("tornado" matches both watches and warnings); status defaults to Actual (also Exercise, System, Test, Draft)invalid_area_code / invalid_point / invalid_zone reasons instead of a raw upstream 400limit (1-25, default 25) pages results; totalCount is the full distinct-alert count (duplicates collapsed on id) against shown, and nextCursor continues — pages are contiguous only within one response, since every call re-fetches the live feedaffectedZones entry carries its zone type (forecast/county/fire) so callers know which codes chain into nws_get_zone_forecastsent, effective, status, messageType, references) are distinct from the hazard's own onset/endsnws_get_observations toolstation_id directly; a blank/whitespace-only station_id is rejected rather than silently falling back to coordinatesnws_find_stations toollimit (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 pagenextCursor back as cursor to reach stations beyond the page; it is omitted on the last pagenws_get_observationsnws_list_alert_types toolevent filter in nws_search_alertsnws_get_office_discussion tooloffice: 3-letter WFO code (e.g., "SEW" for Seattle) — returned as the office field by nws_get_forecastproduct_type: AFD (default, forecaster reasoning and model analysis), HWO (1-7 day hazard outlook), ZFP (zone-by-zone text forecast), SPS (short-fuse advisory)productText plus issuanceTime, issuingOffice, productName, productCode, wmoCollectiveIdno_products error and recovery guidance — NWS answers HTTP 200 with an empty list rather than a 404nws_get_zone_forecast toolzone_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")XXC###) and fire zone codes are not supported here — NWS publishes no text forecast for them, though they remain valid values for the zone filter on nws_search_alerts; an unsupported or unknown zone fails with a typed zone_not_found errornws://alert-types resourceapplication/jsonnws_list_alert_types for MCP clients that support resources rather than toolsBuilt on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
NWS-specific:
User-Agent header automatically (configurable via NWS_USER_AGENT) — NWS returns 403 without one/points, cached for 1h since grid cells rarely changeAgent-friendly output:
nws_get_office_discussion, nws_get_zone_forecast, and nws_search_alerts without re-deriving themnotice naming the cause and the concrete next step, rather than an empty array or a bare pagetype (forecast/county/fire), CAP status/messageType distinct from hazard onset/ends, and typed error reasons (invalid_area_code, no_products, zone_not_found, …) — callers branch on data, not string parsingformat() renders, so structured and text output agreeA public instance is available at https://nws.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:
{
"mcpServers": {
"nws-weather-mcp-server": {
"type": "streamable-http",
"url": "https://nws.caseyjhand.com/mcp"
}
}
}
Add the following to your MCP client configuration file.
{
"mcpServers": {
"nws-weather-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/nws-weather-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}
Or with npx (no Bun required):
{
"mcpServers": {
"nws-weather-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/nws-weather-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}
Or with Docker:
{
"mcpServers": {
"nws-weather-mcp-server": {
"type": "stdio",
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/nws-weather-mcp-server:latest"]
}
}
}
For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_SESSION_MODE=stateless MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcp
git clone https://github.com/cyanheads/nws-weather-mcp-server.git
cd nws-weather-mcp-server
bun install
| Variable | Description | Default |
|---|---|---|
NWS_USER_AGENT | User-Agent for NWS API requests. The API requires this header. | (nws-weather-mcp-server, ...) |
MCP_TRANSPORT_TYPE | Transport: stdio or http. | stdio |
MCP_HTTP_PORT | Port for HTTP server. | 3010 |
MCP_HTTP_HOST | Hostname for HTTP server. | 127.0.0.1 |
MCP_SESSION_MODE | HTTP session mode: stateful, stateless, or auto. | stateless |
MCP_LOG_LEVEL | Log level: debug, info, notice, warning, error. | info |
See .env.example for the full list including auth, storage, and OpenTelemetry options.
Build and run the production version:
# One-time build
bun run rebuild
# Run the built server
bun run start:http
# or
bun run start:stdio
Run checks and tests:
bun run devcheck # Lints, formats, type-checks
bun run test # Runs test suite
| Directory | Purpose |
|---|---|
src/index.ts | createApp() entry point — registers tools and the resource. |
src/mcp-server/tools/definitions/ | Tool definitions (*.tool.ts). |
src/mcp-server/resources/definitions/ | Resource definitions (*.resource.ts). |
src/services/nws/ | NWS API client and response types. |
src/config/ | Environment variable parsing and validation with Zod. |
tests/ | Unit and integration tests mirroring src/. |
See CLAUDE.md for development guidelines and architectural rules. The short version:
try/catch in tool logicctx.log for domain-specific logging, ctx.state for storagecreateApp() arrays in src/index.tsIssues are welcome. Run checks before submitting:
bun run devcheck
bun run test
Apache-2.0 — see LICENSE for details.
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
npx -y @cyanheads/nws-weather-mcp-serverMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-cyanheads-nws-weather-mcp-server": {
"command": "npx",
"args": [
"-y",
"@cyanheads/nws-weather-mcp-server"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup referenceio.github.cyanheads/nws-weather-mcp-server works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.