zima-mcp
Allows monitoring and managing Docker containers on a remote Docker host over SSH, including listing containers, retrieving CPU/memory stats, viewing logs, checking disk usage and system load, and restarting allowlisted containers.
zima-mcp
An MCP server that lets your AI assistant check on a ZimaBlade (or any Docker box) over plain SSH, and restart the containers you allow, with nothing installed on the box.

Real output from a ZimaBlade running ZimaOS, captured 11 Oct 2026. The stats table is trimmed to the Immich and Homepage containers.
Contents
Related MCP server: MCP SSH SRE
What it does
Answers "is the box busy?" with load average and uptime (
zima_load).Finds the culprit with top processes by CPU (
zima_top) and one snapshot of CPU and memory per container (zima_docker_stats).Lists containers with status and image (
zima_docker_ps) and shows disk usage (zima_disk).Reads logs for one named container, up to 500 lines (
zima_container_logs).Restarts a container, but only one you have put on the allowlist (
zima_restart_container). Everything else is refused.Can't reboot the box, use sudo or kill root processes. None of the tools runs those commands, and the test suite checks that.
Quick start
You need Python 3.10+, an SSH key that logs in to the box without a password, and a user on the box that can run docker without sudo. On ZimaOS the normal user can, because it's in the docker group.
# 1. check SSH and docker work for that user
ssh you@your-zima docker ps
# 2. install
pipx install git+https://github.com/casareanderson/zima-mcp
# 3. try one tool
ZIMA_HOST=your-zima ZIMA_USER=you zima-mcp --call zima_loadSuccess looks like one uptime line, for example 10:09:19 up 16 days, 23:54, 0 users, load average: 0.81, 0.99, 0.94.
Then add it to your MCP client (next section). The full walkthrough, including every client and the common errors, is in docs/SETUP.md.
Usage
Claude Code:
claude mcp add zima -e ZIMA_HOST=your-zima -e ZIMA_USER=you -e ZIMA_RESTART_ALLOWLIST=immich-server -- zima-mcpClaude Desktop, Cursor and most other clients take the same JSON shape (claude_desktop_config.json, ~/.cursor/mcp.json):
{
"mcpServers": {
"zima": {
"command": "zima-mcp",
"env": {
"ZIMA_HOST": "your-zima",
"ZIMA_USER": "you",
"ZIMA_RESTART_ALLOWLIST": "immich-server,immich-machine-learning"
}
}
}
}Then ask things like "is the Zima busy?", "which container is eating the memory?" or "show me the last 100 lines of immich-server's logs".
Testing without a client:
zima-mcp --list-tools
zima-mcp --call zima_docker_stats
zima-mcp --call zima_container_logs --arg container=immich-server --arg lines=50Configuration
All settings are environment variables. There's a copy-and-edit template in config.example.env.
Variable | Default | What it does |
| required | Hostname or IP of the box |
| required | SSH user. Must be able to run |
|
| SSH port |
| your SSH default | Path to a private key, passed as |
|
| Seconds before a command is given up on (60 for restarts) |
| empty | Comma-separated container names the agent may restart. Empty means every restart is refused |
How it works
flowchart LR
A[AI assistant] -- MCP over stdio --> B[zima-mcp]
B -- "ssh -o BatchMode=yes user@box 'docker stats ...'" --> C[ZimaBlade]
C -- text output --> B -- tool result --> AEach tool is one fixed command run with ssh. SSH runs in BatchMode, so it never sits waiting for a password. A command that takes too long is stopped and reported as an error, not left hanging. Container names are checked against Docker's own naming rules before they go anywhere near a shell, so a name like --help or a;reboot is refused, and names are shell-quoted as well. Restarts also have to be on the allowlist.
zima_mcp/
server.py the tools, SSH runner, config and MCP wiring
__main__.py python -m zima_mcp
tests/
test_server.py unit tests plus an in-memory MCP session
scripts/
setup-check.sh what CI runs to prove docs/SETUP.md worksStatus, limits and real results
Status: in use on one ZimaBlade (ZimaOS) as the "Zima ops" toolset of a self-hosted agent. This repo is the cleaned-up, configurable copy. The output above is from that box on 11 Oct 2026.
Tested: 19 unit tests, plus a CI job that follows docs/SETUP.md against a stand-in Docker host on the GitHub runner (SSH to localhost, a real
nginxcontainer, a real allowlisted restart).Not a ZimaOS API client. It doesn't talk to the ZimaOS/CasaOS app store or settings, only to
dockerand standard Linux tools over SSH. That's also why it works on any Linux Docker host.One box per server. To watch two boxes, add it twice under different names.
zima_topusestop -o %CPU. That works on ZimaOS. Some minimal BusyBox systems don't support-o, and the tool will return the error text.Can't fix a sick host. No reboot, no sudo. If the box itself is wedged, it tells you and that's all.
Licence and credits
MIT, see LICENSE. Built on the Model Context Protocol Python SDK (MIT).
If zima-mcp is useful to you, buy me a coffee. More field notes at dev.to/iam-tech.
Available Tools
7 toolszima_container_logsB
Tail recent logs for one named container.
Inputs: container (required), lines.
zima_diskB
Disk usage (df -h).
Inputs: no named parameters.
zima_docker_psA
List running Docker containers with status and image.
Inputs: no named parameters.
zima_docker_statsA
One snapshot of CPU and memory per container. Best tool for finding the culprit.
Inputs: no named parameters.
zima_loadA
Load average and uptime of the box. Quick check of whether it is busy.
Inputs: no named parameters.
zima_restart_containerA
Restart one named container. Only containers in ZIMA_RESTART_ALLOWLIST are allowed.
Inputs: container (required).
zima_topB
Top processes by CPU. Use it to find what is pegging the CPU.
Inputs: count.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool targets a distinct host or container concern (load, CPU, disk, container listing, stats, logs, restart), and descriptions explicitly differentiate the overlapping-looking ones (e.g. docker_ps vs docker_stats, top vs docker_stats). Minor residual overlap between host CPU tools and container CPU tools, but selection is generally clear.
All tools share a zima_ prefix and consistent lowercase snake_case, so the set reads as a coherent family. The style is noun-oriented rather than strict verb_noun (load, top, disk, docker_ps), with only restart_container using a verb, but this is a minor deviation rather than confusion.
Seven tools is well-scoped for a host-plus-Docker monitoring server: one per core observation (load, CPU, disk, container list, container stats, logs) plus a single guarded mutation. Nothing feels redundant or missing at the count level.
Covers the main diagnostic surface: host load/CPU/disk, container listing/stats/logs, and a safe restart. Gaps include host memory/network metrics and start/stop operations (only restart exists), but an agent can work around these for typical troubleshooting.
Maintenance
Related MCP Connectors
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Give your AI hands on every computer you own. Remote control of your Windows, Mac and Linux machines from one ChatGPT, Claude or Cursor chat — even from your phone. Ask it to find out why the office server is crawling, update every PC in the house, sort out your mom's laptop from another city, or ship the site from your work machine while you're on a train. It runs commands, reads files and takes a screenshot when it needs to see the screen. You decide what each computer allows, and you can cut any of them off in a second.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables AI assistants to manage homelab infrastructure through automated service installation (Jellyfin, Pi-hole, Ollama, Home Assistant, Frigate NVR), VM operations, AI accelerator support (MemryX, Coral TPU, Hailo-8), and Terraform state management with SSH-based discovery and deployment.585MIT
- AlicenseNot gradedqualityDmaintenanceProvides read-only server monitoring and diagnostic tools for AI assistants to manage Linux and Unraid systems via SSH. It enables natural language interactions for container management, storage health checks, and system log analysis while keeping credentials secure.17ISC
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to autonomously check, diagnose, and recover Dockerized services through safe, tool-based ops without direct host shell access.MIT
- AlicenseAqualityBmaintenanceEnables MCP-compatible AI clients to securely monitor and manage a self-hosted Linux VPS over SSH, including service status, disk and RAM usage, TLS certificate expiry, fail2ban summaries, and two-step confirmed service restarts or IP unbans.4MIT