MCP Weather Server
Description
# MCP 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…
About
# MCP 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…
Details
- Author
- SarveshChandak
- Downloads
- 199
- Categories
- Media
Jump to
- Fetches active weather alerts for a given US state.
- Retrieves detailed weather forecasts for a specific latitude/longitude.
- Built on the MCP framework for seamless LLM integration.
- Uses the National Weather Service (NWS) public API data.
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
MCP Weather ServerCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
After cloning the repository and installing dependencies with pip install -r requirements.txt, start the server by running python weather.py or, if server and client are on the same machine, uv run weather.py. The server exposes two tools—get_alerts (requires a two-letter US state code) and get_forecast (requires latitude and longitude)—that can be automatically invoked by an LLM through an MCP client.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"mcp weather server": {
"MCP-Server-Weather-Alerts": {
"command": "python",
"args": [
"weather.py"
]
}
}
}
}
McpServers
{
"MCP-Server-Weather-Alerts": {
"command": "python",
"args": [
"weather.py"
]
}
}
MCP 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
1. Clone the repository:
git clone <repository-url>
2. Navigate to the project directory:
cd MCP Server/weather
3. 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 theget_alerts tool.
Arguments:
- state: Two-letter US state code (e.g., CA for California, NY for New York).
Example:
{
"tool": "get_alerts",
"args": {
"state": "CA"
}
}
2. Get Weather Forecast
Fetch a detailed weather forecast for a specific location using theget_forecast tool.
Arguments:
- latitude: Latitude of the location (e.g., 34.0522 for Los Angeles).
- longitude: Longitude of the location (e.g., -118.2437 for 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.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.
