Includes a comprehensive test suite built with pytest, featuring 53 tests with 100% coverage.
Developed for Python 3.13+, the server provides a Python-based implementation for accessing National Weather Service data.
Uses Ruff for code formatting and style enforcement to maintain code quality standards.
Uses Shields.io badges to display test status, coverage metrics, and other project health indicators.
Features a Streamlit-based web UI for easy interaction with weather data, accessible through a local web interface.
Weather MCP Project
A Model Context Protocol (MCP) server that provides real-time weather alerts and forecasts from the US National Weather Service. Built with modern Python practices, comprehensive testing, and production-ready deployment.
Features
- Weather Alerts - Real-time alerts from the National Weather Service
- Weather Forecasts - Detailed forecasts for any US location
- Web Interface - Beautiful Streamlit UI for easy interaction
- MCP Protocol - Standards-compliant Model Context Protocol server
- Async/Await - High-performance asynchronous architecture
- 100% Test Coverage - Comprehensive test suite with 53 tests
- Type Safe - Full MyPy type checking compliance
- Production Ready - Deployed and operational
Quick Start
Prerequisites
- Python 3.13
1. Clone and Install
2. Run the Web Interface
Open your browser to http://localhost:8501
and start exploring weather data!
3. Run the MCP Server
The MCP server will start on http://localhost:8000
with SSE transport.
Installation
Using pip
API Reference
Weather Alerts
Get active weather alerts for any US state:
Parameters:
state
(str): Two-letter US state code (e.g., "CA", "TX", "NY")
Returns:
- Formatted string with active alerts or "No active alerts" message
Example:
Weather Forecasts
Get detailed weather forecast for coordinates:
Parameters:
latitude
(float): Latitude coordinatelongitude
(float): Longitude coordinate
Returns:
- Formatted forecast string with 5-day outlook
Example:
MCP Tools
The server exposes two MCP tools:
get_alerts
- Fetch weather alerts by stateget_forecast
- Fetch weather forecast by coordinates
Development
Project Structure
Code Quality
This project maintains high code quality standards:
- 100% Test Coverage - Every line of code is tested
- Type Checking - Full MyPy compliance
- Linting - Ruff for code formatting and style
- Standards - Follows Python best practices
Testing
Run with Coverage
Test Coverage Report
After running tests with coverage, open htmlcov/index.html
in your browser for a detailed coverage report.
Quality Checks
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A Model Context Protocol (MCP) server that provides real-time weather alerts and forecasts from the US National Weather Service.
Related MCP Servers
- -securityFlicense-qualityThis is a Model Context Protocol (MCP) server that provides weather information using the National Weather Service (NWS) API. Features Get weather alerts for a US state Get weather forecast for a specific location (using latitude and longitude)Last updated -Python
- AsecurityAlicenseAqualityA Model Context Protocol server that provides tools to fetch weather alerts for US states and forecasts based on latitude/longitude coordinates using the US National Weather Service API.Last updated -271TypeScriptMIT License
- -securityFlicense-qualityA Model Control Protocol (MCP) based service that allows users to query weather forecasts by coordinates and receive weather alerts for U.S. states.Last updated -4Python
- AsecurityFlicenseAqualityA Model Context Protocol server that provides current weather forecasts for specific locations and active weather alerts for US states.Last updated -2TypeScript