A quickstart repo for building a simple MCP weather server that exposes two tools—`get-alerts` and `get-forecast`—to fetch live National Weather Service alerts and forecasts, with step-by-step setup and configuration to plug into Claude for Desktop (or any other MCP client).
A Model Context Protocol (MCP) server that provides weather information using the National Weather Service API. This server exposes tools for getting weather forecasts and alerts for US locations.
get-forecastGet weather forecast for a specific location.
Parameters:
latitude (float): Latitude of the location (-90 to 90)longitude (float): Longitude of the location (-180 to 180)Example usage:
get-alertsGet active weather alerts for a US state.
Parameters:
state (string): Two-letter US state code (e.g., "CA", "NY", "TX")Example usage:
uv package manager# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"cd weatheruv syncTo test the server directly:
uv run weather.pyThe server will start and listen on standard input/output. You can test it using the MCP inspector or other MCP clients.
code ~/Library/Application\ Support/Claude/claude_desktop_config.jsonWindows:code $env:AppData\Claude\claude_desktop_config.json{
"mcpServers": {
"weather": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/YOUR/weather",
"run",
"weather.py"
]
}
}
}Windows:{
"mcpServers": {
"weather": {
"command": "uv",
"args": [
"--directory",
"C:\\ABSOLUTE\\PATH\\TO\\YOUR\\weather",
"run",
"weather.py"
]
}
}
}Once configured with Claude for Desktop, you can ask questions like:
This server uses the National Weather Service API (api.weather.gov), which:
weather/
├── main.py # Entry point (if needed)
├── weather.py # Main MCP server implementation
├── pyproject.toml # Project configuration and dependencies
├── uv.lock # Dependency lock file
└── README.md # This file# macOS/Linux
tail -f ~/Library/Logs/Claude/mcp*.log
# Windows
# Check logs in %AppData%\Claude\logs\uv run weather.pyTo add new weather-related tools:
@mcp.tool() decoratoruv run weather.pyKey dependencies (managed by uv):
mcp: Model Context Protocol SDKhttpx: HTTP client for API requestsfastmcp: Simplified MCP server frameworkThis project is part of the Model Context Protocol ecosystem. Check individual dependencies for their licenses.
Feel free to submit issues and pull requests to improve the weather server functionality.
nitvob/nws-mcp-server
July 5, 2025
April 13, 2026
Python