MCP Weather Server logo

MCP Weather Server

by tyfeng1997

A TypeScript server implementing the Model Context Protocol (MCP) using Server-Sent Events (SSE) to provide weather information. It allows clients to connect over a network and access weather forecast and alert tools.

View on GitHub

Last updated: N/A

What is MCP Weather Server?

This server is a TypeScript implementation of the Model Context Protocol (MCP) that exposes weather forecast and alert tools through Server-Sent Events (SSE) transport. It connects to the US National Weather Service API to provide weather information.

How to use MCP Weather Server?

To use the server, clone the repository, install dependencies, build the TypeScript code, and start the server using node build/index.js. Clients can connect to the SSE endpoint at http://localhost:3001/sse (default port) to access the get-forecast and get-alerts tools.

Key features of MCP Weather Server

  • Implements MCP over SSE transport

  • Provides get-forecast tool for weather forecasts

  • Provides get-alerts tool for active weather alerts in US states

  • Connects to the US National Weather Service API

  • Supports multiple client connections

Use cases of MCP Weather Server

  • Integrating weather information into AI assistants

  • Providing weather data to other applications over a network

  • Building custom weather applications

  • Demonstrating remote MCP communication

FAQ from MCP Weather Server

What is MCP?

MCP stands for Model Context Protocol, a protocol for communication between applications.

What is SSE?

SSE stands for Server-Sent Events, a server push technology enabling real-time data streaming from a server to a client.

How do I change the server port?

Modify the PORT constant in the code to your desired port number.

How do I add more tools?

Follow the pattern used for the existing tools, defining the tool name, description, parameters schema, and implementation logic.

Where can I find a client to connect to this server?

A companion client is available at tyfeng1997/mcp-client.