Skip to main content
Glama
ChinmayBhattt

Weather MCP Server

README.md
# Weather MCP Server
  
A Model Context Protocol (MCP) server built with `FastMCP` that provides US weather forecasts and active alerts using the [National Weather Service (NWS) API](https://api.weather.gov).

## Features (Tools Provided)

When connected to an AI assistant, it provides the following tools:
- **`get_alerts(state: str)`**: Fetches active weather alerts for a US state (e.g. "CA", "NY").
- **`get_forecast(latitude: float, longitude: float)`**: Fetches detailed weather forecasts for a specific geographic coordinate.

## Project Structure

- `weather.py`: The main FastMCP server containing the API calls and tool definitions.
- `.venv/`: The Python virtual environment for isolated dependencies.
- `pyproject.toml` / `main.py`: Other configuration and entry point scripts.

## Installation & Setup

1. Make sure you are using the virtual environment:
   ```bash
   source .venv/bin/activate
   ```
2. Required packages are likely already installed, but if not:
   ```bash
   pip install "mcp[cli]" httpx
   ```

## Testing Locally

You can test the MCP tools locally through a web interface using the MCP Inspector:

```bash
npx @modelcontextprotocol/inspector "/Users/name/mcp servers/.venv/bin/python" "/Users/name/mcp servers/weather.py"
```

## Connecting to AI Clients (e.g., Claude Desktop)

To use this server with Claude Desktop, add the following to your `claude_desktop_config.json` file:

```json
{
  "mcpServers": {
    "weather": {
      "command": "/Users/name/mcp servers/.venv/bin/python",
      "args": [
        "/Users/name/mcp servers/weather.py"
      ]
    }
  }
}
```

Restart Claude and it will now have access to live formatting and tracking for US weather!

TDQS

B3.3/5.0

Scored across 2 tools

Disambiguation5/5

The two tools serve entirely different purposes: one for alerts by state, another for forecast by coordinates. No overlap or confusion possible.

Naming Consistency5/5

Both tools follow a consistent verb_noun pattern (get_alerts, get_forecast), making it easy to predict naming.

Tool Count3/5

With only 2 tools, the server feels thin compared to typical weather API capabilities. It's borderline but not excessive given its narrow scope.

Completeness2/5

The server lacks common weather operations like current conditions, hourly forecast, or historical data. Significant gaps exist for a comprehensive weather service.

Maintenance

ActivityInactive
ResponsivenessNo issues