The MCP server runs as a stdio process: the container reads JSON-RPC 2.0
messages from stdin and writes responses to stdout. No network port is
exposed. The MCP client (Claude Desktop, an agent, or any other MCP host)
spawns the container and communicates over its standard streams.
┌─────────────────────┐ stdin/stdout ┌───────────────────────┐
│ MCP Client │ ◄──────────────► │ zabbix-mcp container │
│ (agent, Claude, …) │ JSON-RPC 2.0 │ python server.py │
└─────────────────────┘ └──────────┬────────────┘
│ HTTPS
▼
┌──────────────────────┐
│ Zabbix API │
│ (JSON-RPC endpoint) │
└──────────────────────┘
docker build -t zabbix-mcp:latest .
Copy .env.example to .env and fill in your Zabbix connection details.
Never commit .env to version control.
cp .env.example .env
$EDITOR .env
Minimum required variables:
ZABBIX_URL=https://zabbix.example.com
ZABBIX_TOKEN=your_api_token_here # or ZABBIX_USER + ZABBIX_PASSWORD
docker run --rm -i --env-file .env zabbix-mcp:latest
The server starts and waits for JSON-RPC input on stdin.
Press Ctrl-C to stop.
claude_desktop_config.json){
"mcpServers": {
"zabbix": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"--env-file", "/absolute/path/to/.env",
"zabbix-mcp:latest"
]
}
}
}
Restart Claude Desktop after editing the config.
agent.py / llm.py)Override build_mcp_server_params() in llm.py to spawn Docker instead of
the local venv:
def build_mcp_server_params() -> StdioServerParameters:
env_file = os.path.abspath(".env")
return StdioServerParameters(
command="docker",
args=["run", "--rm", "-i", "--env-file", env_file, "zabbix-mcp:latest"],
env={**os.environ},
)
Or set the ZABBIX_MCP_USE_DOCKER variable and handle the switch in code.
All variables are passed via --env-file or individual -e flags.
| Variable | Required | Default | Description |
|---|---|---|---|
ZABBIX_URL | yes | — | Full base URL of the Zabbix frontend |
ZABBIX_TOKEN | one of† | — | API token (Zabbix 5.4+, recommended) |
ZABBIX_USER | one of† | — | Username for user/password auth |
ZABBIX_PASSWORD | one of† | — | Password for user/password auth |
ZABBIX_VERIFY_SSL | no | true | Set false to skip TLS verification |
† Either ZABBIX_TOKEN or the pair ZABBIX_USER + ZABBIX_PASSWORD is required.
If both are present, the token takes priority.
| Property | Value |
|---|---|
| Base image | python:3.12-slim |
| Working dir | /app |
| Entrypoint | python server.py |
| Exposed ports | none |
| Credentials | mounted at runtime via --env-file |
/app/server.py — MCP server (10 tools)
/app/util.py — Zabbix formatting utilities
agent.py, llm.py and .env are not included — the agent runs on the
host and connects to the container over stdio.
# For ARM hosts (e.g. Raspberry Pi, Apple Silicon)
docker build --platform linux/arm64 -t zabbix-mcp:latest .
# Multi-platform manifest (requires buildx)
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t yourrepo/zabbix-mcp:latest \
--push .
# Rebuild after changing server.py or requirements.txt
docker build --no-cache -t zabbix-mcp:latest .
--env-file or -e.ZABBIX_VERIFY_SSL=false — or better, mount the CA bundle and set
REQUESTS_CA_BUNDLE=/certs/ca.pem.create_maintenance and delete_maintenance.Content type
Image
Digest
sha256:1c6b5e00f…
Size
59.6 MB
Last updated
3 months ago
docker pull lordraw/zabbix-mcp