Zabbix MCP

Native Model Context Protocol server for Zabbix, with an embedded AI assistant — packaged as a standard Zabbix frontend module.

Version: 1.0.0 · Requires: Zabbix 7.0+ / PHP 8.1+ · License: MIT

Built by MonZphere, a Zabbix Integration Partner.


About

Zabbix MCP exposes your Zabbix instance to AI clients through the open Model Context Protocol, and ships a chat assistant built into the Zabbix UI.

It does not hard-code an API list. On the Zabbix version you are actually running it discovers every API object and method by reflection and extracts the required/optional parameters straight from that version's own validation rules ($api_input_rules inside validateCreate / validateUpdate / get). The tool catalog therefore always matches your Zabbix.

Features

  • MCP server endpoint — JSON-RPC 2.0 over HTTP (initialize, tools/list, tools/call, ping, batch). Connect any external MCP client.
  • Embedded assistant — a floating chat on every page; an MCP host that talks to your chosen AI provider and runs the agentic loop (model → tool calls → Zabbix API → model).
  • Any provider — OpenAI-compatible (OpenAI, Azure OpenAI, Groq, OpenRouter, vLLM…), Anthropic, Google Gemini, and Ollama / local models.
  • Version-accurate tools — auto-generated for every API object of the installed version.
  • Markdown replies, theme-aware UI (light / dark), expand-to-center chat.

Security

  • Every tool call runs through the user-scoped Zabbix API wrapper, so native RBAC fully applies — a user who cannot do X in the UI cannot do X via MCP.
  • Read-only by default. Writes require a global switch and per-category opt-in (create / update / delete / acknowledge), all on top of RBAC.
  • Authentication is native: a Zabbix session cookie or an API token (Authorization: Bearer <token>); the token's owner permissions apply.
  • Provider API keys are stored server-side only (data/config.json, 0600, web-access denied) and never reach the browser; the chat proxies through CSRF-protected controllers.
  • Writes are audited by the Zabbix API exactly as UI actions are.

Schema fidelity

The generated JSON Schema is a hint; the Zabbix API remains the validation authority and its native error is returned to the model so it self-corrects. Where extraction is fully reliable (delete, and value constraints such as sortfield / status) schemas are strict; where the Zabbix source builds rules in pieces, schemas stay permissive so valid-but-unparsed fields still pass through.

Installation

  1. Copy this directory to your Zabbix frontend modules path, e.g. /usr/share/zabbix/modules/ZbxMCP.
  2. In Zabbix go to Administration → General → Modules, click Scan directory, and enable Zabbix MCP.
  3. Ensure the web server user can write the data/ directory (config + per-version schema cache).

Usage

  1. Open MCP → Settings (Super admin):
    • Enable the MCP server and/or the assistant.
    • Pick a provider and enter its API key.
    • Optionally enable specific write scopes.
  2. Chat from the floating button on any page, and/or point an MCP client at the endpoint.

The endpoint URL is shown in Settings, e.g. https://<host>/<base>/modules/ZbxMCP/endpoint/mcp.php.

Connecting an external MCP client

{
  "mcpServers": {
    "zabbix": {
      "url": "https://<host>/<base>/modules/ZbxMCP/endpoint/mcp.php",
      "headers": { "Authorization": "Bearer <zabbix-api-token>" }
    }
  }
}

Project layout

manifest.json          module manifest (v2)
Module.php             menu registration (MCP section)
endpoint/mcp.php       MCP server (JSON-RPC / HTTP)
lib/                   transport-agnostic core
  Catalog.php            reflection discovery of API objects/methods
  SchemaExtractor.php    native parameter extraction -> JSON Schema (+ enums, strictness)
  SchemaCache.php        per-version cache
  ToolRegistry.php       builds the MCP tool set, applies gating
  ToolExecutor.php       executes via the user-scoped API wrapper
  Security.php           scope classification + write gates
  Config.php             secure config store
  ChatOrchestrator.php   agentic loop (MCP host)
  providers/             OpenAI / Anthropic / Gemini / Ollama adapters
actions/               controllers (settings, tools, chat.send, chat.meta)
views/                 settings / tools pages (the assistant is a global floating widget)
assets/                css + global chat widget js
data/                  runtime config + schema cache (not web-served, not committed)

Compatibility

Tested on Zabbix 7.0.x.

License

MIT — see LICENSE.

Developed by MonZphere.