Weather MCP Server

Weather MCP Server

Provides access to National Weather Service data, enabling users to retrieve real-time weather forecasts for specific coordinates and active weather alerts by US state.

Category
Visit Server

README

Weather MCP Server

A Model Context Protocol (MCP) server that provides weather data tools using the National Weather Service (NWS) API.

Overview

This MCP server exposes two main tools for accessing weather information:

  • get_alerts: Fetch active weather alerts for a US state
  • get_forecast: Retrieve detailed weather forecasts for a specific latitude/longitude

The server is built using FastMCP and communicates over stdio transport, making it compatible with MCP clients like Claude Desktop.

Features

  • šŸŒ¤ļø Real-time weather forecasts from the National Weather Service
  • āš ļø Active weather alerts by state
  • šŸ”„ Async API calls for efficient data retrieval
  • šŸ›”ļø Robust error handling and user-friendly responses
  • šŸ“¦ Easy integration with MCP-compatible clients

Requirements

  • Python 3.11 or higher
  • uv package manager (recommended)

Installation

Using uv (recommended)

# Clone the repository
git clone <repository-url>
cd weather

# Install dependencies
uv sync

# Activate virtual environment
source .venv/bin/activate

Using pip

# Clone the repository
git clone <repository-url>
cd weather

# Create virtual environment
python -m venv .venv
source .venv/bin/activate

# Install dependencies
pip install -e .

Usage

Running the Server

uv run weather.py

Integration with MCP Clients

To use this server with an MCP client like Claude Desktop, add it to your MCP configuration:

{
  "mcpServers": {
    "weather": {
      "command": "uv",
      "args": ["--directory", "/path/to/weather", "run", "weather.py"]
    }
  }
}

Available Tools

get_alerts

Fetch active weather alerts for a US state.

Parameters:

  • state (string): Two-letter US state code (e.g., "CA", "NY")

Example:

get_alerts(state="CA")

get_forecast

Retrieve weather forecast for a specific location.

Parameters:

  • latitude (float): Latitude coordinate
  • longitude (float): Longitude coordinate

Example:

get_forecast(latitude=37.7749, longitude=-122.4194)

API Integration

This server uses the National Weather Service API (api.weather.gov):

  • /alerts/active/area/{state} - Weather alerts by state
  • /points/{lat},{lon} - Forecast grid endpoints
  • Forecast URLs from points response - Detailed forecasts

All API requests include proper User-Agent and Accept headers as required by the NWS API.

Development

Project Structure

weather/
ā”œā”€ā”€ weather.py          # Main MCP server implementation
ā”œā”€ā”€ main.py             # Entry point (placeholder)
ā”œā”€ā”€ config.json         # Configuration file
ā”œā”€ā”€ pyproject.toml      # Project metadata and dependencies
ā”œā”€ā”€ uv.lock            # Locked dependencies
└── README.md          # This file

Adding New Tools

  1. Define an async function in weather.py
  2. Decorate it with @mcp.tool()
  3. Use make_nws_request() for NWS API calls
  4. Return formatted strings, not raw JSON
  5. Handle errors gracefully

Testing

Test the server by:

  1. Running it and providing input via stdin
  2. Integrating with an MCP client
  3. Using MCP CLI tools

Error Handling

  • Network errors return user-friendly error messages
  • No raw exceptions are exposed to clients
  • All responses are formatted strings with clear labels

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

BSD-3-Clause License - see LICENSE file for details

Author

Bryan Kemp (bryan@kempville.com)

Acknowledgments

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured