Zabbix MCP Server

Zabbix MCP Server

MCP-compatible Zabbix server integration for comprehensive monitoring and automation.

98
Stars
29
Forks
98
Watchers
4
Issues
Zabbix MCP Server serves as a comprehensive Model Context Protocol (MCP) server, enabling seamless integration with Zabbix using FastMCP and python-zabbix-utils. It offers complete access to Zabbix API functionalities through MCP-compatible tools, supporting advanced management of hosts, groups, items, triggers, templates, and more. The server is designed for easy installation, configuration, and automation of monitoring through a standardized protocol interface.

Key Features

Full Zabbix API access via MCP-compatible endpoints
Host and host group management
Item and trigger management
Template and proxy management
User and maintenance schedule administration
Historical and trend data retrieval
Problem and event management
Configuration import and export capabilities
Graph and discovery rule retrieval
Flexible authentication (API token or user/password)

Use Cases

Automating enterprise-scale Zabbix monitoring deployments
Streamlining host and host group provisioning workflows
Integrating Zabbix monitoring with external orchestration or AI systems
Facilitating bulk item and trigger management via standardized API
Efficiently handling mass configuration imports and exports
Managing routine maintenance windows and schedules programmatically
Centralizing user and permission management for large teams
Aggregating historical monitoring data for analytics
Building custom dashboards or reporting tools leveraging Zabbix metrics
Synchronizing Zabbix environment with other Model Context Protocol (MCP) platforms

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.

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

🔗 Proxy Management

  • proxy_get - Retrieve Zabbix proxies with filtering
  • proxy_create - Create new proxies
  • proxy_update - Update existing proxies
  • proxy_delete - Remove proxies

🔧 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:

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

    bash
    uv sync
    
  3. Configure environment variables:

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

    bash
    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)
  • VERIFY_SSL - Enable/disable SSL certificate verification (default: true)

Transport Configuration

  • ZABBIX_MCP_TRANSPORT - Transport type: stdio (default) or streamable-http

HTTP Transport Configuration (only used when ZABBIX_MCP_TRANSPORT=streamable-http):

  • ZABBIX_MCP_HOST - Server host (default: 127.0.0.1)
  • ZABBIX_MCP_PORT - Server port (default: 8000)
  • ZABBIX_MCP_STATELESS_HTTP - Stateless mode (default: false)
  • AUTH_TYPE - Must be set to no-auth for streamable-http transport

Usage

Running the Server

With startup script (recommended):

bash
uv run python scripts/start_server.py

Direct execution:

bash
uv run python src/zabbix_mcp_server.py

Transport Options

The server supports two transport methods:

STDIO Transport (Default)

Standard input/output transport for MCP clients like Claude Desktop:

bash
# Set in .env or environment
ZABBIX_MCP_TRANSPORT=stdio

HTTP Transport

HTTP-based transport for web integrations:

bash
# Set in .env or environment
ZABBIX_MCP_TRANSPORT=streamable-http
ZABBIX_MCP_HOST=127.0.0.1
ZABBIX_MCP_PORT=8000
ZABBIX_MCP_STATELESS_HTTP=false
AUTH_TYPE=no-auth

Note: When using streamable-http transport, AUTH_TYPE must be set to no-auth.

Testing

Run test suite:

bash
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:

python
host_get()

Get hosts in specific group:

python
host_get(groupids=["1"])

Create a new host:

python
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:

python
problem_get(recent=True, limit=10)

Get history data:

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

Get all proxies:

python
proxy_get()

Create a new active proxy:

python
proxy_create(
    host="proxy-01",
    status=5,
    description="Main datacenter proxy"
)

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:

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

    bash
    docker compose up -d
    

Building Docker Image

bash
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

bash
# 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:

bash
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

Star History

Star History Chart

Repository Owner

mpeirone
mpeirone

User

Repository Details

Language Python
Default Branch main
Size 248 KB
Contributors 5
License GNU General Public License v3.0
MCP Verified Nov 12, 2025

Programming Languages

Python
98.92%
Dockerfile
1.08%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • FastMCP

    FastMCP

    The fast, Pythonic way to build MCP servers and clients.

    FastMCP is a production-ready framework for building Model Context Protocol (MCP) applications in Python. It streamlines the creation of MCP servers and clients, providing advanced features such as enterprise authentication, composable tools, OpenAPI/FastAPI generation, server proxying, deployment tools, and comprehensive client libraries. Designed for ease of use, it offers both standard protocol support and robust utilities for production deployments.

    • 20,201
    • MCP
    • jlowin/fastmcp
  • Aviationstack MCP Server

    Aviationstack MCP Server

    MCP server offering comprehensive endpoints for aviation and flight data.

    Aviationstack MCP Server provides an MCP-compliant API that exposes tools to access real-time and scheduled flight data, aircraft details, random aircraft types, countries, and city information from the AviationStack API. It offers ready-to-use endpoints for airline-specific flight queries, airport schedules, and in-depth vehicle, country, and city data. The solution applies the Model Context Protocol by defining MCP tools as Python functions with standardized interfaces, designed for seamless integration into MCP-compatible environments. The server is built using Python, incorporates the FastMCP library, and is intended for easy deployment and use in application development.

    • 11
    • MCP
    • Pradumnasaraf/aviationstack-mcp
  • VictoriaMetrics MCP Server

    VictoriaMetrics MCP Server

    Model Context Protocol server enabling advanced monitoring and observability for VictoriaMetrics.

    VictoriaMetrics MCP Server implements the Model Context Protocol (MCP) to provide seamless integration with VictoriaMetrics, allowing advanced monitoring, data exploration, and observability. It offers access to almost all read-only APIs, as well as embedded documentation for offline usage. The server facilitates comprehensive metric querying, cardinality analysis, alert and rule testing, and automation capabilities for engineers and tools.

    • 87
    • MCP
    • VictoriaMetrics-Community/mcp-victoriametrics
  • ZoomEye MCP Server

    ZoomEye MCP Server

    Real-time cyberspace asset intelligence for AI assistants via Model Context Protocol.

    ZoomEye MCP Server implements the Model Context Protocol (MCP) to provide network asset intelligence to AI assistants and development tools. It enables querying of global internet assets through ZoomEye's cyber asset search engine using structured parameters and dorks. The server includes features like caching, error handling, and compatibility with leading MCP environments, supporting real-time cyber asset data integration for various AI and developer platforms.

    • 50
    • MCP
    • zoomeye-ai/mcp_zoomeye
  • mcp_vms

    mcp_vms

    MCP-compliant server for seamless VMS (CCTV) integration and video access.

    mcp_vms implements an MCP server that bridges CCTV Video Management Systems (VMS) with model context protocols. It retrieves live and recorded video streams, exposes channel information and status, and supports remote video playback control and PTZ camera management. Comprehensive error handling and logging ensure reliable integration with AI tooling requiring contextual video feeds.

    • 11
    • MCP
    • jyjune/mcp_vms
  • EntraID MCP Server (Microsoft Graph FastMCP)

    EntraID MCP Server (Microsoft Graph FastMCP)

    A modular FastMCP server for managing Microsoft Graph resources with advanced context and security.

    EntraID MCP Server provides a modular, resource-oriented implementation of a FastMCP server tailored for Microsoft Graph API interactions. It supports advanced operations across users, groups, applications, service principals, MFA, and sign-in logs, offering extensibility and strong security practices. Resource modules use a centralized authentication client, while comprehensive permission management, consistent context handling, error reporting, and logging are built in. The tool is designed for ease of development and extensibility, supporting standardized model context protocols.

    • 29
    • MCP
    • hieuttmmo/entraid-mcp-server
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results