Skip to main content
Glama
@nks-hub/zabbix-mcp

@nks-hub/zabbix-mcp

by nks-hub
README.md
# @nks-hub/zabbix-mcp

[![Build Status](https://github.com/nks-hub/zabbix-mcp/actions/workflows/build.yml/badge.svg)](https://github.com/nks-hub/zabbix-mcp/actions)
[![npm version](https://img.shields.io/npm/v/@nks-hub/zabbix-mcp.svg)](https://www.npmjs.com/package/@nks-hub/zabbix-mcp)
[![Node.js](https://img.shields.io/badge/Node.js-18+-339933.svg)](https://nodejs.org/)
[![TypeScript](https://img.shields.io/badge/TypeScript-5.7+-3178c6.svg)](https://www.typescriptlang.org/)
[![MCP SDK](https://img.shields.io/badge/MCP_SDK-1.30+-8b5cf6.svg)](https://modelcontextprotocol.io/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

> MCP server for Zabbix monitoring: query hosts, problems, triggers, events, items, and history directly from Claude Code, OpenClaw, or any MCP-compatible client.

Questions an AI assistant can answer with it:

- "What broke today on our servers?"
- "Show me active high-severity problems in the last 24 hours"
- "Which host has this trigger and what metric caused it?"
- "List all PVE-related alerts and acknowledge the maintenance window"
- "Give me item history for this metric before and after the incident"

## Features

- 🛠️ **11 tools** - Host groups, hosts, problems, events, triggers, items, metric history and acknowledgements
- 🔑 **Token or login auth** - API token or username/password
- 🚨 **Problem queries** - Current and recent problems filtered by time (`since`), severity and acknowledgement
- 📈 **Metric history** - Raw item history, for example before and after an incident
- ✅ **Event actions** - Acknowledge events, add messages, suppress, close or change severity
- ✂️ **Response truncation** - Responses over 25,000 characters are cut and carry a hint with the number of items returned and how to narrow the query
- 💬 **Error messages** - Timeouts (30 s), HTTP errors and Zabbix RPC errors reach the client with the status or RPC code and message

## Requirements

- **Node.js**: 18+
- **Zabbix**: API-enabled instance (token or user auth). Tested against 6.0, 7.0, 7.4 and 8.0.
  On Zabbix below 6.4 the API token is sent in the request body, since those
  versions ignore the `Authorization: Bearer` header.

## Installation

Run it with npx without installing:

```bash
npx -y @nks-hub/zabbix-mcp
```

Or install globally:

```bash
npm install -g @nks-hub/zabbix-mcp
```

### From source

```bash
git clone https://github.com/nks-hub/zabbix-mcp.git
cd zabbix-mcp
npm install && npm run build
```

## Configuration

Add to your `~/.claude/settings.json` or project `.claude/settings.json`:

### API token auth (recommended)

```json
{
  "mcpServers": {
    "zabbix": {
      "command": "npx",
      "args": ["-y", "@nks-hub/zabbix-mcp"],
      "env": {
        "ZABBIX_URL": "https://monitor.example.com",
        "ZABBIX_API_TOKEN": "your-api-token"
      }
    }
  }
}
```

### CLI shorthand

```bash
claude mcp add zabbix -e ZABBIX_URL=https://monitor.example.com -e ZABBIX_API_TOKEN=your-token -- npx -y @nks-hub/zabbix-mcp
```

### Username + password auth

```json
{
  "mcpServers": {
    "zabbix": {
      "command": "npx",
      "args": ["-y", "@nks-hub/zabbix-mcp"],
      "env": {
        "ZABBIX_URL": "https://monitor.example.com",
        "ZABBIX_USERNAME": "Admin",
        "ZABBIX_PASSWORD": "your-password"
      }
    }
  }
}
```

## Usage

Once configured, the MCP client sees the tools listed below and calls them when you ask about Zabbix state.

## Authentication

| Method | Environment variables | Use case |
|--------|----------------------|----------|
| API token | `ZABBIX_API_TOKEN` | Recommended for production |
| Username/password | `ZABBIX_USERNAME`, `ZABBIX_PASSWORD` | Legacy setups or quick testing |

Both require `ZABBIX_URL` pointing at your Zabbix instance.

`ZABBIX_URL` may be provided as any of these forms:

- `https://monitor.example.com/api_jsonrpc.php`
- `https://monitor.example.com/zabbix`
- `https://monitor.example.com`

The server normalizes it to the API endpoint.

## Tools (11)

### System
| Tool | Description |
|------|-------------|
| `zabbix_health` | Connectivity smoke test for the configured Zabbix API |

### Hosts
| Tool | Description |
|------|-------------|
| `zabbix_list_host_groups` | Discover host groups |
| `zabbix_list_hosts` | List monitored hosts with filtering |
| `zabbix_get_host` | Full host detail including interfaces, groups, macros, and inventory |

### Problems and events
| Tool | Description |
|------|-------------|
| `zabbix_list_problems` | Current/recent problem events with time, severity, and ack filters |
| `zabbix_list_events` | Trigger event timeline/history |
| `zabbix_acknowledge_event` | Acknowledge, annotate, close, suppress, or change event severity |

### Triggers
| Tool | Description |
|------|-------------|
| `zabbix_list_triggers` | List triggers by host/group/problem state |
| `zabbix_get_trigger` | Full trigger detail with hosts, items, tags, and dependencies |

### Items and metrics
| Tool | Description |
|------|-------------|
| `zabbix_list_items` | Discover item IDs, keys, state, and last value |
| `zabbix_get_item_history` | Fetch raw metric history for a specific item |

## Common workflows

### 1. Daily incident analysis
1. `zabbix_list_host_groups`
2. `zabbix_list_hosts`
3. `zabbix_list_problems` with `since`
4. `zabbix_get_trigger` or `zabbix_get_host`
5. `zabbix_list_items` + `zabbix_get_item_history`

### 2. Acknowledge a maintenance-related alert
1. `zabbix_list_problems`
2. `zabbix_acknowledge_event` with `acknowledge=true` and `message`

### 3. Validate a suspicious metric spike
1. `zabbix_list_items`
2. inspect `value_type`
3. `zabbix_get_item_history`

## Links

- [Zabbix](https://www.zabbix.com/)
- [npm package](https://www.npmjs.com/package/@nks-hub/zabbix-mcp)
- [@nks-hub/rybbit-mcp](https://github.com/nks-hub/rybbit-mcp): analytics MCP server

## Development

```bash
# Install dependencies
npm install

# Build
npm run build

# Watch mode
npm run dev

# Type check / build check
npm run check

# Package preview
npm pack
```

### Live smoke tests

Token-based:

```bash
ZABBIX_URL="https://monitor.example.com/api_jsonrpc.php" \
ZABBIX_API_TOKEN="your-token" \
node test-live.mjs
```

Login-based:

```bash
ZABBIX_URL="https://monitor.example.com/api_jsonrpc.php" \
ZABBIX_USERNAME="Admin" \
ZABBIX_PASSWORD="your-password" \
node test-login.mjs
```

## Contributing

Contributions are welcome! For larger changes, open an issue first.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'feat: description'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## Support

- 📧 **Email:** dev@nks-hub.cz
- 🐛 **Bug reports:** [GitHub Issues](https://github.com/nks-hub/zabbix-mcp/issues)
- 📖 **MCP Protocol:** [modelcontextprotocol.io](https://modelcontextprotocol.io/)

## License

MIT License — see [LICENSE](LICENSE) for details.

---

<p align="center">
  Made with ❤️ by <a href="https://github.com/nks-hub">NKS Hub</a>
</p>

TDQS

A3.7/5.0

Scored across 11 tools

Disambiguation4/5

Most tools target distinct resources (hosts, host groups, items, triggers, problems, events) and the descriptions explicitly delimit the fuzzy pairs: list_problems is problem.get, list_events is the broader trigger-event timeline, and list_triggers is the configured trigger inventory. The only real overlap is problems vs. events vs. triggers, and get_trigger vs. list_triggers, which an agent must read carefully to choose correctly.

Naming Consistency5/5

Every tool uses the same zabbix_ prefix followed by a verb_noun pattern (list_hosts, get_host, acknowledge_event, get_item_history) in snake_case. The lone exception is zabbix_health, a conventional standalone ping-style name that doesn't break the pattern.

Tool Count5/5

Eleven tools is comfortably within the well-scoped range, and each one earns its place: a health check, list/get pairs for the core entities, history retrieval, and a single mutation. No redundancy or bloat.

Completeness4/5

The read path is essentially complete for an observability workflow (health → groups → hosts → items → history → triggers → problems → events → acknowledge), with pagination throughout. Gaps remain on the write/configuration side (no create/update/delete for hosts, items, or triggers, no templates, maintenance, or user/audit coverage), though these appear intentional for a read-focused server and are partially workable around via filtered list calls.

Maintenance

ActivityMaintained
ResponsivenessLimited data