使用说明
MCP Weather Server 🌤️
A simple Model Context Protocol (MCP) server that provides weather alerts and forecasts using the National Weather Service (NWS) API.
Tools
get_alerts(state): Get weather alerts for a US state.get_forecast(latitude, longitude): Get weather forecast for a specific location.
Setup
-
Create a virtual environment:
python3 -m venv .venv source .venv/bin/activate -
Install dependencies:
pip install -r requirements.txt -
Run the server:
python weather.py
Configuration (Claude for Desktop)
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"weather": {
"command": "/absolute/path/to/weather/.venv/bin/python",
"args": ["/absolute/path/to/weather/weather.py"]
}
}
}