home / mcp / weather mcp server

Weather MCP Server

Provides real-time weather alerts via an MCP server with STDIO and SSE transports.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "arunm8489-mcp": {
      "url": "http://127.0.0.1:8000/sse",
      "headers": {
        "GROQ_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

You can run a Weather MCP Server to expose weather alerts from an API as MCP tools, and connect with a client to ask questions or retrieve current alerts. This setup lets you operate both a local STDIO server and a remote-style SSE HTTP server, giving you flexible transport options for interactive querying.

How to use

You will run an MCP client that connects to the weather MCP server, then ask questions like which weather alerts exist for a state. The client will load the server configuration, start the server as a subprocess if needed, and route your questions through a Groq-based language model to call the weather tools automatically.

How to install

Prerequisites: You need Python 3.13 or newer and the uv package manager. You also need a Groq API key for the LLM.

# Install and set up the environment
python3.13 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
uv sync

Additional configuration and usage notes

The Weather MCP Server supports two transport methods. You can use a local STDIO server that runs inside your terminal, or an HTTP-based SSE server that clients connect to via a URL.

{
  "mcpServers": {
    "weather": {
      "command": "uv",
      "args": ["run", "server/weather.py"]
    }
  }
}
{
  "mcpServers": {
    "weather": {
      "url": "http://127.0.0.1:8000/sse"
    }
  }
}

Environment variable you must provide is GROQ_API_KEY for the Groq LLM access. Include your API key in the environment when starting the local server or when configuring the client.

Troubleshooting tips

If you encounter module or dependency errors, ensure you have installed the project dependencies with the package manager and that you are using the project’s virtual environment.

If port conflicts occur for the HTTP SSE server, stop the process using the port or change the port in the server script, then update the client configuration to connect to the new port.

Available tools

get_alerts

Get active weather alerts for a US state