About MCP Weather Server
An MCP server that retrieves US weather alerts and forecasts from the National Weather Service API. It is for clients that need location-specific weather data through tools.
Key features
- 01Fetch active alerts by US state
- 02Get forecasts by latitude and longitude
- 03Uses the National Weather Service API
- 04Supports stdio transport
Use cases
- 01Check active alerts for a US state
- 02Retrieve a forecast for given coordinates
MCP support
Exposes weather-alert and forecast tools to MCP clients, which can invoke them in response to queries.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMCP Weather Server
This project is a weather server built using the MCP (Model Context Protocol) framework. It provides tools to fetch weather alerts and forecasts for specific locations in the United States using the National Weather Service (NWS) API.
Features
- Get Weather Alerts: Retrieve active weather alerts for a specific US state.
- Get Weather Forecast: Fetch detailed weather forecasts for a specific latitude and longitude.
Installation
- Clone the repository:
git clone <repository-url> - Navigate to the project directory:
cd MCP Server/weather - Install dependencies:
pip install -r requirements.txt
Usage
Run the Server
Start the MCP weather server:
python weather.py
If the server and client are on the same machine, use the stdio transport:
uv run weather.py
Tools
1. Get Weather Alerts
Fetch active weather alerts for a US state using the get_alerts tool.
Arguments:
state: Two-letter US state code (e.g.,CAfor California,NYfor New York).
Example:
{
"tool": "get_alerts",
"args": {
"state": "CA"
}
}
2. Get Weather Forecast
Fetch a detailed weather forecast for a specific location using the get_forecast tool.
Arguments:
latitude: Latitude of the location (e.g.,34.0522for Los Angeles).longitude: Longitude of the location (e.g.,-118.2437for Los Angeles).
Example:
{
"tool": "get_forecast",
"args": {
"latitude": 34.0522,
"longitude": -118.2437
}
}
Automatic Invocation by LLM
These tools are designed to be automatically invoked by a Language Model (LLM) through the client whenever required. The client can seamlessly interact with the server to fetch weather alerts or forecasts based on user queries.
Contributing
Feel free to submit issues or pull requests to improve the project.
License
This project is licensed under the MIT License.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.