Weather Alert & Forecast MCP Tool
A lightweight microservice that fetches weather alerts and forecasts from the National Weather Service API, providing U.S. state-level alerts and location-based forecasts.
README
mcp_AI
🌤️ Weather Alert & Forecast MCP Tool
A lightweight microservice using FastMCP that fetches weather alerts and forecasts from the National Weather Service API. This tool provides U.S. state-level alerts and location-based forecasts.
🚀 Features
- Get Active Alerts: Fetch active weather alerts for any U.S. state using its two-letter abbreviation.
- Get Forecast: Retrieve the upcoming weather forecast for a specific latitude and longitude.
- Asynchronous Requests: Efficient use of
httpxfor non-blocking API calls. - Formatted Output: Readable string output ideal for chatbot integration or quick CLI access.
👷️ Installation
pip install httpx
pip install mcp # Or your local FastMCP package
📦 Usage
Make sure you have Python 3.9+ and mcp installed.
python weather.py
The MCP server will start and listen for commands using the stdio transport.
🧰 Available Tools
get_alerts(state: str)
Fetch active weather alerts for a U.S. state.
Arguments:
state: Two-letter state code (e.g.,CA,TX,NY)
Returns:
A formatted string of current alerts or a message if none are available.
get_forecast(latitude: float, longitude: float)
Fetch a detailed forecast for a specific location.
Arguments:
latitude: Latitude of the location (e.g.,37.7749)longitude: Longitude of the location (e.g.,-122.4194)
Returns:
Up to 5 periods of detailed forecast data (e.g., "Tonight", "Monday").
🧪 Example Output
Alert Example:
Event: Flood Warning
Area: San Joaquin County
Severity: Moderate
Description: Flooding is expected in low-lying areas...
Instructions: Turn around, don’t drown...
Forecast Example:
Tonight:
Temperature: 54°F
Wind: 10 mph NW
Forecast: Clear skies with calm wind.
---
Monday:
Temperature: 68°F
Wind: 5 to 10 mph W
Forecast: Sunny and warm.
📟 License
This project is licensed under the MIT License.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.