Content
# 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`