weather
# mcp-python
A [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server that exposes US weather data — via the [National Weather Service API](https://www.weather.gov/documentation/services-web-api) — as tools, resources, and prompts for MCP-compatible clients like Claude Desktop.
## Features
**Tools**
- `get_alerts(state)` — active weather alerts for a two-letter US state code (e.g. `CA`, `NY`)
- `get_forecast(latitude, longitude)` — forecast for the next 5 periods at a given location
**Resources**
- `weather://states` — list of valid two-letter US state codes
- `weather://alerts/{state}` — alerts for any state, as a readable resource
- Static alert resources for `CA`, `NY`, `TX`, `FL` (so they're attachable from Claude Desktop's picker, which only lists static resources)
**Prompts**
- `weather_briefing(state)` — concise severe weather briefing for a state
- `trip_packing_advice(latitude, longitude)` — packing advice based on the forecast for a location
## Requirements
- Python >= 3.11
- [uv](https://docs.astral.sh/uv/)
## Setup
```bash
uv sync
```
## Running the server
```bash
uv run weather.py
```
The server communicates over stdio, so it's meant to be launched by an MCP client rather than run standalone.
## Using with Claude Desktop
Add to your Claude Desktop config (`claude_desktop_config.json`):
```json
{
"mcpServers": {
"weather": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/mcp-python",
"run",
"weather.py"
]
}
}
}
```
Restart Claude Desktop and the weather tools, resources, and prompts will be available.
## Project structure
- `weather.py` — the MCP server (tools, resources, prompts)
- `main.py` — placeholder entrypoint from the project template
- `pyproject.toml` / `uv.lock` — dependencies, managed with `uv`
TDQS
Scored across 2 tools
The two tools are clearly distinct: get_alerts handles weather alerts for a US state, while get_forecast provides forecasts for specific coordinates. There is no ambiguity about which tool to use for which purpose.
Both tools follow a consistent verb_noun pattern (get_alerts, get_forecast) using the same verb 'get' and snake_case convention. The naming is perfectly consistent.
With only 2 tools for a weather domain, the surface feels very thin. Weather servers typically need additional operations like current conditions, radar, air quality, or reverse geocoding to be genuinely useful.
The domain of weather covers more than alerts and forecasts. There are notable gaps: no current conditions, no historical data, no multi-day/hourly breakdown details, and no reverse geocoding for the coordinate-based forecast.