Skip to main content
Glama
NWS Weather MCP Sample

NWS Weather MCP Sample

by tumuml28

NWS Weather MCP Sample

Python MCP server that pulls forecasts and alerts from the National Weather Service API, plus a small demo CLI client. The same server works with Claude Desktop.

Layout

src/weather_mcp/           # MCP server + NWS helpers
src/weather_mcp_client/    # Demo stdio MCP client
config/                    # Claude Desktop example config

Related MCP server: weather-mcp

Setup

cd C:\Work\Projects\McpWeatherSample
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e .

Demo CLI (no LLM)

Spawns the MCP server over stdio and lets you call tools directly:

weather-mcp-cli
# or: python -m weather_mcp_cli.client

Example session:

weather> tools
weather> forecast 40.7128 -74.0060
weather> alerts NY
weather> quit

Claude Desktop

  1. Install the package into a venv (see Setup).

  2. Copy config/claude_desktop_config.example.json into %APPDATA%\Claude\claude_desktop_config.json.

  3. Confirm the command path points at your venv Python, e.g. C:\\Work\\Projects\\McpWeatherSample\\.venv\\Scripts\\python.exe.

  4. Restart Claude Desktop.

  5. Confirm the nws-weather tools appear (hammer / MCP tools UI).

Example prompts:

  • What's the forecast for 38.89, -77.03?

  • How is the weather in NYC?

  • Any weather alerts in CA?

Tools

Tool

Arguments

Description

get_forecast

latitude, longitude

NWS 7-day / 12-hour periods for a US point

get_alerts

state

Active alerts for a two-letter US state

NWS requires a User-Agent on every request; the server sets one automatically. No API key is required.

Available Tools

2 tools
get_alertsA

Get active National Weather Service alerts for a US state.

Args: state: Two-letter US state code (e.g. CA, NY, TX).

Inputs: state (required). Returns: result

get_forecastB

Get a National Weather Service forecast for a US latitude/longitude.

Args: latitude: Latitude in decimal degrees (e.g. 40.7128 for NYC). longitude: Longitude in decimal degrees (e.g. -74.0060 for NYC).

Inputs: latitude (required), longitude (required). Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools are clearly distinct - one retrieves forecasts by coordinates while the other retrieves alerts by state. There is no overlap in purpose or inputs, so an agent cannot confuse them.

    Naming Consistency4/5

    Both tools follow a consistent get_noun pattern (get_forecast, get_alerts), which is clean and predictable. Minor deviation is that one uses a noun naming forecasts while the other names alerts, but the get_ prefix unifies them.

    Tool Count2/5

    Two tools feels very thin for the NWS weather domain, which normally includes observations, hourly forecasts, marine forecasts, radar, and point metadata. The count is at the low boundary of what's considered reasonable.

    Completeness2/5

    The surface is missing obvious operations like current conditions/observations, hourly forecasts, forecast office information, and marine/hydrological products. An agent needing current weather conditions would dead-end entirely with just forecast and alerts.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers