Weather MCP Server

Weather MCP Server

By asifdotpy GitHub

-

weather MCP
Overview

what is MCP-Weather-Server?

MCP-Weather-Server is a server that provides access to US weather data from the National Weather Service (NWS) API, allowing users to fetch weather alerts and forecasts for various locations across the United States.

how to use MCP-Weather-Server?

To use the server, clone the repository, install the required dependencies, and run the server. You can then use the provided functions to get weather alerts and forecasts by state or geographical coordinates.

key features of MCP-Weather-Server?

  • Fetch weather alerts for any US state using two-letter state codes.
  • Retrieve detailed weather forecasts based on latitude and longitude.
  • Structured logging with contextual information for better debugging.
  • Error handling and timeout management for robust performance.

use cases of MCP-Weather-Server?

  1. Monitoring weather conditions and alerts for specific states.
  2. Integrating weather data into applications for real-time updates.
  3. Providing weather forecasts for planning events or travel.

FAQ from MCP-Weather-Server?

  • What programming language is used for MCP-Weather-Server?

The server is built using Python.

  • How can I run the server?

You can run the server by executing python weather.py after setting up the environment.

  • Is there any license for this project?

The license details should be specified in the repository.

Content

Weather MCP Server

Overview

This repository contains an MCP (Model Context Protocol) server for accessing US weather data from the National Weather Service (NWS) API. The server provides tools to fetch weather alerts and forecasts for locations across the United States.

Features

  • Get weather alerts for any US state using two-letter state codes
  • Retrieve detailed weather forecasts by latitude and longitude
  • Structured logging with contextual information
  • Error handling and timeout management

Installation

# Clone the repository
git clone <repository-url>

# Navigate to the directory
cd weather

# Install dependencies (requires Python 3.11+)
pip install -e .

Dependencies

  • httpx: For making asynchronous HTTP requests
  • mcp: Model Context Protocol library for building MCP servers

Usage

The server provides two main tools:

Get Weather Alerts

get_alerts(state: str) -> str
  • state: Two-letter US state code (e.g., CA, NY)
  • Returns formatted weather alerts for the specified state

Get Weather Forecast

get_forecast(latitude: float, longitude: float) -> str
  • latitude: Latitude of the location
  • longitude: Longitude of the location
  • Returns a 5-period weather forecast for the specified coordinates

Running the Server

python weather.py

The server runs over stdio, making it compatible with MCP clients.

Development

  • Set the ENV environment variable to "production" for JSON-formatted logs
  • Configure logging level with the LOG_LEVEL environment variable

License

[Specify your license here]

No tools information available.
School MCP
School MCP by 54yyyu

A Model Context Protocol (MCP) server for academic tools, integrating with Canvas and Gradescope platforms.

canvas mcp
View Details
repo-template
repo-template by loonghao

A Model Context Protocol (MCP) server for Python package intelligence, providing structured queries for PyPI packages and GitHub repositories. Features include dependency analysis, version tracking, and package metadata retrieval for LLM interactions.

-

google-calendar mcp
View Details
strava-mcp
strava-mcp by jeremysilva1098

MCP server for strava

strava mcp
View Details

Model Context Protocol (MCP) server implementation for Rhinoceros/Grasshopper integration, enabling AI models to interact with parametric design tools

grasshopper mcp
View Details

MCP configuration to connect AI agent to a Linux machine.

security mcp
View Details

AI assistant built with Streamlit, NVIDIA NIM (LLaMa 3.3:70B) / Ollama, and Model Control Protocol (MCP).

python mcp
View Details