services: # ── stdio mode ────────────────────────────────────────────────────────────── # Spawned on demand by an MCP client (Claude Desktop, agent, etc.). # Run manually for smoke-testing: docker compose run --rm zabbix-mcp-stdio zabbix-mcp-stdio: image: lordraw/zabbix-mcp:latest build: context: . dockerfile: Dockerfile env_file: .env environment: MCP_TRANSPORT: stdio stdin_open: true tty: false profiles: ["stdio"] # ── Streamable HTTP mode (recommended) ────────────────────────────────────── # Persistent HTTP server — clients connect to http://localhost:${MCP_PORT}/mcp # The deprecated /sse + /messages/ endpoints are served alongside it, so older # clients keep working; set MCP_LEGACY_SSE=false to drop them. # Start with: docker compose up -d zabbix-mcp-http zabbix-mcp-http: image: lordraw/zabbix-mcp:latest build: context: . dockerfile: Dockerfile env_file: .env environment: MCP_TRANSPORT: http MCP_PORT: "${MCP_PORT:-9950}" MCP_PATH: "${MCP_PATH:-/mcp}" MCP_LEGACY_SSE: "${MCP_LEGACY_SSE:-true}" ports: - "${MCP_PORT:-9950}:${MCP_PORT:-9950}" restart: unless-stopped healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:${MCP_PORT:-9950}/health', timeout=3)"] interval: 30s timeout: 5s retries: 3 start_period: 10s # ── Legacy SSE mode (DEPRECATED) ──────────────────────────────────────────── # Kept only for backwards compatibility: it starts the same HTTP server as # zabbix-mcp-http and prints a deprecation warning. Prefer zabbix-mcp-http, # which already serves /sse for old clients. # Start with: docker compose --profile legacy up -d zabbix-mcp-sse zabbix-mcp-sse: image: lordraw/zabbix-mcp:latest build: context: . dockerfile: Dockerfile env_file: .env environment: MCP_TRANSPORT: sse MCP_PORT: "${MCP_PORT:-9950}" ports: - "${MCP_PORT:-9950}:${MCP_PORT:-9950}" restart: unless-stopped healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:${MCP_PORT:-9950}/health', timeout=3)"] interval: 30s timeout: 5s retries: 3 start_period: 10s profiles: ["legacy"]