A Model Context Protocol (MCP) server that provides weather forecast and alert information for US locations. Referenced these docs.
- Weather Forecasts: Get detailed weather forecasts for any location using latitude/longitude coordinates
- Weather Alerts: Retrieve active weather alerts for US states
- Real-time data from the National Weather Service
- Python 3.10 or higher
- Clone this repository:
git clone https://github.com/penguyen72/python-mcp
cd python-mcp
Add the server to your MCP client configuration. For Claude Desktop, add this to your config file:
MacOS:
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows:
code $env:AppData\Claude\claude_desktop_config.json
Config:
{
"mcpServers": {
"weather": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/PARENT/FOLDER/weather",
"run",
"weather.py"
]
}
}
}
Get weather forecast for a specific location.
Parameters:
latitude
(number, required): Latitude of the locationlongitude
(number, required): Longitude of the location
Example:
{
"latitude": 38.5816,
"longitude": -121.4944
}
Get active weather alerts for a US state.
Parameters:
state
(string, required): Two-letter US state code (e.g., "CA", "NY", "TX")
Example:
{
"state": "CA"
}
This server uses the National Weather Service API to retrieve weather data for US locations.