Skip to main content
Glama
README.md
# πŸ“yerevan-aqi-mcp

MCP server for real-time Yerevan city air quality data. Connects AI assistants directly to the [official Yerevan GIS platform](https://gis.yerevan.am) β€” no API key required.

https://github.com/user-attachments/assets/757580fc-1061-4cb4-9c76-6526ccb19d80

## ✨ Features

- **Real-time AQI** from 50+ sensors across the city
- **Historical data** β€” hourly records, daily trends, worst locations
- **Zero auth** β€” open municipal data, just works
- **8 tools** covering everything from nearest sensor lookup to city-wide averages

## πŸ“¦ Installation

**Via npx (recommended):**
```json
{
  "mcpServers": {
    "yerevan-aqi": {
      "command": "npx",
      "args": ["yerevan-aqi-mcp"]
    }
  }
}
```

**From source:**
```bash
git clone https://github.com/hayrapetian/yerevan-aqi-mcp
cd yerevan-aqi-mcp
npm install && npm run build
```
```json
{
  "mcpServers": {
    "yerevan-aqi": {
      "command": "node",
      "args": ["/absolute/path/to/yerevan-aqi-mcp/dist/index.js"]
    }
  }
}
```

Config file location:
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

## πŸ› οΈ Tools

### `get_all_devices`
All sensors with current AQI and coordinates. Also returns city-wide average AQI.

| Param | Type | Default | Description |
|---|---|---|---|
| `limit` | int | 50 | Max devices to return (max 200) |
| `onlyWorking` | bool | true | Filter to operational devices only |

### `get_device_current`
Full current reading for a specific sensor: AQI, PM2.5, PM10, NO2, O3, temperature, humidity, wind.

| Param | Type | Description |
|---|---|---|
| `code` | string | Device code identifier |

### `get_devices_by_aqi`
Devices filtered above or below an AQI threshold, ordered by AQI.

| Param | Type | Default | Description |
|---|---|---|---|
| `threshold` | int | 100 | AQI threshold |
| `above` | bool | true | `true` = above, `false` = below |
| `limit` | int | 20 | Max results (max 100) |

### `get_nearest_sensor`
Closest working sensor to a given coordinate with its current reading.

| Param | Type | Description |
|---|---|---|
| `lat` | float | Latitude |
| `lon` | float | Longitude |

### `get_device_history`
Hourly records for a specific sensor over N days, with min/max/avg summary.

| Param | Type | Default | Description |
|---|---|---|---|
| `code` | string | β€” | Device code identifier |
| `days` | int | 7 | Days back (max 30) |

### `get_city_average`
City-wide aggregate AQI, PM2.5, and PM10 β€” averages and maxima β€” computed server-side.

| Param | Type | Default | Description |
|---|---|---|---|
| `days` | int | 1 | Days back to aggregate (max 30) |

### `get_worst_locations`
Top N most polluted sensors in a time window, ranked by average AQI.

| Param | Type | Default | Description |
|---|---|---|---|
| `hours` | int | 24 | Hours back (max 168) |
| `limit` | int | 10 | Number of results (max 50) |

### `get_historical_trend`
Daily average PM2.5 AQI and PM10 from the 2024–2025 archive dataset.

| Param | Type | Default | Description |
|---|---|---|---|
| `deviceCode` | string | β€” | Filter to a specific device (optional) |
| `limit` | int | 30 | Days to return (max 365) |

## πŸ“Š AQI Scale

| AQI | Category |
|---|---|
| 0–50 | 🟒 Good |
| 51–100 | 🟑 Moderate |
| 101–150 | 🟠 Unhealthy for Sensitive Groups |
| 151–200 | πŸ”΄ Unhealthy |
| 201–300 | 🟣 Very Unhealthy |
| 301+ | πŸ”΄ Hazardous |

## πŸ’» Development

```bash
npm run dev    # run with tsx, no build needed
npm run build  # compile TypeScript to dist/
npm start      # run compiled output
```

## πŸ“„ License

MIT β€” [Hayk Hayrapetyan](https://github.com/hayrapetian)

TDQS

A3.6/5.0

Scored across 8 tools

Disambiguation4/5

Most tools have clearly distinct purposes: current readings, per-device history, nearest sensor, city aggregate, threshold filtering, worst locations, and historical trend. There is some overlap between get_all_devices (which also returns a city-wide average), get_city_average, get_devices_by_aqi, and get_worst_locations, but descriptions make the intended distinctions reasonably clear.

Naming Consistency5/5

All tool names use a consistent get_ snake_case pattern with predictable resource/qualifier phrasing. Singular/plural variation follows natural semantics rather than introducing inconsistency.

Tool Count5/5

Eight tools is well-scoped for an air-quality sensor server. Each tool covers a distinct query pattern and no tool feels redundant or unnecessary for the domain.

Completeness4/5

The read-only query surface is strong: current readings, per-device history, nearest sensor, city averages, threshold filters, worst locations, and historical trends are all covered. Minor gaps remain around richer sensor metadata/status details and possibly forecast or alerting workflows, but these are not blocking for core AQI exploration.

Maintenance

ActivityInactive
ResponsivenessNo recent community issues