home / mcp / weather mcp server
Provides weather alerts and forecasts by querying the National Weather Service (NWS) API for MCP-powered clients.
Configuration
View docs{
"mcpServers": {
"jackkuo666-weather-mcp-server": {
"command": "python",
"args": [
"weather.py"
],
"env": {
"LOG_LEVEL": "INFO",
"LOG_FORMAT": "%(levelname)s %(asctime)s %(message)s",
"USER_AGENT": "Weather-MCP-Client/1.0",
"NWS_API_BASE": "https://api.weather.gov/",
"REQUEST_TIMEOUT": "30"
}
}
}
}This Weather MCP Server provides weather data by querying the National Weather Service API. It exposes two practical actions you can use from any MCP client: receive weather alerts for any US state and fetch a forecast for a precise location given latitude and longitude. Use it to integrate current weather information into your workflows, apps, or automation pipelines.
To access weather data from your MCP client, call the Weather MCP Server tools you have installed in your environment. Two core tools are available: get_alerts and get_forecast.
Prerequisites you need before installing this server:
.venv\Scripts\activateInstall required packages using the MCP CLI tool. Run this command to add the httpx dependency under the mcp group (this enables the client side tools to communicate with the server):
uv add "mcp[cli]" httpxStart the Weather MCP Server in standalone mode after your virtual environment is activated.
source .venv/bin/activate # On Windows, use `.venv\Scripts\activate`
python weather.pyTune server behavior by editing the configuration file config.py. Key settings include the base URL for the National Weather Service API, the User-Agent header, logging level and format, and the API request timeout.
Once the server is running, you can invoke the two available actions from your MCP client.
If an API request fails, the server logs the error and returns a meaningful message to your client. Logs reflect the configured level and format.
You can test the tools through your MCP client by calling get_alerts and get_forecast and inspecting the returned data.
Get weather alerts for a US state. Provide the two-letter state code (e.g., CA) to receive active alerts for that state.
Get a weather forecast for a specific location by providing latitude and longitude.