dockhand-readonly-mcp
The dockhand-readonly-mcp server provides read-only access to a Dockhand-managed Docker environment, delivering sanitized insights while protecting sensitive information. All operations are safe, idempotent, and cannot modify resources. Key capabilities include:
dockhand_health: Check if the Dockhand service is reachable and healthy.
list_environments: List Docker environments with safe summaries (connection URLs and credentials omitted).
list_containers: List containers with identity, image, runtime health, ports, metrics, and network membership (optionally filtered by environment ID). Secrets, labels, mounts, logs, and commands are omitted.
get_container_summary: Get a sanitized summary for a single container by ID (never returns environment variables, labels, mounts, logs, commands, or raw inspect data).
list_networks: List networks with driver, internal flag, IPAM ranges, and sanitized container membership (optionally filtered by environment ID). Labels and driver options are omitted.
get_network_summary: Get a sanitized summary for a specific network by ID.
list_stacks: List stacks with names, states, types, and resource counts (optionally filtered by environment ID). Compose files, repository URLs, paths, and secrets are omitted.
get_runtime_overview: Get aggregate counts for containers, health, network isolation, and stack states for routine monitoring (optionally filtered by environment ID).
You cannot start, stop, restart, deploy, create, edit, or delete resources; access logs, terminals, or raw inspect data; or read environment variable values, Compose files, or credentials.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@dockhand-readonly-mcp show me all running containers and their networks"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Dockhand Read-only MCP
Read-only-MCP-Adapter für die Dockhand-REST-API. Das Projekt unterstützt zwei Transporte:
lokales STDIO für Codex auf demselben Rechner
authentifiziertes Streamable HTTP für den Docker-Betrieb
Sicherheitsgrenze
Dockhand Free kennt keine Viewer-Rolle. Der zugrunde liegende Dockhand-API-Token besitzt daher weiterhin die Rechte seines Dockhand-Benutzers. Der Adapter reduziert die für MCP erreichbare Oberfläche auf fest implementierte HTTP-GET-Abfragen:
Health, Umgebungen, Container, Netze und Stacks lesen
aggregierten Laufzeitstatus bilden
keine frei wählbaren URLs oder HTTP-Methoden
keine Start-, Stop-, Restart-, Deploy-, Create-, Edit- oder Delete-Werkzeuge
keine Logs, Terminals, ungefilterten Raw-Inspect-Daten oder Compose-Dateien
keine Ausgabe von Werten aus Umgebungsvariablen oder erkannten Zugangsdaten
explizite Security-Ansichten für Capabilities, Namespaces, Limits, Devices, Mount-Pfade, Port-Bindings, Netzwerkadressen, IPAM, Labels und Treiberoptionen; geheimnisverdächtige Label- und Optionswerte werden redigiert
Der Container erhält keinen Docker-Socket. Er kommuniziert ausschließlich über die Dockhand-REST-API. Der von Codex verwendete MCP-Bearer-Token ist ein zweites, unabhängiges Secret und darf nicht mit dem Dockhand-Token identisch sein.
Related MCP server: runtime-inspector-mcp
Docker-Architektur
Codex
└─ HTTPS + separater MCP-Bearer-Token
└─ Reverse Proxy: mcp.example.com
└─ dockhand-readonly-mcp:3030
└─ konfiguriertes Docker-Netz + Dockhand-API-Token
└─ dockhand:3000/apiDer MCP-Adapter lauscht auf Port 3030; Dockhands eigener Standardport 3000 bleibt davon getrennt. Der MCP-Endpunkt ist /mcp. /healthz ist ohne Anmeldung erreichbar und liefert ausschließlich den Adapterstatus. Der Container prüft diesen Endpunkt alle 30 Sekunden. Alle MCP-Anfragen benötigen den separaten Bearer-Token.
Security-Prüfungen per MCP
Für eine Detailprüfung zuerst mit list_containers beziehungsweise list_networks die IDs ermitteln. Anschließend liefern:
get_container_security_config: gefilterte Docker-Inspect-Konfiguration mit Benutzer, Privilegien, Capabilities, Namespace-Modi, Security-Optionen, Ressourcenlimits, Devices, Mounts, Ports, DNS, Labels und Netzzuordnungenget_network_security_config: Netzwerk-Details mit Treiber, Flags, IPAM, Optionen, Labels, Peers sowie Endpoint-, MAC- und IP-Adressen
Die Werte von Umgebungsvariablen sowie Entrypoint- und Command-Argumente werden nicht ausgegeben. Sichtbar bleiben die Namen der Umgebungsvariablen und eine Liste der angewendeten Redaktionen.
Automatisches Container-Image auf GitHub
Der Workflow .github/workflows/publish-container.yml testet und baut das Image automatisch für linux/amd64 und linux/arm64. Bei jedem Push auf main wird es in der GitHub Container Registry veröffentlicht als:
ghcr.io/<github-owner>/<repository>:latestZusätzlich entstehen ein commitbezogener sha-...-Tag und bei Git-Tags wie v0.2.0 die Tags v0.2.0, 0.2.0 und 0.2. Pull Requests werden getestet und gebaut, aber nicht veröffentlicht.
Vor dem ersten Start:
Das Repository zu GitHub pushen. Der Workflow benötigt keine eigenen Registry-Secrets; er verwendet den automatisch bereitgestellten
GITHUB_TOKEN.Auf der GitHub-Paketseite das erzeugte Container-Paket öffentlich schalten. Soll es privat bleiben, muss der Docker-Host vor dem Abruf mit einem GitHub-Token mit
read:packagesanghcr.ioangemeldet werden.
Die Compose-Datei verwendet direkt das öffentliche Image ghcr.io/cgfm/dockhand_readonly_mcp:latest.
In Dockhand kann anschließend das GitHub-Repository als Stack-Quelle und compose.yaml als Compose-Datei gewählt werden. Dort müssen außerdem die Werte aus .env.example als Stack-Umgebungsvariablen hinterlegt werden. pull_policy: always sorgt dafür, dass bei einem erneuten Deploy das aktuelle Image aus GHCR abgerufen wird.
Deployment vorbereiten
Benutzer- und Gruppen-ID des Kontos bestimmen, dem die Secret-Dateien gehören:
id -u id -gZwei getrennte Secret-Dateien anlegen. Beide müssen diesem Benutzer gehören. Dateimodus
0600wird empfohlen; bei einem abweichenden Modus protokolliert der Adapter einmalig einen Hinweis, verwendet eine ansonsten gültige und lesbare Datei aber trotzdem:dockhand_api_token: vorhandener Dockhand-Token mit Präfixdh_mcp_bearer_token: neuer, zufälliger Zugriffstoken, beispielsweise ausopenssl rand -hex 32
.env.examplenach.envkopieren und Docker-Netz, Dockhand-URL, öffentliche MCP-Domain, PUID, PGID sowie die beiden absoluten Secret-Pfade anpassen. Keine Tokenwerte in.enveintragen. Unverschlüsseltes HTTP fürDOCKHAND_URLnur innerhalb eines vertrauenswürdigen privaten Docker-Netzes mitDOCKHAND_ALLOW_HTTP=trueaktivieren.Konfiguration prüfen und bereitstellen:
docker compose config docker compose pull docker compose up -d docker compose ps
Das Compose-Setup veröffentlicht keinen Host-Port. Der Reverse Proxy muss den Container über das in DOCKER_NETWORK konfigurierte externe Docker-Netz erreichen können.
Reverse Proxy
Beispielkonfiguration für Nginx Proxy Manager und mcp.example.com:
Feld | Wert |
Scheme |
|
Forward Hostname |
|
Forward Port |
|
Websocket Support | aktiviert |
SSL | Zertifikat, Force SSL, HTTP/2 |
Unter Advanced:
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;Der Proxy Host sollte nur aus Heimnetz und VPN erreichbar sein. Der Bearer-Token bleibt trotzdem verpflichtend.
Codex mit dem Container verbinden
Den MCP-Bearer-Token im lokalen Prozessumfeld von Codex als DOCKHAND_MCP_BEARER_TOKEN bereitstellen und danach registrieren:
codex mcp add dockhand-readonly \
--url https://mcp.example.com/mcp \
--bearer-token-env-var DOCKHAND_MCP_BEARER_TOKENDie vorhandene STDIO-Konfiguration erst entfernen, nachdem die HTTP-Variante getestet wurde. Codex unterstützt für Streamable-HTTP-MCPs Bearer-Tokens aus einer benannten Umgebungsvariable; der Tokenwert gehört nicht in config.toml.
Lokaler STDIO-Betrieb
[mcp_servers.dockhand-readonly]
command = "node"
args = ["/absolute/path/to/src/server.mjs"]
[mcp_servers.dockhand-readonly.env]
DOCKHAND_URL = "https://dockhand.example.com"
DOCKHAND_TOKEN_FILE = "/absolute/path/to/dockhand-token"Tests
npm ci
npm test
npm run live-check
docker build -t local/dockhand-readonly-mcp:0.2.0 .Available Tools
8 toolsdockhand_healthCheck Dockhand healthARead-onlyIdempotent
Checks whether the configured Dockhand service is reachable and healthy.
Inputs: no named parameters.
get_container_summaryGet a Docker container summaryARead-onlyIdempotent
Gets a sanitized summary for one container ID returned by list_containers. It never returns environment variables, labels, mounts, logs, commands, or raw inspect data.
Inputs: container_id (required), environment_id.
get_network_summaryGet a Docker network summaryARead-onlyIdempotent
Gets a sanitized summary for one network ID returned by list_networks.
Inputs: network_id (required), environment_id.
get_runtime_overviewSummarize Docker runtimeARead-onlyIdempotent
Returns aggregate container, health, network-isolation, and stack-state counts for routine monitoring.
Inputs: environment_id.
list_containersList Docker containersARead-onlyIdempotent
Lists container identity, image, runtime health, ports, metrics, and network membership. Secrets, labels, mounts, logs, and commands are omitted.
Inputs: environment_id.
list_environmentsList Docker environmentsARead-onlyIdempotent
Lists safe summaries of Docker environments known to Dockhand. Connection URLs and credentials are omitted.
Inputs: no named parameters.
list_networksList Docker networksARead-onlyIdempotent
Lists network driver, internal flag, IPAM ranges, and sanitized container membership. Labels and driver options are omitted.
Inputs: environment_id.
list_stacksList Docker stacksARead-onlyIdempotent
Lists stack names, states, types, and resource counts. Compose files, repository URLs, paths, and secrets are omitted.
Inputs: environment_id.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool has a distinct purpose: health check, list environments, list containers, get one container, list networks, get one network, list stacks, and aggregate overview. The list vs. get pairing for containers and networks prevents confusion, and the overview and health tools are uniquely scoped.
Most tools follow a consistent verb_noun pattern (list_*, get_*, get_*_summary). The outlier is dockhand_health, which reads as a noun phrase rather than a verb-based action, but it is still understandable and does not break the overall pattern significantly.
With 8 tools, this server is well-scoped for a read-only Docker inspection and monitoring service. Each tool covers a necessary facet (environments, containers, networks, stacks, health, and overview) without redundancy or bloat.
The server covers the main read-only monitoring operations: listing and summarizing containers and networks, listing stacks and environments, plus a health check and runtime overview. A get_stack_summary or get_environment_summary could be expected, but their absence seems intentional for security/sanitization reasons, and the core workflows are covered.
Maintenance
Related MCP Connectors
Docker Hub MCP — wraps the Docker Hub v2 API (free, no auth required for public data)
Read-only MCP access to a documented IT fleet: state, changes, posture. 15 tools.
Read-only MCP server for The Quiet Protocol's engines, benchmarks, proof, and business data.
MEOK ABCI Bridge MCP — read-only Tendermint / Cosmos blockchain query for agents. Built-in registry
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceLightweight MCP server for Portainer CE, focused on Docker Swarm environments with read-only tools by default and optional mutations.MIT
- AlicenseNot gradedqualityDmaintenanceRead-only MCP server to inspect allowlisted Docker containers, systemd services, JSONL logs, and HTTP health endpoints without arbitrary shell access.MIT
- AlicenseNot gradedqualityBmaintenanceMCP sidecar server that exposes Dockhand's container, image, volume, network, and stack management as MCP tools over Streamable HTTP, enabling MCP clients to manage Docker resources through Dockhand's REST API.3MIT
- AlicenseNot gradedqualityDmaintenanceMCP server exposing the Dockhand API as MCP tools. Enables AI assistants to manage Docker infrastructure including containers, stacks, images, networks, and volumes across multiple hosts.MIT