MCP Weather Server MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add mcp-weather-server-91c3 -- npx -y @dfrho/mcp-weather-server
README.md

Real-time weather forecasts and active weather alerts for US locations.

MCP WEATHER SERVER WRITTEN IN TYPESCRIPT

Protocol Map

This weather MCP server implements the Model Context Protocol (MCP) to provide weather data through a standardized interface. Below is the complete protocol mapping showing how the server communicates with MCP clients.

Server Information

Capabilities

{
  "capabilities": {
    "tools": {
      "listChanged": true
    }
  }
}

Tools

The server exposes two tools for weather data retrieval:

1. `get_alerts`

Retrieves active weather alerts for a US state.

Input Schema:

{
  "type": "object",
  "properties": {
    "state": {
      "type": "string",
      "description": "Two-letter US state code (e.g. CA, NY)",
      "minLength": 2,
      "maxLength": 2
    }
  },
  "required": ["state"]
}

Example Request:

{
  "method": "tools/call",
  "params": {
    "name": "get_alerts",
    "arguments": {
      "state": "CA"
    }
  }
}

Example Response:

{
  "content": [
    {
      "type": "text",
      "text": "Event: Heat Advisory\nArea: Los Angeles County\nSeverity: Moderate\nDescription: Dangerously hot conditions...\nInstructions: Drink plenty of fluids..."
    }
  ]
}

Error Response:

{
  "content": [
    {
      "type": "text",
      "text": "Unable to fetch alerts or no alerts found."
    }
  ]
}

2. `get_forecast`

Retrieves weather forecast for a specific location using latitude and longitude coordinates.

Input Schema:

{
  "type": "object",
  "properties": {
    "latitude": {
      "type": "number",
      "description": "Latitude of the location",
      "minimum": -90,
      "maximum": 90
    },
    "longitude": {
      "type": "number",
      "description": "Longitude of the location",
      "minimum": -180,
      "maximum": 180
    }
  },
  "required": ["latitude", "longitude"]
}

Example Request:

{
  "method": "tools/call",
  "params": {
    "name": "get_forecast",
    "arguments": {
      "latitude": 38.5816,
      "longitude": -121.4944
    }
  }
}

Example Response:

{
  "content": [
    {
      "type": "text",
      "text": "Tonight:\nTemperature: 65°F\nWind: 5 mph SW\nForecast: Partly cloudy with a slight chance of showers.\n---\nTomorrow:\nTemperature: 78°F\nWind: 10 mph W\nForecast: Sunny skies throughout the day."
    }
  ]
}

Error Responses:

{
  "content": [
    {
      "type": "text",
      "text": "Failed to retrieve grid point data for coordinates: 38.5816, -121.4944. This location may not be supported by the NWS API (only US locations are supported)."
    }
  ]
}

Communication Flow

sequenceDiagram
    participant Client as MCP Client (Claude)
    participant Server as Weather Server
    participant NWS as National Weather Service API

    Client->>Server: Initialize Connection (STDIO)
    Server->>Client: Server Info + Capabilities
    
    Client->>Server: List Tools
    Server->>Client: [get_alerts, get_forecast]
    
    Client->>Server: Call Tool: get_forecast(lat, lon)
    Server->>NWS: GET /points/{lat},{lon}
    NWS->>Server: Grid Point Data
    Server->>NWS: GET {forecast_url}
    NWS->>Server: Forecast Data
    Server->>Client: Formatted Forecast Text
    
    Client->>Server: Call Tool: get_alerts(state)
    Server->>NWS: GET /alerts/active/area/{state}
    NWS->>Server: Active Alerts
    Server->>Client: Formatted Alerts Text

Protocol Messages

Initialization

Client → Server:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "initialize",
  "params": {
    "protocolVersion": "2024-11-05",
    "capabilities": {},
    "clientInfo": {
      "name": "Claude Desktop",
      "version": "1.0.0"
    }
  }
}

Server → Client:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "protocolVersion": "2024-11-05",
    "capabilities": {
      "tools": {
        "listChanged": true
      }
    },
    "serverInfo": {
      "name": "weather",
      "version": "1.0.0"
    }
  }
}

Tool Discovery

Client → Server:

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/list"
}

Server → Client:

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "tools": [
      {
        "name": "get_alerts",
        "description": "Get weather alerts for a US state.",
        "inputSchema": {
          "type": "object",
          "properties": {
            "state": {
              "type": "string",
              "description": "Two-letter US state code (e.g. CA, NY)"
            }
          },
          "required": ["state"]
        }
      },
      {
        "name": "get_forecast",
        "description": "Get weather forecast for a location.",
        "inputSchema": {
          "type": "object",
          "properties": {
            "latitude": {

Tools (2)

get_alertsRetrieves active weather alerts for a US state.
get_forecastRetrieves weather forecast for a specific location using latitude and longitude coordinates.

Configuration

claude_desktop_config.json
{"mcpServers": {"weather": {"command": "npx", "args": ["-y", "@dfrho/mcp-weather-server"]}}}

Try it

What is the current weather forecast for San Francisco at 37.7749, -122.4194?
Are there any active weather alerts for California right now?
Check the weather forecast for Sacramento using coordinates 38.5816, -121.4944.
List any severe weather warnings currently active in New York.

Frequently Asked Questions

What are the key features of MCP Weather Server?

Retrieves real-time weather forecasts for specific US locations. Fetches active weather alerts for any US state. Uses official National Weather Service API data. Supports coordinate-based location lookups.

What can I use MCP Weather Server for?

Planning outdoor activities by checking local weather forecasts. Monitoring regional weather safety by checking state-wide alerts. Integrating real-time weather data into AI-driven planning workflows. Automating weather-based notifications for US-based locations.

How do I install MCP Weather Server?

Install MCP Weather Server by running: npx -y @dfrho/mcp-weather-server

What MCP clients work with MCP Weather Server?

MCP Weather Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep MCP Weather Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare