Skip to main content
Glama

Weather MCP Server

Weather MCP Server

This project is a Model Context Protocol (MCP) server that provides weather data and alerts using the National Weather Service (NWS) API. It exposes tools for retrieving active weather alerts for a US state and weather forecasts for a given latitude and longitude.

Features

  • Get active weather alerts for any US state

  • Get weather forecast for a specific location (latitude/longitude)

  • MCP server implementation using @modelcontextprotocol/sdk

Usage

Prerequisites

  • Node.js (v18 or higher recommended)

  • npm or yarn

Install dependencies

npm install

Run the server

npm start

API Tools

get_alerts

Get active weather alerts for a US state.

  • Input: state (string, two-letter code, e.g. "CA", "NY")

  • Output: List of active alerts or a message if none are active.

get_forecast

Get weather forecast for a location.

  • Input: latitude (number), longitude (number)

  • Output: Forecast periods for the location.

Project Structure

weather/ ├── src/ │ ├── index.ts # MCP server implementation │ └── helper.ts # Helper functions and types ├── build/ # Compiled JS output ├── package.json # Project metadata and dependencies ├── tsconfig.json # TypeScript configuration

License

MIT

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Provides access to National Weather Service (NWS) data, enabling users to retrieve active weather alerts for US states and weather forecasts for specific geographic coordinates.

  1. Features
    1. Usage
      1. Prerequisites
      2. Install dependencies
      3. Run the server
    2. API Tools
      1. get_alerts
      2. get_forecast
    3. Project Structure
      1. License

        MCP directory API

        We provide all the information about MCP servers via our MCP API.

        curl -X GET 'https://glama.ai/api/mcp/v1/servers/BhavinPatel04/weather-mcp-server'

        If you have feedback or need assistance with the MCP directory API, please join our Discord server