zabbix-mcp-server

zabbix-mcp-server

๐Ÿ”Œ 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.

Category
Visit Server

Tools

host_get

Get hosts from Zabbix with optional filtering. Args: hostids: List of host IDs to retrieve groupids: List of host group IDs to filter by templateids: List of template IDs to filter by output: Output format (extend, shorten, or specific fields) search: Search criteria filter: Filter criteria limit: Maximum number of results Returns: str: JSON formatted list of hosts

host_create

Create a new host in Zabbix. Args: host: Host name groups: List of host groups (format: [{"groupid": "1"}]) interfaces: List of host interfaces templates: List of templates to link (format: [{"templateid": "1"}]) inventory_mode: Inventory mode (-1=disabled, 0=manual, 1=automatic) status: Host status (0=enabled, 1=disabled) Returns: str: JSON formatted creation result

host_update

Update an existing host in Zabbix. Args: hostid: Host ID to update host: New host name name: New visible name status: New status (0=enabled, 1=disabled) Returns: str: JSON formatted update result

host_delete

Delete hosts from Zabbix. Args: hostids: List of host IDs to delete Returns: str: JSON formatted deletion result

hostgroup_get

Get host groups from Zabbix. Args: groupids: List of group IDs to retrieve output: Output format search: Search criteria filter: Filter criteria Returns: str: JSON formatted list of host groups

hostgroup_create

Create a new host group in Zabbix. Args: name: Host group name Returns: str: JSON formatted creation result

hostgroup_update

Update an existing host group in Zabbix. Args: groupid: Group ID to update name: New group name Returns: str: JSON formatted update result

hostgroup_delete

Delete host groups from Zabbix. Args: groupids: List of group IDs to delete Returns: str: JSON formatted deletion result

item_get

Get items from Zabbix with optional filtering. Args: itemids: List of item IDs to retrieve hostids: List of host IDs to filter by groupids: List of host group IDs to filter by templateids: List of template IDs to filter by output: Output format search: Search criteria filter: Filter criteria limit: Maximum number of results Returns: str: JSON formatted list of items

item_create

Create a new item in Zabbix. Args: name: Item name key_: Item key hostid: Host ID type: Item type (0=Zabbix agent, 2=Zabbix trapper, etc.) value_type: Value type (0=float, 1=character, 3=unsigned int, 4=text) delay: Update interval units: Value units description: Item description Returns: str: JSON formatted creation result

item_update

Update an existing item in Zabbix. Args: itemid: Item ID to update name: New item name key_: New item key delay: New update interval status: New status (0=enabled, 1=disabled) Returns: str: JSON formatted update result

item_delete

Delete items from Zabbix. Args: itemids: List of item IDs to delete Returns: str: JSON formatted deletion result

trigger_get

Get triggers from Zabbix with optional filtering. Args: triggerids: List of trigger IDs to retrieve hostids: List of host IDs to filter by groupids: List of host group IDs to filter by templateids: List of template IDs to filter by output: Output format search: Search criteria filter: Filter criteria limit: Maximum number of results Returns: str: JSON formatted list of triggers

trigger_create

Create a new trigger in Zabbix. Args: description: Trigger description expression: Trigger expression priority: Severity (0=not classified, 1=info, 2=warning, 3=average, 4=high, 5=disaster) status: Status (0=enabled, 1=disabled) comments: Additional comments Returns: str: JSON formatted creation result

trigger_update

Update an existing trigger in Zabbix. Args: triggerid: Trigger ID to update description: New trigger description expression: New trigger expression priority: New severity level status: New status (0=enabled, 1=disabled) Returns: str: JSON formatted update result

trigger_delete

Delete triggers from Zabbix. Args: triggerids: List of trigger IDs to delete Returns: str: JSON formatted deletion result

template_get

Get templates from Zabbix with optional filtering. Args: templateids: List of template IDs to retrieve groupids: List of host group IDs to filter by hostids: List of host IDs to filter by output: Output format search: Search criteria filter: Filter criteria Returns: str: JSON formatted list of templates

template_create

Create a new template in Zabbix. Args: host: Template technical name groups: List of host groups (format: [{"groupid": "1"}]) name: Template visible name description: Template description Returns: str: JSON formatted creation result

template_update

Update an existing template in Zabbix. Args: templateid: Template ID to update host: New template technical name name: New template visible name description: New template description Returns: str: JSON formatted update result

template_delete

Delete templates from Zabbix. Args: templateids: List of template IDs to delete Returns: str: JSON formatted deletion result

problem_get

Get problems from Zabbix with optional filtering. Args: eventids: List of event IDs to retrieve groupids: List of host group IDs to filter by hostids: List of host IDs to filter by objectids: List of object IDs to filter by output: Output format time_from: Start time (Unix timestamp) time_till: End time (Unix timestamp) recent: Only recent problems severities: List of severity levels to filter by limit: Maximum number of results Returns: str: JSON formatted list of problems

event_get

Get events from Zabbix with optional filtering. Args: eventids: List of event IDs to retrieve groupids: List of host group IDs to filter by hostids: List of host IDs to filter by objectids: List of object IDs to filter by output: Output format time_from: Start time (Unix timestamp) time_till: End time (Unix timestamp) limit: Maximum number of results Returns: str: JSON formatted list of events

event_acknowledge

Acknowledge events in Zabbix. Args: eventids: List of event IDs to acknowledge action: Acknowledge action (1=acknowledge, 2=close, etc.) message: Acknowledge message Returns: str: JSON formatted acknowledgment result

history_get

Get history data from Zabbix. Args: itemids: List of item IDs to get history for history: History type (0=float, 1=character, 2=log, 3=unsigned, 4=text) time_from: Start time (Unix timestamp) time_till: End time (Unix timestamp) limit: Maximum number of results sortfield: Field to sort by sortorder: Sort order (ASC or DESC) Returns: str: JSON formatted history data

trend_get

Get trend data from Zabbix. Args: itemids: List of item IDs to get trends for time_from: Start time (Unix timestamp) time_till: End time (Unix timestamp) limit: Maximum number of results Returns: str: JSON formatted trend data

user_get

Get users from Zabbix with optional filtering. Args: userids: List of user IDs to retrieve output: Output format search: Search criteria filter: Filter criteria Returns: str: JSON formatted list of users

user_create

Create a new user in Zabbix. Args: username: Username passwd: Password usrgrps: List of user groups (format: [{"usrgrpid": "1"}]) name: First name surname: Last name email: Email address Returns: str: JSON formatted creation result

user_update

Update an existing user in Zabbix. Args: userid: User ID to update username: New username name: New first name surname: New last name email: New email address Returns: str: JSON formatted update result

user_delete

Delete users from Zabbix. Args: userids: List of user IDs to delete Returns: str: JSON formatted deletion result

maintenance_get

Get maintenance periods from Zabbix. Args: maintenanceids: List of maintenance IDs to retrieve groupids: List of host group IDs to filter by hostids: List of host IDs to filter by output: Output format Returns: str: JSON formatted list of maintenance periods

maintenance_create

Create a new maintenance period in Zabbix. Args: name: Maintenance name active_since: Start time (Unix timestamp) active_till: End time (Unix timestamp) groupids: List of host group IDs hostids: List of host IDs timeperiods: List of time periods description: Maintenance description Returns: str: JSON formatted creation result

maintenance_update

Update an existing maintenance period in Zabbix. Args: maintenanceid: Maintenance ID to update name: New maintenance name active_since: New start time (Unix timestamp) active_till: New end time (Unix timestamp) description: New maintenance description Returns: str: JSON formatted update result

maintenance_delete

Delete maintenance periods from Zabbix. Args: maintenanceids: List of maintenance IDs to delete Returns: str: JSON formatted deletion result

graph_get

Get graphs from Zabbix with optional filtering. Args: graphids: List of graph IDs to retrieve hostids: List of host IDs to filter by templateids: List of template IDs to filter by output: Output format search: Search criteria filter: Filter criteria Returns: str: JSON formatted list of graphs

discoveryrule_get

Get discovery rules from Zabbix with optional filtering. Args: itemids: List of discovery rule IDs to retrieve hostids: List of host IDs to filter by templateids: List of template IDs to filter by output: Output format search: Search criteria filter: Filter criteria Returns: str: JSON formatted list of discovery rules

itemprototype_get

Get item prototypes from Zabbix with optional filtering. Args: itemids: List of item prototype IDs to retrieve discoveryids: List of discovery rule IDs to filter by hostids: List of host IDs to filter by output: Output format search: Search criteria filter: Filter criteria Returns: str: JSON formatted list of item prototypes

configuration_export

Export configuration from Zabbix. Args: format: Export format (json, xml) options: Export options Returns: str: JSON formatted export result

configuration_import

Import configuration to Zabbix. Args: format: Import format (json, xml) source: Configuration data to import rules: Import rules Returns: str: JSON formatted import result

usermacro_get

Get global macros from Zabbix with optional filtering. Args: globalmacroids: List of global macro IDs to retrieve hostids: List of host IDs to filter by (for host macros) output: Output format (extend, shorten, or specific fields) search: Search criteria filter: Filter criteria Returns: str: JSON formatted list of global macros

apiinfo_version

Get Zabbix API version information. Returns: str: JSON formatted API version info

README

Zabbix MCP Server

License: MIT Python 3.10+

A comprehensive Model Context Protocol (MCP) server for Zabbix integration using FastMCP and python-zabbix-utils. This server provides complete access to Zabbix API functionality through MCP-compatible tools.

<a href="https://glama.ai/mcp/servers/@mpeirone/zabbix-mcp-server"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@mpeirone/zabbix-mcp-server/badge" alt="zabbix-mcp-server MCP server" /> </a>

Features

๐Ÿ  Host Management

  • host_get - Retrieve hosts with advanced filtering
  • host_create - Create new hosts with interfaces and templates
  • host_update - Update existing host configurations
  • host_delete - Remove hosts from monitoring

๐Ÿ‘ฅ Host Group Management

  • hostgroup_get - Retrieve host groups
  • hostgroup_create - Create new host groups
  • hostgroup_update - Modify existing host groups
  • hostgroup_delete - Remove host groups

๐Ÿ“Š Item Management

  • item_get - Retrieve monitoring items with filtering
  • item_create - Create new monitoring items
  • item_update - Update existing items
  • item_delete - Remove monitoring items

โš ๏ธ Trigger Management

  • trigger_get - Retrieve triggers and alerts
  • trigger_create - Create new triggers
  • trigger_update - Modify existing triggers
  • trigger_delete - Remove triggers

๐Ÿ“‹ Template Management

  • template_get - Retrieve monitoring templates
  • template_create - Create new templates
  • template_update - Update existing templates
  • template_delete - Remove templates

๐Ÿšจ Problem & Event Management

  • problem_get - Retrieve current problems and issues
  • event_get - Get historical events
  • event_acknowledge - Acknowledge events and problems

๐Ÿ“ˆ Data Retrieval

  • history_get - Access historical monitoring data
  • trend_get - Retrieve trend data and statistics

๐Ÿ‘ค User Management

  • user_get - Retrieve user accounts
  • user_create - Create new users
  • user_update - Update user information
  • user_delete - Remove user accounts

๐Ÿ”ง Maintenance Management

  • maintenance_get - Retrieve maintenance periods
  • maintenance_create - Schedule maintenance windows
  • maintenance_update - Modify maintenance periods
  • maintenance_delete - Remove maintenance schedules

๐Ÿ“Š Additional Features

  • graph_get - Retrieve graph configurations
  • discoveryrule_get - Get discovery rules
  • itemprototype_get - Retrieve item prototypes
  • configuration_export - Export Zabbix configurations
  • configuration_import - Import configurations
  • apiinfo_version - Get API version information

Installation

Prerequisites

  • Python 3.10 or higher
  • uv package manager
  • Access to a Zabbix server with API enabled

Quick Start

  1. Clone the repository:

    git clone https://github.com/mpeirone/zabbix-mcp-server.git
    cd zabbix-mcp-server
    
  2. Install dependencies:

    uv sync
    
  3. Configure environment variables:

    cp config/.env.example .env
    # Edit .env with your Zabbix server details
    
  4. Test the installation:

    uv run python scripts/test_server.py
    

Configuration

Required Environment Variables

  • ZABBIX_URL - Your Zabbix server API endpoint (e.g., https://zabbix.example.com)

Authentication (choose one method)

Method 1: API Token (Recommended)

  • ZABBIX_TOKEN - Your Zabbix API token

Method 2: Username/Password

  • ZABBIX_USER - Your Zabbix username
  • ZABBIX_PASSWORD - Your Zabbix password

Optional Configuration

  • READ_ONLY - Set to true, 1, or yes to enable read-only mode (only GET operations allowed)

Usage

Running the Server

With startup script (recommended):

uv run python scripts/start_server.py

Direct execution:

uv run python src/zabbix_mcp_server.py

Testing

Run test suite:

uv run python scripts/test_server.py

Read-Only Mode

When READ_ONLY=true, the server will only expose GET operations (retrieve data) and block all create, update, and delete operations. This is useful for:

  • ๐Ÿ“Š Monitoring dashboards
  • ๐Ÿ” Read-only integrations
  • ๐Ÿ”’ Security-conscious environments
  • ๐Ÿ›ก๏ธ Preventing accidental modifications

Example Tool Calls

Get all hosts:

host_get()

Get hosts in specific group:

host_get(groupids=["1"])

Create a new host:

host_create(
    host="server-01",
    groups=[{"groupid": "1"}],
    interfaces=[{
        "type": 1,
        "main": 1,
        "useip": 1,
        "ip": "192.168.1.100",
        "dns": "",
        "port": "10050"
    }]
)

Get recent problems:

problem_get(recent=True, limit=10)

Get history data:

history_get(
    itemids=["12345"],
    time_from=1640995200,
    limit=100
)

MCP Integration

This server is designed to work with MCP-compatible clients like Claude Desktop. See MCP_SETUP.md for detailed integration instructions.

Docker Support

Using Docker Compose

  1. Configure environment:

    cp config/.env.example .env
    # Edit .env with your settings
    
  2. Run with Docker Compose:

    docker compose up -d
    

Building Docker Image

docker build -t zabbix-mcp-server .

Development

Project Structure

zabbix-mcp-server/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ zabbix_mcp_server.py    # Main server implementation
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ start_server.py         # Startup script with validation
โ”‚   โ””โ”€โ”€ test_server.py          # Test script
โ”œโ”€โ”€ config/
โ”‚   โ”œโ”€โ”€ .env.example           # Environment configuration template
โ”‚   โ””โ”€โ”€ mcp.json               # MCP client configuration example
โ”œโ”€โ”€ pyproject.toml             # Python project configuration
โ”œโ”€โ”€ requirements.txt           # Dependencies
โ”œโ”€โ”€ Dockerfile                 # Docker configuration
โ”œโ”€โ”€ docker-compose.yml         # Docker Compose setup
โ”œโ”€โ”€ README.md                  # This file
โ”œโ”€โ”€ MCP_SETUP.md              # MCP integration guide
โ”œโ”€โ”€ CONTRIBUTING.md           # Contribution guidelines
โ”œโ”€โ”€ CHANGELOG.md              # Version history
โ””โ”€โ”€ LICENSE                   # MIT license

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

Running Tests

# Test server functionality
uv run python scripts/test_server.py

# Test with Docker
docker-compose exec zabbix-mcp python scripts/test_server.py

Error Handling

The server includes comprehensive error handling:

  • โœ… Authentication errors are clearly reported
  • ๐Ÿ”’ Read-only mode violations are blocked with descriptive messages
  • โœ”๏ธ Invalid parameters are validated
  • ๐ŸŒ Network and API errors are properly formatted
  • ๐Ÿ“ Detailed logging for troubleshooting

Security Considerations

  • ๐Ÿ”‘ Use API tokens instead of username/password when possible
  • ๐Ÿ”’ Enable read-only mode for monitoring-only use cases
  • ๐Ÿ›ก๏ธ Secure your environment variables
  • ๐Ÿ” Use HTTPS for Zabbix server connections
  • ๐Ÿ”„ Regularly rotate API tokens
  • ๐Ÿ“ Store configuration files securely

Troubleshooting

Common Issues

Connection Failed:

  • Verify ZABBIX_URL is correct and accessible
  • Check authentication credentials
  • Ensure Zabbix API is enabled

Permission Denied:

  • Verify user has sufficient Zabbix permissions
  • Check if read-only mode is enabled when trying to modify data

Tool Not Found:

  • Ensure all dependencies are installed: uv sync
  • Verify Python version compatibility (3.10+)

Debug Mode

Set environment variable for detailed logging:

export DEBUG=1
uv run python scripts/start_server.py

Dependencies

License

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

Acknowledgments

Support


Made with โค๏ธ for the Zabbix and MCP communities

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured