What it doesBasics
- Container lifecycle, exec, copy, logs, stats, and health
- Image build, pull, push, tag, inspect, removal, and prune
- Network and volume lifecycle
- MCP session ownership, quotas, tags, discovery, and container adoption
- Metrics, health endpoints, and audit-oriented tracing
First useBasics
- Inspect the intended daemon and an owned evaluation container before changing resources.
- Run iterative work and inspect its output and state.
- Clean up explicitly before the session ends when teardown is intended.
Everyday tasksEveryday use
Run a stateful agent container
An agent needs a persistent environment for an iterative build, test, and repair loop.
- Start MCP Docker as an MCP server with an allowed-registry policy.
- Call run_container with an allowed image, a stable name, and explicit memory/PID limits.
- Verify the returned ID with list_containers, then execute work and inspect logs or health.
- Call cleanup_session before every success, failure, timeout, or cancellation path disconnects.
What you getThe iterative workload retains state while MCP ownership and teardown remain explicit.
How to check: Container ID, cross-session-visible inventory, health, command results, logs, and cleanup output document the lifecycle.
Build and verify an image
A change must be built into a container image and exercised before publication.
- Build the image through the mediated tool surface.
- Start a health-checked container and inspect its status and logs.
- Clean session resources explicitly and remove the image separately when required.
What you getThe image is exercised through the same controlled operation path used for runtime work.
How to check: Build result, container health, logs, explicit cleanup, and image-removal results support review.
Settings to decideAdvanced
- Docker daemon
- DOCKER_HOST takes a Unix socket; review the service account’s effective daemon privileges.
- Allowed registries and quotas
- ALLOWED_REGISTRIES defaults to docker.io,ghcr.io; MAX_CONTAINERS_PER_SESSION defaults to 100 (MCP_CONTAINER_LIMIT is its legacy alias).
- State and session lifetime
- Persistent state is the default at STATE_FILE_PATH=tmp/state.json; USE_MEMORY_STATE=true opts out. LEDGER_ENTRY_TTL_SECS defaults to 86400 and reclaims empty bookkeeping entries. cleanup_session runs over MCP; the CLI is a separate, session-independent tenancy.
- Timeouts and retries
- OPERATION_TIMEOUT_SECS defaults to 120, with build/pull/push/wait fixed at 300. RUNTIME_MAX_RETRIES defaults to 3 and RUNTIME_RETRY_DELAY_MS to 100.
- Metrics and health
- ENABLE_METRICS opts into an HTTP listener; METRICS_PORT defaults to 9090. Expose /metrics and /health* only inside the intended operations boundary; RUST_LOG controls server diagnostics.
CommandsAdvanced
Problems and fixesHelp
Good to knowHelp
- MCP Docker is a standalone MAIT capability, installed separately from the MAIT image.
- The service controls the Docker daemon it connects to.
- Session ownership gates mutations of managed resources.
- Containers can be adopted into a session under operator policy.
- Disconnect leaves resources running; call cleanup_session before the session ends to tear them down.