MCP Weather Server
by aditi-joshi-usc
A lightweight TypeScript + Node.js server built using the Model Context Protocol (MCP) to provide real-time weather alerts and forecast data. It demonstrates how AI tools can consume external APIs via tool invocation.
Last updated: N/A
What is MCP Weather Server?
The MCP Weather Server is a TypeScript + Node.js server that provides real-time weather alerts and forecast data using the National Weather Service API. It's designed to be integrated with AI tools like Claude Desktop and Cursor via the Model Context Protocol (MCP).
How to use MCP Weather Server?
The server exposes two main endpoints: get-alerts
which returns current weather alerts for a given US state code, and get-forecast
which returns a detailed weather forecast based on geographic coordinates (latitude, longitude). It utilizes the MCP SDK for tool communication.
Key features of MCP Weather Server
Real-time weather alerts
Detailed weather forecasts
MCP integration
NWS API access
Input schema validation using Zod
TypeScript based
Node.js backend
Use cases of MCP Weather Server
Integrating weather data into AI assistants
Providing weather information within code editors
Building weather-aware applications
Displaying weather alerts in a user interface
Automating weather-related tasks
FAQ from MCP Weather Server
What is MCP?
What is MCP?
MCP stands for Model Context Protocol. It's a protocol for AI tools to communicate with external services.
What is the NWS API?
What is the NWS API?
The NWS API is the National Weather Service API, providing access to weather data.
What is Zod?
What is Zod?
Zod is a TypeScript-first schema declaration and validation library.
How do I get weather alerts?
How do I get weather alerts?
Use the get-alerts
endpoint with a US state code (e.g., CA).
How do I get a weather forecast?
How do I get a weather forecast?
Use the get-forecast
endpoint with latitude and longitude coordinates.