Skip to main content
Glama
tumuml28

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).

ParametersJSON Schema
NameRequiredDescriptionDefault
stateYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It's a read-only query tool, and the description does communicate this is a retrieval operation ('Get active... alerts'). However, it doesn't disclose what NWS data is included, whether alerts are current-hour only, response format, or any rate-limit considerations. Adequate but minimal behavioral disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two lines with a docstring-style format including an Args section. Every sentence earns its place: purpose statement plus parameter explanation with examples. No wasted words. The formatting is clean and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter read tool with an output schema present, this description is reasonably complete. The state param is documented with examples, the purpose is clear, and output schema handles return values. Slight gap: no mention of what alert types/categories are returned or how to handle states without active alerts, but these are minor for a simple tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, so the description must compensate. It does explain the 'state' parameter as 'Two-letter US state code (e.g. CA, NY, TX)', which adds format and examples beyond the schema's bare 'State' title. However, 'state' is a simple self-explanatory single param, so the added value is modest.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb (Get) + resource (active National Weather Service alerts) + scope (for a US state). It distinguishes from the sibling tool get_forecast since it specifies alerts rather than forecast data. Could improve by explicitly contrasting with get_forecast.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage via 'active' alerts for a US state, but doesn't explicitly state when to use this versus get_forecast. It also doesn't mention any prerequisites, limitations, or what 'active' means (excludes expired/historical alerts). Basic context present, but no alternatives or exclusions named.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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).

ParametersJSON Schema
NameRequiredDescriptionDefault
latitudeYes
longitudeYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It does not state return format, caching behavior, error conditions (e.g., non-US coordinates), whether it's a read-only operation, rate limits, or what the output structure looks like. For a tool with zero annotation coverage, this is a notable gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Highly concise with zero wasted words. The description is two short lines plus two parameter examples. Every sentence earns its place, and it is appropriately front-loaded with the core purpose first.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has an output schema which reduces the need to explain return values, and only 2 parameters with good examples. However, for a tool with no annotations, the description still omits important behavioral context like error handling for invalid coordinates, whether lat/long are validated to US bounds, and any rate limit or API dependency caveats. Adequate for a simple tool but with real gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description does add modest value by giving example values for both parameters (40.7128 for NYC, -74.0060 for NYC), illustrating the decimal degrees format and expected range. However, it doesn't add constraints like valid ranges, coordinate systems (WGS84 assumption), or relationship between the two params beyond what's obvious from the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states what the tool does with a specific verb+resource: 'Get a National Weather Service forecast for a US latitude/longitude.' This is clear and specific. However, it does not differentiate from the sibling tool get_alerts, though the tools are clearly distinct enough (forecast vs alerts) that context suggests the distinction is obvious.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context (US lat/long coordinates for NWS forecasts) but provides no explicit guidance on when to use this versus get_alerts, nor any exclusions or prerequisites. The geographic scoping ('US') is useful but the tool name itself carries much of the usage implication.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updatesv0.1.0
    • First observedget_alerts
    • First observedget_forecast

TDQS

B3.4/5.0
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

ActivitySlowing
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tumuml28/McpWeatherSample'

If you have feedback or need assistance with the MCP directory API, please join our Discord server