Weather Server
This is my first ever mcp server. A ModelContextProtocol compatible weather data server powered by Node.js and TypeScript, using the MCP SDK for standardized data transport.
Installation
npx mcp-weather-serverAsk AI about Weather Server
Powered by Claude Β· Grounded in docs
I know everything about Weather Server. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
MCP Weather Server
This project is a ModelContextProtocol (MCP) compatible weather server that fetches real-time alerts and forecasts from the U.S. National Weather Service (NWS) and exposes them as tools via MCP. It is built with Node.js, TypeScript, and the official @modelcontextprotocol/sdk.
π§ Features
get-alerts: Get active weather alerts for any U.S. state.get-forecast: Get a 7-day weather forecast for a given latitude and longitude in the U.S.- Uses
fetchwith custom headers to communicate with the NWS API. - Runs over standard input/output (STDIO) transport using MCP.
π¦ Installation
git clone https://github.com/JohnnieEmmanuel/mcp-weather-server.git
cd mcp-weather-server
npm install
π Usage
Build the project:
npm run build
Run the server:
node build/index.js
Ensure the MCP consumer you're connecting to is set up to use STDIO transport.
π Tools
π get-alerts
Fetches active alerts for a U.S. state.
Input:
{
"state": "CA"
}
Output (MCP):
- Text block summarizing active alerts.
π¦ get-forecast
Fetches weather forecast for a given latitude and longitude.
Input:
{
"latitude": 37.7749,
"longitude": -122.4194
}
Output (MCP):
- Text block summarizing forecast periods including temperature, wind, and short description.
π§± Tech Stack
- Node.js + TypeScript
- Zod for schema validation
- node-fetch for HTTP requests
- MCP SDK for server integration and transport
π License
MIT License
π§ Credits
Built by John Emmanuel (REDJOHN) using the ModelContextProtocol SDK.
π’ Disclaimer
This server only supports U.S. locations as it uses the api.weather.gov, which is limited to U.S. data.
β¨ Example
> get-alerts { "state": "TX" }
Active alerts for TX:
Event: Excessive Heat Warning
Area: Central Texas
Severity: Severe
Status: Actual
Headline: Dangerously hot conditions expected
---
...
