Skip to main content
Glama
Zabbix MCP Server

Zabbix MCP Server

by leroylim

Zabbix MCP Server

A comprehensive Model Context Protocol (MCP) server for integrating with Zabbix monitoring systems. This server provides complete Zabbix API functionality through a standardized interface, enabling seamless monitoring, alerting, and infrastructure management with modern authentication and a clean, professional interface.

๐Ÿš€ Features

  • ๐Ÿ” Modern Authentication - API Token (Zabbix 5.4+) and Username/Password support

  • ๐Ÿงน Clean Interface - Professional, modern API without legacy baggage

  • 90+ API Tools across 19 categories for comprehensive monitoring management

  • Complete Zabbix Integration with all major API endpoints

  • Enterprise-Grade Functionality including maps, dashboards, proxies, and services

  • Comprehensive Schema Validation with Zod type safety

  • Modular Architecture with clean separation of concerns

  • Production Ready with robust error handling and logging

Related MCP server: Zabbix MCP Server

๐Ÿ“Š Quick Stats

  • ๐Ÿ”‘ Dual Authentication - API Token (recommended) + Username/Password

  • 19 Tool Categories covering all Zabbix functionality

  • 90+ Individual Tools for granular control

  • 100% Type Safe with Zod schema validation

  • Modular Design with API and tools layers

  • Enterprise Features including business services and SLA monitoring

๐Ÿ” Authentication Methods

Best for: Production environments, CI/CD, automated systems

ZABBIX_API_URL=https://your-zabbix-server/api_jsonrpc.php
ZABBIX_API_TOKEN=your_api_token_here

Benefits:

  • โœ… More secure (no password exposure)

  • โœ… No login/logout required (direct token usage)

  • โœ… Easy revocation (token management in Zabbix UI)

  • โœ… Long-lived (configurable expiration)

  • โœ… Audit-friendly (token usage tracking)

๐Ÿ” Username/Password Authentication (Traditional)

Best for: Development, testing, legacy systems

ZABBIX_API_URL=https://your-zabbix-server/api_jsonrpc.php
ZABBIX_USERNAME=Admin
ZABBIX_PASSWORD=your_password

Features:

  • โœ… Session-based authentication with auto-refresh

  • โœ… Automatic login/logout handling

  • โœ… Compatible with all Zabbix versions

  • โœ… Familiar authentication flow

๐Ÿ—๏ธ Tool Categories Overview

๐Ÿ” Authentication & Core (3 tools)

  • Session management and API authentication

  • User login/logout functionality

  • API version information

๐Ÿ–ฅ๏ธ Infrastructure Management

  • Hosts (3 tools) - Host discovery, creation, and management

  • Host Groups (4 tools) - Logical host organization and grouping

  • Proxies (4 tools) - Distributed monitoring with active/passive proxies

  • Items (5 tools) - Data collection configuration and monitoring

  • Triggers (4 tools) - Alert condition definition and management

๐Ÿ“Š Monitoring & Alerting

  • Problems (2 tools) - Active issue tracking and resolution

  • History (3 tools) - Historical data retrieval and analysis

  • Maintenance (4 tools) - Scheduled maintenance window management

  • Actions (6 tools) - Automated response and escalation workflows

๐ŸŽฏ Advanced Features

  • Templates (6 tools) - Reusable monitoring configurations

  • Scripts (6 tools) - Remote script execution and management

  • Discovery (6 tools) - Low-level discovery and auto-registration

  • Services (5 tools) - Business service monitoring and SLA tracking

๐ŸŽจ Visualization & Reporting

  • Maps (12 tools) - Network topology and value/icon mapping

  • Dashboards (4 tools) - Custom visualization and widget management

๐Ÿ“ข Communication & Integration

  • Media (7 tools) - Notification channels and alert delivery

  • Users (6 tools) - User and user group management

  • Configuration (3 tools) - Import/export and backup functionality

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+

  • npm or yarn

  • Zabbix server with API access

  • Valid Zabbix credentials (API token or username/password)

Installation

git clone <repository-url>
cd zabbix-mcp-server
npm install

Configuration

  1. Generate API token in Zabbix UI: Administration โ†’ General โ†’ Tokens โ†’ Create token

  2. Create .env file:

ZABBIX_API_URL=https://your-zabbix-server/api_jsonrpc.php
ZABBIX_API_TOKEN=your_api_token_here

Option 2: Username/Password Authentication

Create .env file:

ZABBIX_API_URL=https://your-zabbix-server/api_jsonrpc.php
ZABBIX_USERNAME=Admin
ZABBIX_PASSWORD=your_password

Running the Server

# Start the MCP server (stdio mode)
npm start

# Or run directly
node src/index.js

# HTTP mode (for development)
MCP_TRANSPORT_MODE=http npm start

Log output:

[INFO] [Zabbix API Client] Using API token authentication (Zabbix 5.4+)
[INFO] [Zabbix API Client] Connected to Zabbix API version: 6.0.0
[INFO] MCP Server started successfully

๐Ÿ”Œ MCP Configuration

To use this server with Claude Desktop, Cursor IDE, or other MCP-compatible clients, you need to add it to your MCP configuration file.

For Claude Desktop (Windows/Mac/Linux)

Add the following configuration to your claude_desktop_config.json file:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Linux: ~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "zabbix-mcp": {
      "command": "node",
      "args": [
        "/path/to/your/zabbix-mcp-server/src/index.js"
      ],
      "env": {
        "ZABBIX_API_URL": "https://your-zabbix-server/api_jsonrpc.php",
        "ZABBIX_API_TOKEN": "your_api_token_here"
      }
    }
  }
}

Username/Password Authentication

{
  "mcpServers": {
    "zabbix-mcp": {
      "command": "node",
      "args": [
        "/path/to/your/zabbix-mcp-server/src/index.js"
      ],
      "env": {
        "ZABBIX_API_URL": "https://your-zabbix-server/api_jsonrpc.php",
        "ZABBIX_USERNAME": "Admin",
        "ZABBIX_PASSWORD": "your_password"
      }
    }
  }
}

For Cursor IDE

Add the following configuration to your mcp.json file in your Cursor settings directory:

  • Windows: %APPDATA%\Cursor\User\mcp.json

  • Mac: ~/Library/Application Support/Cursor/User/mcp.json

  • Linux: ~/.config/Cursor/User/mcp.json

{
  "mcpServers": {
    "zabbix-mcp": {
      "command": "node",
      "args": [
        "/path/to/your/zabbix-mcp-server/src/index.js"
      ],
      "env": {
        "ZABBIX_API_URL": "https://your-zabbix-server/api_jsonrpc.php",
        "ZABBIX_API_TOKEN": "your_api_token_here"
      }
    }
  }
}

Username/Password Authentication

{
  "mcpServers": {
    "zabbix-mcp": {
      "command": "node",
      "args": [
        "/path/to/your/zabbix-mcp-server/src/index.js"
      ],
      "env": {
        "ZABBIX_API_URL": "https://your-zabbix-server/api_jsonrpc.php",
        "ZABBIX_USERNAME": "Admin",
        "ZABBIX_PASSWORD": "your_password"
      }
    }
  }
}

Configuration Notes

  • Replace the path: Update /path/to/your/zabbix-mcp-server/src/index.js with the actual path to your installation

  • Replace credentials: Update with your actual Zabbix server URL and credentials

  • Server name: You can change zabbix-mcp to any name you prefer

  • Additional variables: Add any other environment variables as needed (e.g., LOG_LEVEL=debug)

Getting Your Zabbix Credentials

Prerequisites:

  • Zabbix server version 5.4 or higher

  • User account with appropriate permissions

  • Access to Zabbix web interface

Step-by-step instructions:

  1. Log in to your Zabbix web interface

  2. Navigate to Administration โ†’ General โ†’ Tokens

  3. Click Create token button

  4. Configure your token:

    • Name: MCP Server Token (or any descriptive name)

    • User: Select the user account

    • Expires at: Set expiration date (optional, recommended for security)

    • Description: Optional description

  5. Click Add to create the token

  6. Copy the generated token (you won't be able to see it again)

  7. Paste the token into your MCP configuration file

For Username/Password Authentication

Prerequisites:

  • Zabbix server version 5.0 or higher

  • Valid user account with API access permissions

Required information:

  • ZABBIX_API_URL: Your Zabbix server API endpoint (usually https://your-server/api_jsonrpc.php)

  • ZABBIX_USERNAME: Your Zabbix username (e.g., Admin)

  • ZABBIX_PASSWORD: Your Zabbix password

Testing Your Configuration

You can verify your configuration works by testing it with curl:

API Token Test

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "apiinfo.version",
    "params": {},
    "auth": "your_api_token_here",
    "id": 1
  }' \
  https://your-zabbix-server/api_jsonrpc.php

Username/Password Test

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "user.login",
    "params": {
      "username": "Admin",
      "password": "your_password"
    },
    "id": 1
  }' \
  https://your-zabbix-server/api_jsonrpc.php

Security Notes

  • Keep credentials secure and don't share them publicly

  • Use API tokens in production environments for better security

  • Set token expiration dates for enhanced security

  • Use HTTPS for your Zabbix server to encrypt communication

  • Limit user permissions to only what's needed for monitoring

  • Regularly rotate API tokens and passwords

Restart Required

After updating your MCP configuration, restart Claude Desktop or your IDE for the changes to take effect.

Troubleshooting MCP Configuration

Common Issues

  1. Server not appearing in client

    • Verify the path to src/index.js is correct

    • Check that Node.js is installed and accessible

    • Restart your MCP client

  2. Authentication errors

    • Verify your Zabbix server URL is correct

    • Check that your API token or credentials are valid

    • Ensure your user has API access permissions

  3. Connection timeouts

    • Check network connectivity to your Zabbix server

    • Verify firewall settings allow the connection

    • Test with curl commands above

Debug Mode

Add debug logging to troubleshoot issues:

{
  "mcpServers": {
    "zabbix-mcp": {
      "command": "node",
      "args": ["/path/to/your/zabbix-mcp-server/src/index.js"],
      "env": {
        "ZABBIX_API_URL": "https://your-zabbix-server/api_jsonrpc.php",
        "ZABBIX_API_TOKEN": "your_api_token_here",
        "LOG_LEVEL": "debug"
      }
    }
  }
}

๐Ÿ”ง Modern API Interface

The server provides a clean, modern interface for programmatic access:

const { request, getVersion, checkConnection } = require('./src/api/zabbix-client');

// Get API version
const version = await getVersion();
console.log(`Zabbix API Version: ${version}`);

// Check connection
const connected = await checkConnection();
console.log(`Connected: ${connected}`);

// Make API calls
const hosts = await request('host.get', {
    output: ['hostid', 'host', 'name'],
    selectInterfaces: ['interfaceid', 'ip']
});

const problems = await request('problem.get', {
    output: 'extend',
    selectTags: 'extend',
    recent: true
});

Available Methods:

  • getClient() - Get authenticated client instance

  • request(method, params) - Make API calls

  • checkConnection() - Check connection status

  • disconnect() - Disconnect and cleanup

  • getVersion() - Get API version

๐Ÿ“š Comprehensive Tool Reference

๐Ÿ” Authentication Tools (3 tools)

zabbix_login

Authenticate with Zabbix server and establish session

  • Parameters: username, password

  • Returns: Authentication token and session info

  • Note: Automatic with API token authentication

zabbix_logout

Terminate current Zabbix session

  • Parameters: None (uses current session)

  • Returns: Logout confirmation

zabbix_get_api_info

Get Zabbix API version and server information

  • Parameters: None

  • Returns: API version, server details

๐Ÿ–ฅ๏ธ Host Management Tools (3 tools)

zabbix_get_hosts

Retrieve hosts with comprehensive filtering options

  • Parameters: hostids, groupids, output, selectGroups, selectInterfaces, etc.

  • Returns: Array of host objects with detailed information

zabbix_create_host

Create new host with interfaces and group assignments

  • Parameters: host, name, groups, interfaces, templates, inventory, etc.

  • Returns: Created host ID and confirmation

zabbix_update_host

Update existing host configuration

  • Parameters: hostid, host, name, groups, interfaces, status, etc.

  • Returns: Update confirmation

๐Ÿ‘ฅ Host Groups Tools (4 tools)

zabbix_get_hostgroups

Get host groups with filtering and host information

  • Parameters: groupids, output, selectHosts, filter, search, etc.

  • Returns: Array of host group objects

zabbix_create_hostgroup

Create new host group

  • Parameters: name

  • Returns: Created group ID

zabbix_update_hostgroup

Update host group properties

  • Parameters: groupid, name

  • Returns: Update confirmation

zabbix_delete_hostgroups

Delete multiple host groups

  • Parameters: groupids (array)

  • Returns: Deletion confirmation

๐Ÿ“Š Items Management Tools (5 tools)

zabbix_get_items

Retrieve monitoring items with comprehensive options

  • Parameters: itemids, hostids, groupids, output, selectHosts, etc.

  • Returns: Array of item objects with monitoring data

zabbix_create_item

Create new monitoring item

  • Parameters: hostid, name, key_, type, value_type, delay, etc.

  • Returns: Created item ID

zabbix_update_item

Update existing item configuration

  • Parameters: itemid, name, key_, delay, status, etc.

  • Returns: Update confirmation

zabbix_delete_items

Delete multiple items

  • Parameters: itemids (array)

  • Returns: Deletion confirmation

zabbix_get_item_history

Retrieve historical data for items

  • Parameters: itemids, history, time_from, time_till, limit, etc.

  • Returns: Historical data points

โš ๏ธ Triggers Management Tools (4 tools)

zabbix_get_triggers

Get triggers with filtering and dependency information

  • Parameters: triggerids, hostids, groupids, output, selectHosts, etc.

  • Returns: Array of trigger objects

zabbix_create_trigger

Create new trigger with expression and dependencies

  • Parameters: description, expression, priority, status, etc.

  • Returns: Created trigger ID

zabbix_update_trigger

Update trigger configuration

  • Parameters: triggerid, description, expression, priority, etc.

  • Returns: Update confirmation

zabbix_delete_triggers

Delete multiple triggers

  • Parameters: triggerids (array)

  • Returns: Deletion confirmation

๐Ÿšจ Problems Management Tools (2 tools)

zabbix_get_problems

Get current problems with filtering options

  • Parameters: hostids, groupids, objectids, severities, time_from, etc.

  • Returns: Array of current problems

zabbix_acknowledge_problems

Acknowledge problems with messages and actions

  • Parameters: eventids, message, action, severity, etc.

  • Returns: Acknowledgment confirmation

๐Ÿ“ˆ History Tools (3 tools)

zabbix_get_history

Retrieve historical monitoring data

  • Parameters: history, itemids, time_from, time_till, limit, etc.

  • Returns: Historical data points

Get trend data for long-term analysis

  • Parameters: itemids, time_from, time_till, limit

  • Returns: Aggregated trend data

zabbix_get_events

Retrieve system events and alerts

  • Parameters: eventids, hostids, objectids, time_from, etc.

  • Returns: Array of events

๐Ÿ”ง Maintenance Tools (4 tools)

zabbix_get_maintenances

Get maintenance periods with host and group information

  • Parameters: maintenanceids, hostids, groupids, output, etc.

  • Returns: Array of maintenance periods

zabbix_create_maintenance

Create new maintenance window

  • Parameters: name, active_since, active_till, hosts, groups, etc.

  • Returns: Created maintenance ID

zabbix_update_maintenance

Update maintenance period configuration

  • Parameters: maintenanceid, name, active_since, active_till, etc.

  • Returns: Update confirmation

zabbix_delete_maintenances

Delete maintenance periods

  • Parameters: maintenanceids (array)

  • Returns: Deletion confirmation

๐Ÿ‘ค User Management Tools (6 tools)

zabbix_get_users

Get users with group and media information

  • Parameters: userids, output, selectUsrgrps, selectMedias, etc.

  • Returns: Array of user objects

zabbix_create_user

Create new user account

  • Parameters: username, passwd, name, surname, usrgrps, etc.

  • Returns: Created user ID

zabbix_update_user

Update user account information

  • Parameters: userid, username, name, surname, passwd, etc.

  • Returns: Update confirmation

zabbix_delete_users

Delete user accounts

  • Parameters: userids (array)

  • Returns: Deletion confirmation

zabbix_get_usergroups

Get user groups with permissions

  • Parameters: usrgrpids, output, selectUsers, selectRights, etc.

  • Returns: Array of user group objects

zabbix_create_usergroup

Create new user group

  • Parameters: name, gui_access, users_status, rights, etc.

  • Returns: Created group ID

๐Ÿ“‹ Template Management Tools (6 tools)

zabbix_get_templates

Get templates with items, triggers, and graphs

  • Parameters: templateids, hostids, groupids, output, etc.

  • Returns: Array of template objects

zabbix_create_template

Create new template

  • Parameters: host, name, groups, description, etc.

  • Returns: Created template ID

zabbix_update_template

Update template configuration

  • Parameters: templateid, host, name, groups, etc.

  • Returns: Update confirmation

zabbix_delete_templates

Delete templates

  • Parameters: templateids (array)

  • Returns: Deletion confirmation

Link templates to hosts

  • Parameters: hostids, templateids

  • Returns: Link confirmation

Unlink templates from hosts

  • Parameters: hostids, templateids

  • Returns: Unlink confirmation

๐Ÿ”ง Scripts Management Tools (6 tools)

zabbix_get_scripts

Get scripts with filtering by type and scope

  • Parameters: scriptids, hostids, groupids, output, etc.

  • Returns: Array of script objects

zabbix_create_script

Create script for remote execution

  • Parameters: name, command, type, scope, host_access, etc.

  • Returns: Created script ID

zabbix_update_script

Update script configuration

  • Parameters: scriptid, name, command, type, etc.

  • Returns: Update confirmation

zabbix_delete_scripts

Delete scripts

  • Parameters: scriptids (array)

  • Returns: Deletion confirmation

zabbix_execute_script

Execute script on hosts

  • Parameters: scriptid, hostid, manualinput

  • Returns: Execution result

zabbix_get_script_execution_history

Get script execution history from events

  • Parameters: hostids, time_from, time_till, limit

  • Returns: Execution history

๐Ÿ” Discovery Tools (6 tools)

zabbix_get_discovery_rules

Get low-level discovery rules

  • Parameters: itemids, hostids, output, selectItemPrototypes, etc.

  • Returns: Array of LLD rules

zabbix_create_discovery_rule

Create LLD rule with prototypes

  • Parameters: hostid, name, key_, delay, filter, etc.

  • Returns: Created rule ID

zabbix_update_discovery_rule

Update LLD rule configuration

  • Parameters: itemid, name, key_, delay, etc.

  • Returns: Update confirmation

zabbix_delete_discovery_rules

Delete LLD rules

  • Parameters: ruleids (array)

  • Returns: Deletion confirmation

zabbix_get_discovered_hosts

Get hosts discovered by network discovery

  • Parameters: dhostids, druleids, output, etc.

  • Returns: Array of discovered hosts

zabbix_get_discovered_services

Get services discovered by network discovery

  • Parameters: dserviceids, dhostids, output, etc.

  • Returns: Array of discovered services

๐Ÿ“ข Media & Notifications Tools (7 tools)

zabbix_get_media_types

Get media types with filtering

  • Parameters: mediatypeids, output, filter, search, etc.

  • Returns: Array of media type objects

zabbix_create_media_type

Create media type for notifications

  • Parameters: name, type, smtp_server, smtp_helo, etc.

  • Returns: Created media type ID

zabbix_update_media_type

Update media type configuration

  • Parameters: mediatypeid, name, type, status, etc.

  • Returns: Update confirmation

zabbix_delete_media_types

Delete media types

  • Parameters: mediatypeids (array)

  • Returns: Deletion confirmation

zabbix_test_media_type

Test media type delivery

  • Parameters: mediatypeid, sendto, subject, message

  • Returns: Test result

zabbix_get_user_media

Get user notification settings

  • Parameters: userids, mediatypeids, output, etc.

  • Returns: User media configurations

zabbix_get_alerts

Get sent notifications and alerts

  • Parameters: alertids, actionids, eventids, time_from, etc.

  • Returns: Array of alert records

โšก Actions & Escalations Tools (6 tools)

zabbix_get_actions

Get actions with comprehensive filtering

  • Parameters: actionids, hostids, triggerids, output, etc.

  • Returns: Array of action objects

zabbix_create_action

Create automated response action

  • Parameters: name, eventsource, status, filter, operations, etc.

  • Returns: Created action ID

zabbix_update_action

Update action configuration

  • Parameters: actionid, name, status, filter, etc.

  • Returns: Update confirmation

zabbix_delete_actions

Delete actions

  • Parameters: actionids (array)

  • Returns: Deletion confirmation

zabbix_get_correlations

Get event correlations

  • Parameters: correlationids, output, filter, etc.

  • Returns: Array of correlation objects

zabbix_create_correlation

Create event correlation rule

  • Parameters: name, filter, operations, status

  • Returns: Created correlation ID

๐Ÿ—บ๏ธ Maps Management Tools (12 tools)

Value Maps (4 tools)

  • zabbix_get_value_maps - Get value maps for numeric-to-text conversion

  • zabbix_create_value_map - Create value mapping rules

  • zabbix_update_value_map - Update value map configuration

  • zabbix_delete_value_maps - Delete value maps

Icon Maps (4 tools)

  • zabbix_get_icon_maps - Get icon maps for inventory-based icons

  • zabbix_create_icon_map - Create icon mapping rules

  • zabbix_update_icon_map - Update icon map configuration

  • zabbix_delete_icon_maps - Delete icon maps

Network Maps (4 tools)

  • zabbix_get_maps - Get network topology maps

  • zabbix_create_map - Create network map with elements and links

  • zabbix_update_map - Update map configuration

  • zabbix_delete_maps - Delete network maps

๐Ÿ“Š Dashboard Management Tools (4 tools)

zabbix_get_dashboards

Get dashboards with pages and widgets

  • Parameters: dashboardids, output, selectPages, etc.

  • Returns: Array of dashboard objects

zabbix_create_dashboard

Create dashboard with pages and widgets

  • Parameters: name, pages, users, userGroups, etc.

  • Returns: Created dashboard ID

zabbix_update_dashboard

Update dashboard configuration

  • Parameters: dashboardid, name, pages, etc.

  • Returns: Update confirmation

zabbix_delete_dashboards

Delete dashboards

  • Parameters: dashboardids (array)

  • Returns: Deletion confirmation

๐ŸŒ Proxy Management Tools (4 tools)

zabbix_get_proxies

Get proxies with host and group information

  • Parameters: proxyids, output, selectHosts, etc.

  • Returns: Array of proxy objects

zabbix_create_proxy

Create proxy for distributed monitoring

  • Parameters: name, operating_mode, address, port, etc.

  • Returns: Created proxy ID

zabbix_update_proxy

Update proxy configuration

  • Parameters: proxyid, name, operating_mode, etc.

  • Returns: Update confirmation

zabbix_delete_proxies

Delete proxies

  • Parameters: proxyids (array)

  • Returns: Deletion confirmation

๐Ÿ”„ Configuration Management Tools (3 tools)

zabbix_export_configuration

Export Zabbix configuration as XML/JSON

  • Parameters: format, options (hosts, templates, etc.)

  • Returns: Exported configuration string

zabbix_import_configuration

Import configuration from XML/JSON

  • Parameters: format, source, rules

  • Returns: Import result

zabbix_import_compare_configuration

Compare configuration without importing

  • Parameters: format, source, rules

  • Returns: Comparison results

๐Ÿข Business Services Tools (5 tools)

zabbix_get_services

Get business services with hierarchy

  • Parameters: serviceids, parentids, output, etc.

  • Returns: Array of service objects

zabbix_create_service

Create business service for IT service monitoring

  • Parameters: name, algorithm, parents, children, etc.

  • Returns: Created service ID

zabbix_update_service

Update service configuration

  • Parameters: serviceid, name, algorithm, etc.

  • Returns: Update confirmation

zabbix_delete_services

Delete business services

  • Parameters: serviceids (array)

  • Returns: Deletion confirmation

zabbix_get_service_sla

Get SLA data for services

  • Parameters: serviceids, intervals

  • Returns: SLA calculation results

๐Ÿ—๏ธ Architecture

Project Structure

โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ api/                 # API layer modules
โ”‚   โ”‚   โ”œโ”€โ”€ client.js        # Zabbix API client
โ”‚   โ”‚   โ”œโ”€โ”€ hosts.js         # Host management API
โ”‚   โ”‚   โ”œโ”€โ”€ items.js         # Items API
โ”‚   โ”‚   โ”œโ”€โ”€ triggers.js      # Triggers API
โ”‚   โ”‚   โ”œโ”€โ”€ maps.js          # Maps API
โ”‚   โ”‚   โ”œโ”€โ”€ dashboards.js    # Dashboards API
โ”‚   โ”‚   โ”œโ”€โ”€ services.js      # Business services API
โ”‚   โ”‚   โ””โ”€โ”€ ...              # Other API modules
โ”‚   โ”œโ”€โ”€ tools/               # MCP tools layer
โ”‚   โ”‚   โ”œโ”€โ”€ auth.js          # Authentication tools
โ”‚   โ”‚   โ”œโ”€โ”€ hosts.js         # Host management tools
โ”‚   โ”‚   โ”œโ”€โ”€ items.js         # Items tools
โ”‚   โ”‚   โ”œโ”€โ”€ triggers.js      # Triggers tools
โ”‚   โ”‚   โ”œโ”€โ”€ maps.js          # Maps tools
โ”‚   โ”‚   โ”œโ”€โ”€ dashboards.js    # Dashboard tools
โ”‚   โ”‚   โ”œโ”€โ”€ services.js      # Services tools
โ”‚   โ”‚   โ””โ”€โ”€ index.js         # Tool registration
โ”‚   โ”œโ”€โ”€ utils/
โ”‚   โ”‚   โ””โ”€โ”€ logger.js        # Logging utility
โ”‚   โ””โ”€โ”€ index.js             # Main server entry point
โ”œโ”€โ”€ docs/                    # Documentation
โ”œโ”€โ”€ examples/                # Usage examples
โ””โ”€โ”€ scripts/                 # Utility scripts

Design Principles

  1. Modular Architecture: Clean separation between API layer and tools layer

  2. Type Safety: Comprehensive Zod schema validation for all inputs

  3. Error Handling: Robust error handling with detailed logging

  4. Consistency: Uniform patterns across all tool categories

  5. Extensibility: Easy to add new tools and functionality

๐Ÿ”ง Development

Adding New Tools

  1. Create API Module (src/api/newmodule.js):

const { request } = require('./zabbix-client');

async function getItems(params = {}) {
    return await request('item.get', params);
}

module.exports = { newModuleApi: { getItems } };
  1. Create Tools Module (src/tools/newmodule.js):

const { logger } = require('../utils/logger');
const api = require('../api');
const { z } = require('zod');

function registerTools(server) {
    server.tool('tool_name', 'Description', {
        param: z.string().describe('Parameter description')
    }, async (args) => {
        // Implementation
    });
}

module.exports = { registerTools };
  1. Register Module in src/api/index.js and src/tools/index.js

Schema Validation

All tools use Zod schemas for type-safe validation:

const schema = z.object({
    hostid: z.string().describe('Host ID'),
    name: z.string().min(1).describe('Host name'),
    groups: z.array(z.object({
        groupid: z.string()
    })).min(1).describe('Host groups')
});

Error Handling

Consistent error handling pattern:

try {
    const result = await api.someApi.someMethod(params);
    logger.info(`Operation successful: ${result.length} items`);
    return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
} catch (error) {
    logger.error('Operation failed:', error.message);
    throw error;
}

๐Ÿงช Testing

# Run all tests
npm test

# Run specific test suites
npm run test:unit
npm run test:integration

# Run with coverage
npm run test:coverage

๐Ÿ“ Configuration

Environment Variables

# Required
ZABBIX_API_URL=https://your-zabbix-server/api_jsonrpc.php
ZABBIX_API_TOKEN=your_api_token_here

# Optional
LOG_LEVEL=info
CACHE_TTL=300
ZABBIX_REQUEST_TIMEOUT=120000
MCP_TRANSPORT_MODE=stdio

Username/Password Authentication

# Required
ZABBIX_API_URL=https://your-zabbix-server/api_jsonrpc.php
ZABBIX_USERNAME=Admin
ZABBIX_PASSWORD=your_password

# Optional
LOG_LEVEL=info
CACHE_TTL=300
ZABBIX_REQUEST_TIMEOUT=120000
MCP_TRANSPORT_MODE=stdio

Advanced Configuration

Create config/zabbix.json:

{
  "api": {
    "timeout": 30000,
    "retries": 3,
    "cache": {
      "enabled": true,
      "ttl": 300
    }
  },
  "logging": {
    "level": "info",
    "format": "json"
  }
}

๐Ÿš€ Deployment

Docker

# Build image
docker build -t zabbix-mcp-server .

# Run container (API Token)
docker run -d \
  --name zabbix-mcp \
  -e ZABBIX_API_URL=https://your-zabbix-server/api_jsonrpc.php \
  -e ZABBIX_API_TOKEN=your_api_token_here \
  zabbix-mcp-server

# Run container (Username/Password)
docker run -d \
  --name zabbix-mcp \
  -e ZABBIX_API_URL=https://your-zabbix-server/api_jsonrpc.php \
  -e ZABBIX_USERNAME=Admin \
  -e ZABBIX_PASSWORD=your_password \
  zabbix-mcp-server

Docker Compose

version: '3.8'
services:
  zabbix-mcp:
    build: .
    environment:
      # API Token Authentication (Recommended)
      - ZABBIX_API_URL=https://your-zabbix-server/api_jsonrpc.php
      - ZABBIX_API_TOKEN=your_api_token_here
      
      # Or Username/Password Authentication
      # - ZABBIX_API_URL=https://your-zabbix-server/api_jsonrpc.php
      # - ZABBIX_USERNAME=Admin
      # - ZABBIX_PASSWORD=your_password
    restart: unless-stopped

๐Ÿ“Š Monitoring & Observability

The server includes comprehensive logging and monitoring:

  • Structured Logging: JSON-formatted logs with correlation IDs

  • Performance Metrics: Request timing and success rates

  • Health Checks: Built-in health monitoring endpoints

  • Error Tracking: Detailed error reporting and stack traces

๐Ÿค Contributing

  1. Fork the repository

  2. Create a feature branch (git checkout -b feature/amazing-feature)

  3. Commit your changes (git commit -m 'Add amazing feature')

  4. Push to the branch (git push origin feature/amazing-feature)

  5. Open a Pull Request

Development Guidelines

  • Follow existing code patterns and conventions

  • Add comprehensive tests for new functionality

  • Update documentation for new tools

  • Ensure all tools have proper Zod schema validation

  • Include error handling and logging

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

๐Ÿ“ž Support

  • Documentation: Check the comprehensive tool reference above

  • Issues: Report bugs and feature requests via GitHub Issues

  • Community: Join discussions in GitHub Discussions

  • Enterprise Support: Contact for enterprise support options


Built with โค๏ธ for the Zabbix monitoring community

Available Tools

102 tools
zabbix_acknowledge_eventB

Acknowledges one or more events/problems in Zabbix.

Inputs: eventids (required), action, message, severity, +1 more.

zabbix_create_actionB

Create a new action in Zabbix for automated responses to events

Inputs: name (required), filter (required), operations (required), eventsource (required), +11 more.

zabbix_create_correlationC

Create a new event correlation in Zabbix

Inputs: name (required), filter (required), operations (required), status, +1 more.

zabbix_create_dashboardB

Create a new dashboard in Zabbix for data visualization

Inputs: name (required), pages (required), users, userid, +4 more.

zabbix_create_discovery_ruleC

Create a new Low-Level Discovery (LLD) rule in Zabbix

Inputs: key_ (required), name (required), type (required), hostid (required), +8 more.

zabbix_create_hostgroupB

Create a new host group in Zabbix

Inputs: name (required).

zabbix_create_icon_mapA

Create a new icon map in Zabbix for mapping inventory fields to icons

Inputs: name (required), mappings (required), default_iconid (required).

zabbix_create_itemC

Create a new item in Zabbix

Inputs: key_ (required), name (required), hostid (required), type, +10 more.

zabbix_create_maintenanceB

Create a new maintenance period in Zabbix

Inputs: name (required), active_till (required), timeperiods (required), active_since (required), +5 more.

zabbix_create_mapB

Create a new network map in Zabbix for network topology visualization

Inputs: name (required), width (required), height (required), urls, +30 more.

zabbix_create_media_typeB

Create a new media type in Zabbix (Email, SMS, Webhook, Script, etc.)

Inputs: name (required), type (required), passwd, status, +23 more.

zabbix_create_proxyC

Create a new proxy in Zabbix for distributed monitoring

Inputs: name (required), operating_mode (required), port, hosts, +18 more.

zabbix_create_scriptB

Create a new script in Zabbix

Inputs: name (required), type (required), scope (required), command (required), +13 more.

zabbix_create_serviceB

Create a new business service in Zabbix for IT service monitoring

Inputs: name (required), algorithm (required), tags, weight, +8 more.

zabbix_create_templateB

Create a new template in Zabbix

Inputs: host (required), groups (required), name, description.

zabbix_create_triggerB

Create a new trigger in Zabbix

Inputs: expression (required), description (required), url, status, +2 more.

zabbix_create_userB

Create a new user in Zabbix

Inputs: passwd (required), usrgrps (required), username (required), url, +10 more.

zabbix_create_usergroupB

Create a new user group in Zabbix

Inputs: name (required), rights, debug_mode, gui_access, +1 more.

zabbix_create_value_mapA

Create a new value map in Zabbix for mapping numeric values to text

Inputs: name (required), mappings (required), hostid.

zabbix_delete_actionsC

Delete actions from Zabbix

Inputs: actionids (required).

zabbix_delete_correlationsB

Delete event correlations from Zabbix

Inputs: correlationids (required).

zabbix_delete_dashboardsB

Delete dashboards from Zabbix

Inputs: dashboardids (required).

zabbix_delete_discovery_rulesB

Delete Low-Level Discovery (LLD) rules from Zabbix

Inputs: itemids (required).

zabbix_delete_hostgroupsC

Delete host groups from Zabbix

Inputs: groupids (required).

zabbix_delete_icon_mapsB

Delete icon maps from Zabbix

Inputs: iconmapids (required).

zabbix_delete_itemsB

Delete items from Zabbix

Inputs: itemids (required).

zabbix_delete_maintenanceA

Delete maintenance periods from Zabbix

Inputs: maintenanceids (required).

zabbix_delete_mapsB

Delete network maps from Zabbix

Inputs: sysmapids (required).

zabbix_delete_media_typesA

Delete media types from Zabbix

Inputs: mediatypeids (required).

zabbix_delete_proxiesC

Delete proxies from Zabbix

Inputs: proxyids (required).

zabbix_delete_scriptsB

Delete scripts from Zabbix

Inputs: scriptids (required).

zabbix_delete_servicesB

Delete business services from Zabbix

Inputs: serviceids (required).

zabbix_delete_templatesC

Delete templates from Zabbix

Inputs: templateids (required).

zabbix_delete_triggersC

Delete triggers from Zabbix

Inputs: triggerids (required).

zabbix_delete_usersB

Delete users from Zabbix

Inputs: userids (required).

zabbix_delete_value_mapsB

Delete value maps from Zabbix

Inputs: valuemapids (required).

zabbix_execute_scriptB

Execute a script on a host in Zabbix

Inputs: scriptid (required), hostid, eventid, manualinput.

zabbix_export_configurationB

Export Zabbix configuration as XML or JSON

Inputs: format (required), options (required).

zabbix_get_actionable_itemsA

Get actionable items requiring immediate human intervention including unacknowledged problems, long-running issues, and unavailable hosts. Prioritized by urgency.

Inputs: options.

zabbix_get_actionsB

Get actions from Zabbix with filtering and output options

Inputs: limit, filter, output, search, +13 more.

zabbix_get_alertsC

Get alerts (sent notifications) from Zabbix

Inputs: limit, filter, output, search, +13 more.

zabbix_get_api_versionA

Retrieves the version of the Zabbix API.

Inputs: no named parameters.

zabbix_get_correlationsC

Get event correlations from Zabbix

Inputs: limit, filter, output, search, +5 more.

zabbix_get_critical_issuesA

Get critical and high severity issues requiring immediate attention. Returns only critical/high problems with essential context, acknowledgment status, and duration.

Inputs: options.

zabbix_get_dashboardsA

Get dashboards from Zabbix with filtering and output options

Inputs: limit, filter, output, search, +6 more.

zabbix_get_discovered_hostsA

Get hosts discovered by network discovery or LLD rules

Inputs: limit, filter, output, search, +6 more.

zabbix_get_discovered_servicesB

Get services discovered by network discovery rules

Inputs: limit, filter, output, search, +7 more.

zabbix_get_discovery_rulesC

Get Low-Level Discovery (LLD) rules from Zabbix with filtering and output options

Inputs: limit, filter, output, search, +11 more.

zabbix_get_eventsC

Retrieves events from Zabbix with filtering options.

Inputs: tags, limit, value, object, +17 more.

zabbix_get_historyC

Get historical data for items from Zabbix

Inputs: itemids (required), limit, output, history, +4 more.

zabbix_get_hostgroupsB

Get host groups from Zabbix with filtering and output options

Inputs: limit, output, groupids, sortfield, +4 more.

zabbix_get_icon_mapsB

Get icon maps from Zabbix with filtering and output options

Inputs: limit, filter, output, search, +4 more.

zabbix_get_infrastructure_healthB

Get overall infrastructure health summary with metrics optimized for LLM consumption. Returns health score, problem counts by severity, host statistics, and critical action items.

Inputs: options.

zabbix_get_item_history_rangeA

Get historical data for a specific item over a time range with automatic value type detection

Inputs: itemid (required), limit, hours_back, include_item_info.

zabbix_get_itemsC

Get items from Zabbix with filtering and output options

Inputs: limit, filter, output, search, +9 more.

zabbix_get_last_24_hours_summaryA

Get activity summary for the last 24 hours including new problems, resolved issues, and recent events. Shows trends and net change in problem count.

Inputs: options.

zabbix_get_latest_dataC

Get latest data for items from Zabbix

Inputs: limit, output, hostids, itemids, +1 more.

zabbix_get_maintenanceC

Get maintenance periods from Zabbix with filtering and output options

Inputs: limit, filter, output, search, +8 more.

zabbix_get_mapsB

Get network maps from Zabbix with filtering and output options

Inputs: limit, filter, output, search, +12 more.

zabbix_get_media_typesB

Get media types from Zabbix with filtering and output options

Inputs: limit, filter, output, search, +11 more.

zabbix_get_performance_alertsA

Get performance alerts and resource-related issues with context. Filters performance problems by resource type and severity.

Inputs: options.

zabbix_get_problemsB

Retrieves current problems from Zabbix with filtering options.

Inputs: tags, limit, output, recent, +14 more.

zabbix_get_proxiesC

Get proxies from Zabbix with filtering and output options

Inputs: limit, filter, output, search, +5 more.

zabbix_get_script_execution_historyB

Get history of script executions from Zabbix events

Inputs: limit, hostids, scriptids, sortorder, +2 more.

zabbix_get_scriptsC

Get scripts from Zabbix with filtering and output options

Inputs: limit, filter, output, search, +7 more.

zabbix_get_servicesB

Get business services from Zabbix with filtering and output options

Inputs: limit, filter, output, search, +11 more.

zabbix_get_service_slaB

Get SLA (Service Level Agreement) data for business services

Inputs: intervals (required), serviceids (required).

zabbix_get_system_overviewA

Get comprehensive system overview combining problems, maintenance windows, and key metrics in one call. Provides high-level system status and activity level.

Inputs: options.

zabbix_get_templatesB

Get templates from Zabbix with filtering and output options

Inputs: limit, filter, output, search, +7 more.

zabbix_get_triggersB

Get triggers from Zabbix with filtering and output options

Inputs: limit, filter, output, search, +12 more.

zabbix_get_usergroupsC

Get user groups from Zabbix with filtering and output options

Inputs: limit, filter, output, search, +6 more.

zabbix_get_user_mediaB

Get user media (notification settings) from Zabbix

Inputs: limit, filter, output, userids, +6 more.

zabbix_get_usersC

Get users from Zabbix with filtering and output options

Inputs: limit, filter, output, search, +7 more.

zabbix_get_value_mapsC

Get value maps from Zabbix with filtering and output options

Inputs: limit, filter, output, search, +4 more.

zabbix_host_createA

Creates a new host in Zabbix with specified groups, interfaces, and optional templates/macros.

Inputs: host (required), groups (required), interfaces (required), name, +12 more.

zabbix_host_deleteB

Deletes one or more hosts from Zabbix.

Inputs: hostids (required).

zabbix_host_getA

Retrieves Zabbix host information. Can filter by various criteria including direct IDs or by resolving host identifiers (names, IPs).

Inputs: limit, filter, output, search, +13 more.

zabbix_host_updateA

Updates properties of an existing Zabbix host. Provide only the hostid and the properties to change.

Inputs: hostid (required), host, name, groups, +11 more.

zabbix_import_compare_configurationA

Compare configuration for import without actually importing

Inputs: rules (required), format (required), source (required).

zabbix_import_configurationC

Import Zabbix configuration from XML or JSON

Inputs: rules (required), format (required), source (required).

zabbix_loginB

Establishes an authenticated session with the Zabbix API. The API client module handles token caching and re-login on demand.

Inputs: no named parameters.

zabbix_logoutA

Terminates the current Zabbix API session within the API client module.

Inputs: no named parameters.

zabbix_test_media_typeA

Test media type delivery in Zabbix

Inputs: sendto (required), mediatypeid (required), message, subject.

zabbix_update_actionB

Update an existing action in Zabbix

Inputs: actionid (required), name, filter, status, +7 more.

zabbix_update_dashboardB

Update an existing dashboard in Zabbix

Inputs: dashboardid (required), name, pages, users, +5 more.

zabbix_update_discovery_ruleB

Update an existing Low-Level Discovery (LLD) rule in Zabbix

Inputs: itemid (required), key_, name, type, +5 more.

zabbix_update_hostgroupC

Update an existing host group in Zabbix

Inputs: name (required), groupid (required).

zabbix_update_icon_mapB

Update an existing icon map in Zabbix

Inputs: iconmapid (required), name, mappings, default_iconid.

zabbix_update_itemB

Update an existing item in Zabbix

Inputs: itemid (required), key_, name, type, +7 more.

zabbix_update_maintenanceB

Update an existing maintenance period in Zabbix

Inputs: maintenanceid (required), name, hostids, groupids, +4 more.

zabbix_update_mapB

Update an existing network map in Zabbix

Inputs: sysmapid (required), name, urls, lines, +11 more.

zabbix_update_media_typeB

Update an existing media type in Zabbix

Inputs: mediatypeid (required), name, type, passwd, +6 more.

zabbix_update_proxyB

Update an existing proxy in Zabbix

Inputs: proxyid (required), name, port, hosts, +19 more.

zabbix_update_scriptC

Update an existing script in Zabbix

Inputs: scriptid (required), name, type, scope, +7 more.

zabbix_update_serviceC

Update an existing business service in Zabbix

Inputs: serviceid (required), name, tags, weight, +9 more.

zabbix_update_templateC

Update an existing template in Zabbix

Inputs: templateid (required), host, name, groups, +1 more.

zabbix_update_triggerB

Update an existing trigger in Zabbix

Inputs: triggerid (required), url, status, comments, +3 more.

zabbix_update_userC

Update an existing user in Zabbix

Inputs: userid (required), url, lang, name, +9 more.

zabbix_update_value_mapB

Update an existing value map in Zabbix

Inputs: valuemapid (required), name, hostid, mappings.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelogโ€ฆ

    TDQS

    C2.8/5.0

    Scored across 102 tools

    Disambiguation2/5

    Most tools are cleanly separated by resource type, but heavy overlap exists among the high-level monitoring summary tools (get_infrastructure_health, get_critical_issues, get_system_overview, get_last_24_hours_summary, get_actionable_items, get_performance_alerts), which all effectively return problem/issue summaries. Additionally, get_history, get_trends, get_item_history_range, and get_latest_data have overlapping data-retrieval purposes that could cause misselection.

    Naming Consistency2/5

    The predominant pattern is zabbix_verb_resource_model, but deletion verbs mix singular and plural forms inconsistently (e.g., zabbix_host_delete vs. zabbix_delete_hostgroups, zabbix_delete_users). Create/update/delete verbs are also not uniformly positioned across resources, making the naming pattern harder to predict.

    Tool Count1/5

    With 102 tools, this is an extreme over-expansion of the tool surface. While Zabbix is a broad platform, many CRUD operations could be consolidated or generated dynamically; this volume will overwhelm agents and increase selection errors.

    Completeness4/5

    The set covers the vast majority of Zabbix resource CRUD operations (hosts, items, triggers, templates, maintenance, users, media types, actions, maps, dashboards, proxies, services, discovery rules) plus import/export and health summaries. Minor gaps exist, such as missing update/delete for user groups, write operations for user media, and update support for correlations, but these are workable gaps.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      ๐Ÿ”Œ Complete MCP server for Zabbix integration - Connect AI assistants to Zabbix monitoring with 40+ tools for hosts, items, triggers, templates, problems, and more. Features read-only mode and comprehensive API coverage.
      3
      263
      GPL 3.0
    • A
      license
      B
      quality
      A
      maintenance
      Official initMAX MCP server exposing the Zabbix API to AI assistants for monitoring and managing hosts, problems, templates, dashboards, and multiple Zabbix instances. Includes correlated monitoring views, graphs, anomaly detection, capacity forecasts, and PDF reports, with scoped tokens, read-only modes, OAuth 2.1, and an admin portal. Supports Streamable HTTP, SSE, and stdio.
      84
      255
      AGPL 3.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Comprehensive MCP server providing 89 tools and 13 React UI apps for complete Zendesk Support API integration, enabling ticket, user, organization, and automation management.
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      MCP server to access the Zabbix API, providing tools to list hosts, problems, triggers, items, history, and events.
      -