LeandroBerlin/Weather-MCP-Server
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 provides weather information using the National Weather Service API through the Model Context Protocol.
Weather MCP Server
A simple Model Context Protocol (MCP) server that provides weather information through the National Weather Service API (https://api.weather.gov).
What is an MCP?
MCP is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications. Just as USB-C provides a standardized way to connect your devices to various peripherals and accessories, MCP provides a standardized way to connect AI models to different data sources and tools.
To learn & get started with the Model Context Protocol (MCP) wisit the introduction documentation.
This project is based on Model Context Protocol (MCP) quickstart Server for Node.js
Features
- Weather Alerts: Get active weather alerts for a specific US state
- Weather Forecasts: Retrieve detailed weather forecasts for any location in the United States using geographic coordinates.
Technical Details
- Built with TypeScript
- Uses the Model Context Protocol SDK (@modelcontextprotocol/sdk)
- Communicates with the National Weather Service API
- Uses Zod for parameter validation
Requirements
- Node.js
# check your Node.js version
node --version
# check your Node Package Manager version
npm --version
Installation
# Install the package
npm install
# Build the project
npm run build
Usage
The Weather MCP Server is designed to work with MCP clients (eg. Claude for Desktop). It uses stdio for communication, making it easy to integrate with various MCP clients.
This page provides an overview of applications that support the Model Context Protocol (MCP). Each client may support different MCP features, allowing for varying levels of integration with MCP servers.
Running the Server
node build/index.js
Available Tools
Get Weather Alerts
Retrieve active weather alerts for a specific US state.
- Tool ID:
get-alerts
- Parameters:
state
(string): Two-letter state code (e.g., CA, NY)
- Response: A formatted list of active alerts with details including event type, area, severity, and headline information
Get Weather Forecast
Retrieve weather forecasts for a specific geographic location.
- Tool ID:
get-forecast
- Parameters:
latitude
(number): Latitude of the location (-90 to 90)longitude
(number): Longitude of the location (-180 to 180)
- Response: A formatted forecast including temperature, wind information, and forecast descriptions for various time periods
Example Responses
Weather Alerts
Active alerts for CA:
Event: Heat Advisory
Area: Southern California Coastal Areas
Severity: Moderate
Status: Actual
Headline: Heat Advisory issued for Southern California
---
Weather Forecast
Forecast for 37.7749, -122.4194:
This Afternoon:
Temperature: 72°F
Wind: 10 mph W
Partly sunny with a high near 72
---
Tonight:
Temperature: 58°F
Wind: 5 to 10 mph SW
Mostly cloudy with a low around 58
---
License
ISC