arjones/weather-mcp
If you are the rightful owner of weather-mcp 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 data using the National Weather Service (NWS) API, offering comprehensive weather alerts and forecasts across the United States.
get_alerts
Get weather alerts for a US state.
get_forecast
Get weather forecast for specific coordinates.
Weather MCP Server
A Model Context Protocol (MCP) server that provides weather data using the National Weather Service (NWS) API. Source MCP / For Server Developers / Quickstart
Features
- Weather Alerts: Get active weather alerts for any US state
- Weather Forecast: Get detailed weather forecasts for specific coordinates
- US Coverage: Full coverage of United States territories
Project Structure
src/
āāā index.ts # MCP server configuration and main entry point
āāā types.ts # TypeScript interfaces and type definitions
āāā api.ts # NWS API client and request handling
āāā forecast.ts # Business logic for alerts and forecast processing
Architecture Overview
index.ts
: MCP server setup, tool registrations, and main functiontypes.ts
: All TypeScript interfaces (AlertFeature
,ForecastPeriod
, etc.)api.ts
: HTTP client for NWS API with error handlingforecast.ts
: Core business logic for formatting and processing weather data
Setup
-
Install dependencies:
npm install
-
Build the project:
npm run build
Available Tools
get_alerts
Get weather alerts for a US state.
Parameters:
state
(string): Two-letter state code (e.g., "CA", "NY")
Example:
{
"state": "CA"
}
get_forecast
Get weather forecast for specific coordinates.
Parameters:
latitude
(number): Latitude (-90 to 90)longitude
(number): Longitude (-180 to 180)
Example:
{
"latitude": 37.7749,
"longitude": -122.4194
}
Debugging with MCP Inspector
The MCP Inspector is a powerful tool for debugging and testing MCP servers.
Installation
Use it directly with npx:
npx @modelcontextprotocol/inspector node build/index.js
Usage
Connect to your server:
- Server type:
stdio
- Command:
node
- Arguments:
build/index.js
- Click Connect