A basic Model Communication Protocol (MCP) server that exposes weather data and alerts using the US National Weather Service (NWS) API. This server is compatible with clients like Claude for Desktop, allowing natural language interaction with real-time weather tools.
This project follows the official Anthropic MCP Quickstart Guide.
- π
get_alerts(state: str)β Fetches weather alerts for a U.S. state. - π
get_forecast(latitude: float, longitude: float)β Returns detailed weather forecast for a given location. - βοΈ Powered by
FastMCPfrom themcpSDK. - π§© Easily integrates with Claude for Desktop or other MCP-compatible clients.
- Python 3.10 or higher
- MCP SDK version 1.2.0 or higher
uv(for dependency management)
# 1. Install uv (Mac/Linux)
curl -LsSf https://astral.sh/uv/install.sh | sh
# 2. Create a new project directory
uv init weather
cd weather
# 3. Create virtual environment and activate it
uv venv
source .venv/bin/activate
# 4. Install dependencies
uv add "mcp[cli]" httpx
# 5. Create server script
touch weather.py