weather-mcp-server

JunyiYe/weather-mcp-server

3.2

If you are the rightful owner of weather-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Weather MCP Server is a modular, async-enabled server that provides weather alerts and forecast data using the National Weather Service API and FastMCP.

Tools
2
Resources
0
Prompts
0

šŸŒ¦ļø Weather MCP Server

A modular, async-enabled weather server powered by the National Weather Service API and FastMCP. Built using the uv Python toolchain for fast and modern development.


šŸ“¦ Project Overview

This project provides:

  • šŸ”” Weather alerts by U.S. state.
  • šŸŒ¤ļø Forecast data by latitude/longitude.

Built on httpx for async HTTP requests and FastMCP for exposing modular tools via CLI or agent interfaces.


šŸ› ļø Getting Started

🧰 Prerequisites

  • Python ≄ 3.13
  • uv installed (pip install uv)

šŸ§‘ā€šŸ’» Setup

# Create and enter the project directory
uv init weather
mv weather weather-mcp-server
cd weather-mcp-server

# Create virtual environment and activate it
uv venv
.venv\Scripts\activate  # On Windows
# or
source .venv/bin/activate  # On Unix

# Add dependencies
uv add mcp[cli] httpx

# Create your server file
touch weather.py  # or use new-item on PowerShell

šŸš€ Usage

Run the MCP server

python weather.py

Available Tools

šŸ”¹ Get Active Weather Alerts
mcp run weather get_alerts --state TX
šŸ”¹ Get Forecast for Coordinates
mcp run weather get_forecast --latitude 34.05 --longitude -118.25

Returns next 5 periods of weather forecast for Los Angeles, CA.


šŸ“ Project Structure

weather-mcp-server/
ā”œā”€ā”€ .venv/                 # Virtual environment (created by uv venv)
ā”œā”€ā”€ pyproject.toml         # Project config and dependencies
ā”œā”€ā”€ weather.py             # MCP server with tools
└── README.md              # Project documentation

āš™ļø Tools Used

  • FastMCP — Modular Command Platform framework
  • httpx — Async HTTP client
  • uv — Fast, modern Python packaging and workflow

šŸ“„ License

This project is licensed under the MIT License. See for details.