home / mcp / mcp weather server

MCP Weather Server

Provides weather tools powered by the National Weather Service API for MCP clients to fetch alerts and forecasts.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "broerjuang-mcp-weather": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "mcp-weather-server:latest"
      ]
    }
  }
}

This MCP Weather Server provides weather-related tools for AI assistants by leveraging the National Weather Service data. It runs as a containerized MCP endpoint that you can connect to from your MCP client to fetch weather alerts and forecasts for US locations.

How to use

You interact with the server through your MCP client to perform weather-related tasks. Use the get_alerts tool to receive weather alerts for a specific US state (for example, CA or NY) and use the get_forecast tool to obtain a forecast for given coordinates (latitude and longitude). Start by adding the weather MCP endpoint to your client configuration, then issue natural language requests like “Get alerts for California” or “What’s the forecast for coordinates 40.7128, -74.0060?”. The tools respond with the relevant weather information drawn from the National Weather Service.

Once configured, you can combine weather data with other context in your conversations. The weather data is sourced for US locations only.

How to install

Prerequisites you need before installing: Docker Desktop installed and running, and access to your MCP client environment (Cursor IDE or equivalent).

Step 1 — Build the MCP Weather Server image using the provided build target.

make docker-build

Step 2 — Add the MCP server entry to your MCP client configuration. Create or edit the following file at your home directory to register the weather server. The example uses the Docker runtime to launch the server container.

{
  "mcpServers": {
    "weather": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "mcp-weather-server:latest"],
      "env": {}
    }
  }
}

Step 3 — Restart your MCP client (for example, close and reopen Cursor) to load the new weather server configuration.

Optional: If your environment requires you to set environment variables for the container, add them under the env object in the snippet above or adjust the env section accordingly in your MCP client configuration.

Notes and environment

Weather data is provided by the National Weather Service for US locations. This server exposes two tools: get_alerts for alerts by state and get_forecast for forecasts by coordinates.

Supported commands in this setup include building the image and registering the MCP server with your client, followed by restarting the client to apply changes.

Troubleshooting and tips

  • If the server does not appear in your MCP client after adding the configuration, ensure Docker is running and that the container name mcp-weather-server:latest is accessible from your environment.
  • Check that your MCP client has permission to run Docker commands.
  • Review any error messages from the MCP client for hints about misconfigured arguments or missing environment variables.
  • If you need a fresh start, rebuild the image with make docker-build and re-add the MCP server configuration.

Available tools

get_alerts

Weather alerts for any US state (e.g., CA, NY)

get_forecast

Weather forecast for coordinates (latitude, longitude)