home / mcp / weather mcp server

Weather MCP Server

Provides weather data tools from the National Weather Service via MCP, including alerts by state and forecasts by location.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "bryankemp-weather_mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/weather",
        "run",
        "weather.py"
      ]
    }
  }
}

You can run a weather-focused MCP server that provides two practical tools: one to fetch active weather alerts for a US state and another to retrieve detailed forecasts for a specific location. This server runs with FastMCP over a stdio channel, making it easy to connect to MCP clients and automate weather queries in your workflows.

How to use

To use this Weather MCP Server, connect with an MCP client using the stdio transport. The server exposes two tools you can call: get_alerts and get_forecast. get_alerts(state) returns active weather alerts for the specified two-letter US state code (for example, CA or NY). get_forecast(latitude, longitude) returns a detailed forecast for the location you specify by its latitude and longitude.

You will interact with the tools through your MCP client’s tool invocation flow. Use get_alerts to monitor state-level weather warnings and get_forecast to plan activities or respond to changing conditions at a precise location. The server handles errors gracefully and formats responses as user-friendly strings.

How to install

Prerequisites you need before installation: Python 3.11 or higher and the uv package manager as the recommended runtime tool.

1) Clone the weather MCP project repository to your local machine.

2) Change into the project directory.

3) Install dependencies using the uv tool.

4) Create and activate a virtual environment.

5) Start the server using the runtime command shown below.

Additional configuration and usage notes

Server runtime uses the uv tool to run the main script weather.py in a local directory. You can integrate this MCP server with clients by providing a simple MCP configuration that points to the uv command and the weather script.

{
  "mcpServers": {
    "weather": {
      "command": "uv",
      "args": ["--directory", "/path/to/weather", "run", "weather.py"]
    }
  }
}

Notes on commands and environment

The server exposes two tools: get_alerts and get_forecast. To use them, your MCP client will call these functions with the appropriate parameters as described in the tool definitions.

Available tools

get_alerts

Fetch active weather alerts for a US state using a two-letter state code (e.g., CA, NY). Returns user-friendly alerts formatted as strings.

get_forecast

Retrieve a detailed weather forecast for a specific latitude/longitude pair. Returns a human-readable forecast string.