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.
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
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 filteringhost_create- Create new hosts with interfaces and templateshost_update- Update existing host configurationshost_delete- Remove hosts from monitoring
👥 Host Group Management
hostgroup_get- Retrieve host groupshostgroup_create- Create new host groupshostgroup_update- Modify existing host groupshostgroup_delete- Remove host groups
📊 Item Management
item_get- Retrieve monitoring items with filteringitem_create- Create new monitoring itemsitem_update- Update existing itemsitem_delete- Remove monitoring items
⚠️ Trigger Management
trigger_get- Retrieve triggers and alertstrigger_create- Create new triggerstrigger_update- Modify existing triggerstrigger_delete- Remove triggers
📋 Template Management
template_get- Retrieve monitoring templatestemplate_create- Create new templatestemplate_update- Update existing templatestemplate_delete- Remove templates
🚨 Problem & Event Management
problem_get- Retrieve current problems and issuesevent_get- Get historical eventsevent_acknowledge- Acknowledge events and problems
📈 Data Retrieval
history_get- Access historical monitoring datatrend_get- Retrieve trend data and statistics
👤 User Management
user_get- Retrieve user accountsuser_create- Create new usersuser_update- Update user informationuser_delete- Remove user accounts
🔧 Maintenance Management
maintenance_get- Retrieve maintenance periodsmaintenance_create- Schedule maintenance windowsmaintenance_update- Modify maintenance periodsmaintenance_delete- Remove maintenance schedules
📊 Additional Features
graph_get- Retrieve graph configurationsdiscoveryrule_get- Get discovery rulesitemprototype_get- Retrieve item prototypesconfiguration_export- Export Zabbix configurationsconfiguration_import- Import configurationsapiinfo_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
-
Clone the repository:
git clone https://github.com/mpeirone/zabbix-mcp-server.git cd zabbix-mcp-server -
Install dependencies:
uv sync -
Configure environment variables:
cp config/.env.example .env # Edit .env with your Zabbix server details -
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 usernameZABBIX_PASSWORD- Your Zabbix password
Optional Configuration
READ_ONLY- Set totrue,1, oryesto 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
-
Configure environment:
cp config/.env.example .env # Edit .env with your settings -
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
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - 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_URLis 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
- FastMCP - MCP server framework
- python-zabbix-utils - Official Zabbix Python library
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Zabbix for the monitoring platform
- Model Context Protocol for the integration standard
- FastMCP for the server framework
Support
Made with ❤️ for the Zabbix and MCP communities
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。