MCP Zabbix

MCP Zabbix

mcp_zabbix•bybadoss

A Model Context Protocol server that bridges the Zabbix monitoring API with AI assistants such as Claude Desktop and Cursor.

License: MIT License•Runtime: Awaiting documentation review•Category: cloud devops

WHAT IT DOES

  • •Provides tools to list Zabbix hosts, host groups, hosts by group, items, problems, users, proxies, and HA cluster nodes.
  • •Retrieves trend data for an item and can render a trend chart as a PNG plus base64 payload.
  • •Creates Zabbix hosts using agent, snmp, ipmi, or jmx interfaces.
  • •Sends email via SMTP, automatically disabled when credentials are missing.

BEST FOR

  • •Running natural-language queries about monitored hosts and their groups.
  • •Investigating active problems on a specific host, grouped by severity.
  • •Rendering trend charts such as CPU utilization and sending alert emails.

ABOUT MCP_ZABBIX

MCP Zabbix is cataloged as an MCP server attributed to badoss. A Model Context Protocol server that bridges the Zabbix monitoring API with AI assistants such as Claude Desktop and Cursor. It is categorized under cloud devops. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for MCP Zabbix are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

How are errors handled when a Zabbix tool fails?

Zabbix tools return a structured error envelope instead of throwing exceptions on failure.

How is a generated trend chart delivered to the client?

The construct_graph tool returns the on-disk PNG path plus a base64-encoded PNG so most clients render it inline.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 93de968fbb73 · 采集于 2026-11-13 10:44:57 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

MCP Zabbix

Python License: MIT MCP Code style: ruff Type-checked: mypy

A production-grade Model Context Protocol server that bridges the Zabbix monitoring API with AI assistants such as Claude Desktop, Cursor, and any other MCP-compatible client. Built on FastMCP with an async httpx client, typed Pydantic models, structured logging, and a trend-graph renderer that returns both an on-disk PNG and a base64 payload for inline display.


Table of contents


Architecture

                       ┌─────────────────────────────────────┐
                       │       AI Assistant / MCP Client     │
                       │   (Claude Desktop, Cursor, etc.)    │
                       └────────────────┬────────────────────┘
                                        │
                                        │   MCP stdio (JSON-RPC)
                                        ▼
        ┌──────────────────────────────────────────────────────────┐
        │                   FastMCP server (main.py)               │
        │  ┌────────────────────────────────────────────────────┐  │
        │  │  @mcp.tool registrations  →  async handlers        │  │
        │  └────────────────────────────────────────────────────┘  │
        │            │                  │                 │        │
        │            ▼                  ▼                 ▼        │
        │  ┌──────────────────┐  ┌────────────┐  ┌──────────────┐  │
        │  │  ZabbixClient    │  │  Email     │  │  Graph       │  │
        │  │  (httpx async,   │  │  (smtplib  │  │  (matplotlib │  │
        │  │   retry, auth)   │  │   thread)  │  │   PNG+b64)   │  │
        │  └────────┬─────────┘  └─────┬──────┘  └──────┬───────┘  │
        │           │                  │                │          │
        │  ┌────────┴──────────────────┴────────────────┴──────┐   │
        │  │  core/  : Settings  •  Logger  •  Exceptions      │   │
        │  └───────────────────────────────────────────────────┘   │
        └────────────┬────────────────────────┬────────────────────┘
                     │                        │
                     ▼                        ▼
            ┌────────────────┐        ┌──────────────────┐
            │ Zabbix API     │        │  SMTP (Gmail)    │
            │ (JSON-RPC)     │        │                  │
            └────────────────┘        └──────────────────┘

A request from the AI assistant arrives over MCP stdio, is routed to an async tool handler, which delegates to the service layer (ZabbixClient, email, graph). Every layer pulls its configuration from a single pydantic-settings Settings object and logs through one rotating handler.


Highlights

  • Fully async — httpx.AsyncClient with bearer-token auth, configurable timeout, and exponential-backoff retries for transient failures.
  • Typed boundaries — Pydantic v2 models validate tool inputs (emails, IP addresses, time ranges) before they reach the network.
  • Single source of truth for config — pydantic-settings reads from process env then .env; secrets are wrapped in SecretStr.
  • Stdio-safe logging — rotating file handler + stderr stream (never pollutes the MCP protocol on stdout).
  • Graph rendering — saves a PNG to disk and returns base64 so MCP clients can render inline without a second round-trip.
  • Graceful degradation — the email tool is automatically disabled when SMTP credentials are missing, returning a structured error rather than crashing the server.
  • Tested — async pytest suite with respx-mocked HTTP, no real Zabbix required for CI.

Available tools

ToolSignatureDescription
get_zabbix_host()List hosts with interfaces, groups, and tags.
get_zabbix_host_group()List host groups.
get_zabbix_host_by_group(group_id: str)Hosts within a group.
get_zabbix_item(host_id: str)Items configured on a host.
get_zabbix_problem()Current problems (most recent first).
get_zabbix_problem_by_host(host_id: str)Problems for a single host.
get_zabbix_trend(item_id, start_time, end_time)Trend rows for an item.
get_zabbix_user()Users with roles and access flags.
get_zabbix_proxy()Proxy inventory.
get_zabbix_ha_cluster_nodes()HA cluster node state.
create_zabbix_host(hostname, ip, group_ids, ...)Create a host (agent/snmp/ipmi/jmx).
send_email_tool(to_email, subject, body)Send via SMTP.
construct_graph(item_id, start_time, end_time, item_name)Render trend chart (PNG + base64).

All Zabbix tools return the raw result payload from the JSON-RPC response. On failure they return a structured {"error": ..., "type": ...} envelope rather than throwing.


Project layout

mcp_zabbix/
├── src/mcp_zabbix/
│   ├── __init__.py
│   ├── main.py              # FastMCP entrypoint + tool registrations
│   ├── core/
│   │   ├── config.py        # pydantic-settings (env + .env)
│   │   ├── logging.py       # rotating file + stderr handlers
│   │   └── exceptions.py    # ZabbixAPIError / EmailError / GraphError
│   ├── models/
│   │   └── zabbix.py        # Pydantic schemas for tool I/O
│   └── services/
│       ├── zabbix.py        # async ZabbixClient (retry, auth)
│       ├── email.py         # SMTP wrapper (asyncio.to_thread)
│       └── graph.py         # matplotlib renderer (PNG + base64)
├── tests/
│   ├── conftest.py          # autouse env stubbing
│   ├── test_config.py
│   ├── test_zabbix_client.py  # respx-mocked HTTP
│   └── test_graph.py
├── Dockerfile               # python:3.12-slim, non-root user
├── docker-compose.yml       # mounts ./logs and ./output
├── pyproject.toml           # hatchling build, dev extras, ruff/mypy
├── requirements.txt         # mirror of runtime deps for pip users
├── run.sh                   # convenience launcher (loads .env)
├── .env.example
└── LICENSE

Quick start

Prerequisites

  • Python 3.10 or newer
  • A reachable Zabbix server with a valid API token
  • (Optional) Gmail / SMTP credentials for the email tool

Local (pip)

git clone https://github.com/badoss/mcp_zabbix.git
cd mcp_zabbix

python -m venv .venv
source .venv/bin/activate            # Windows: .venv\Scripts\activate

pip install -e ".[dev]"
cp .env.example .env                 # edit ZABBIX_API_URL / TOKEN
./run.sh                             # or: mcp-zabbix

Local (uv)

uv is a fast Rust-based replacement for pip:

uv sync                              # installs runtime deps
uv sync --extra dev                  # add dev tooling
cp .env.example .env
uv run mcp-zabbix

Docker

cp .env.example .env                 # edit secrets
docker compose up --build

./logs and ./output are mounted into the container so log files and generated PNGs persist on the host.


Configuration

All settings come from environment variables. A .env file in the project root is loaded automatically. Full list (see .env.example):

Zabbix

VariableDefaultDescription
ZABBIX_API_URL— (required)Full URL to api_jsonrpc.php.
ZABBIX_API_TOKEN— (required)Bearer token (stored as SecretStr).
ZABBIX_REQUEST_TIMEOUT30HTTP timeout in seconds.
ZABBIX_MAX_RETRIES3Transient-failure retry budget.

SMTP (optional)

VariableDefaultDescription
SMTP_HOSTsmtp.gmail.comSMTP server host.
SMTP_PORT587SMTP server port (STARTTLS).
SMTP_USERemptyLogin user; required to enable email.
SMTP_PASSWORDemptyLogin password or Gmail app password.
SMTP_FROM_NAMEMCP ZabbixDisplay name in the From header.

Gmail note: enable 2FA and create an app password — regular account passwords are no longer accepted by Google's SMTP.

Runtime

VariableDefaultDescription
LOG_LEVELINFODEBUG / INFO / WARNING / ERROR / CRITICAL.
LOG_DIRlogsRotating log directory (5 MB × 3 backups).
GRAPH_OUTPUT_DIRoutputWhere trend PNGs are written.

MCP client setup

Claude Desktop / Cursor (uv launcher)

~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "mcp-zabbix": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/absolute/path/to/mcp_zabbix",
        "mcp-zabbix"
      ]
    }
  }
}

pip-installed virtualenv

{
  "mcpServers": {
    "mcp-zabbix": {
      "command": "/absolute/path/to/mcp_zabbix/.venv/bin/mcp-zabbix"
    }
  }
}

Docker

{
  "mcpServers": {
    "mcp-zabbix": {
      "command": "docker",
      "args": ["compose", "-f", "/absolute/path/to/docker-compose.yml", "run", "--rm", "mcp-zabbix"]
    }
  }
}

Restart your MCP client after editing the config — the tools should then show up in its tool palette.


Usage examples

Once connected, prompt your assistant in plain language; it will pick the right tool automatically.

List monitored hosts

Show me every Zabbix host along with its group memberships.

Investigate problems on a host

What active problems does host 10084 have? Group them by severity.

Render a trend chart

Plot the last 24 hours of CPU utilization for item 50134 and call the chart "Web-01 CPU".

The construct_graph tool returns the on-disk path plus a base64-encoded PNG — most MCP clients will render the chart inline.

Send an alert email

Email oncall@example.com with subject "P1: DB latency" and a one-line body describing the current problem.

The email tool returns {"status": "sent", ...} on success, or a structured error envelope if SMTP isn't configured.


Development

pip install -e ".[dev]"

# run the test suite (async + respx-mocked HTTP)
pytest

# lint & format
ruff check src tests
ruff format src tests

# strict type-check
mypy src

The test suite uses pytest-asyncio (auto mode) and respx to mock httpx. No real Zabbix server is required for CI.

To run the server against your local Zabbix:

cp .env.example .env
$EDITOR .env
./run.sh

License

Released under the MIT License.

Support

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for MCP Zabbix from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcp_zabbix)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related cloud devops MCP Servers

Alternative and complementary servers in the same category

View all in cloud devops →
Huawei MCP Server
mcp-server-huaweiclouddeveloper•huaweiclouddeveloper

A Model Context Protocol server built on Huawei Cloud services that enables AI assistants to operate Huawei Cloud resources within conversational workflows, supporting ECS, OBS, GaussDB, and other cloud products.

Repository stats unavailable
Cloud & DevOps
Coolify MCP Server
coolify-mcp-server•wrediam

An MCP server that exposes the Coolify v4.3.1 REST API so AI clients can manage applications, databases, services, servers, deployments, and more.

Repository stats unavailable
Cloud & DevOps

A deprecated Model Context Protocol server for interacting with Kong Konnect APIs, enabling AI assistants to query and analyze Kong Gateway configurations, traffic, and analytics.

Repository stats unavailable
Cloud & DevOps