Skip to main content
Glama
brockly

weather-mcp-server

by brockly
README.md
# Weather MCP Server

A Model Context Protocol (MCP) server that provides weather data from the [National Weather Service API](https://www.weather.gov/documentation/services-web-api). Built following the [MCP TypeScript server guide](https://modelcontextprotocol.io/docs/develop/build-server#typescript).

## Tools

### `get_alerts`
Get active weather alerts for a US state.

| Parameter | Type   | Description                          |
|-----------|--------|--------------------------------------|
| `state`   | string | Two-letter state code (e.g. CA, NY)  |

### `get_forecast`
Get the weather forecast for a location by coordinates.

| Parameter   | Type   | Description                |
|-------------|--------|----------------------------|
| `latitude`  | number | Latitude (-90 to 90)      |
| `longitude` | number | Longitude (-180 to 180)   |

> **Note:** Only US locations are supported by the NWS API.

## Setup

```bash
npm install
npm run build
```

## Usage with Claude Desktop

Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "weather": {
      "command": "node",
      "args": ["/absolute/path/to/weather/build/index.js"]
    }
  }
}
```

## Usage with Claude Code

Add to your Claude Code settings:

```bash
claude mcp add weather node /absolute/path/to/weather/build/index.js
```

## Development

```bash
npm install
npm run build
npm start
```

## License

MIT