- Home
- MCP servers
- MCP Weather Alert Agent
MCP Weather Alert Agent
- python
0
GitHub Stars
python
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"mokshadaraibagkar-mcptool": {
"command": "uv",
"args": [
"run",
"mcp",
"dev",
"server/weather.py"
],
"env": {
"GROQ_API_KEY": "YOUR_GROQ_API_KEY"
}
}
}
}You run an MCP Weather Alert Agent that fetches real-time National Weather Service alerts for any U.S. state and exposes them through an MCP-enabled interface. This makes it easy to query weather alerts from your preferred MCP client, automate alert workflows, and integrate weather data into your dashboards or incident response tools.
How to use
To access weather alerts, use an MCP client to interact with the Weather Alert Agent. You can run the local server, test the MCP endpoints, or use the interactive chat interface to request alerts for a specific state.
How to install
Prerequisites you need before installing the Weather Alert Agent are Python 3.8 or newer and a Groq API key for enhanced inference.
Step by step commands to set up and run the agent locally:
# 1) Clone the project
git clone https://example.com/mokshadaraibagkar/mcptool-weather-alert-agent.git
cd mcptool-weather-alert-agent
# 2) Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# 3) Install dependencies
pip install -r requirements.txt
# 4) Configure environment (add your GROQ_API_KEY)
cp .env
# Edit .env and add GROQ_API_KEY=YOUR_GROQ_API_KEY
Configuration and run notes
The agent relies on a Groq API key to access optimized inference capabilities. Store this key in an environment file named ".env" and reference it during startup. The essential environment variable is GROQ_API_KEY.
To run the MCP-enabled server for development and testing, use the MCP dev workflow shown below. This enables an inspector UI for tool testing and debugging.
# Start the interactive client or dev server for MCP testing
uv run server/client.py
# Start the local MCP dev server for weather tool testing
uv run mcp dev server/weather.py
API and tools
The Weather Alert Agent exposes a focused function to fetch alerts for a given state.
get_alerts(state: str) -> str
Fetches active weather alerts for a U.S. state. Use a two-letter state code like "CA", "TX", or "NY". The function returns a formatted string of current alerts or a message indicating no active alerts.
## Available tools
### get\_alerts
Fetches active weather alerts for a given U.S. state code and returns a formatted string with current alerts or a no-alert message.