Connect Docker Engine to Claude Code

Inspect and restart containers, images, and Compose services on a Docker host. Add Toolspoke to Claude Code once and it can use 12 Docker Engine actions. Your Docker Engine credential stays in Toolspoke, and you choose which actions Claude Code may call.

Set it up in Claude Code

Three steps, the first one once for every toolkit you will ever add.

  1. Add Toolspoke to Claude Code

    Run it in your project, then /mcp to sign in

    claude mcp add --transport http toolspoke https://toolspoke.com/mcp

    The sign-in opens in your browser, and Toolspoke asks you to approve it.

  2. Install Docker Engine and connect it

    Add Docker Engine to a project in your Toolspoke workspace.

    Engine API URL. You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.

    Engine API URL
    A publicly reachable Docker Engine API endpoint, usually a socket proxy. Never expose an unauthenticated daemon.
  3. Choose what Claude Code may do

    All 12 actions start on. Switch off any of the 3 actions that change something in Docker Engine, and Claude Code gets a refusal if it tries.

What you can ask Claude Code for

A few of the Docker Engine actions that only read, so they are safe to try first.

  • List containers on the daemon with their image, state, uptime and published ports
  • Read the tail of a container's logs, with stdout and stderr returned separately
  • List the processes running inside a container, as `docker top` does
  • List images held on the daemon with their tags, size and creation date

What Claude Code can do in Docker Engine

9 actions read and 3 write.

Reads

  • List containers

    List containers on the daemon with their image, state, uptime and published ports. Defaults to running containers only; set all to true to include stopped ones. Start here to find the container name that the other actions need.

  • Inspect container

    Return the configuration and current state of one container: exit code, health check result, restart policy, resource limits, port bindings, mounts and network addresses. Use it after list_containers to explain why a container is unhealthy or restarting. Environment variables are deliberately omitted because they usually hold secrets.

  • Container logs

    Read the tail of a container's logs, with stdout and stderr returned separately. This is the fastest way to diagnose a crashing or noisy container. Output is capped at roughly 20000 characters per stream, keeping the most recent lines.

  • Container stats

    Sample one container's live CPU, memory, network and block I/O usage and return a computed summary, the same numbers `docker stats` shows. Takes a couple of seconds because the daemon needs two samples to derive CPU percentage.

  • Container processes

    List the processes running inside a container, as `docker top` does. Use it to confirm whether the expected worker or server process is actually alive inside a container that looks healthy from the outside.

  • List images

    List images held on the daemon with their tags, size and creation date. Use it to check whether a deploy tag has actually been pulled, or to find images taking up disk.

  • Inspect image

    Return the details of one image: entrypoint, command, exposed ports, labels, layer count, architecture and the digest it was pulled at. Use it to verify what a running tag actually contains.

  • System info

    Report the daemon's own health: engine version, OS and kernel, storage driver, CPU and memory available, and how many containers are running, paused or stopped. Call it when you need to know what the host itself looks like.

  • Disk usage

    Summarise how much disk images, containers, local volumes and the build cache are using, as `docker system df` does. Use it before asking a human to reclaim space; this adapter never prunes anything itself.

Writes

  • Start container

    Start a stopped container. Returns a note instead of an error when the container is already running.

  • Stop container

    Stop a running container with SIGTERM, escalating to SIGKILL after the grace period. The container keeps its filesystem and can be started again, this never removes it. Returns a note instead of an error when it is already stopped.

  • Restart container

    Restart a container in place, the usual first remediation for a wedged or leaking service. The container and its data are preserved.

Docker Engine in Claude Code: questions

Does Claude Code see my Docker Engine credential?

No. The credential is stored encrypted in Toolspoke, and the gateway adds it to each call. Claude Code only ever talks to Toolspoke, and the dashboard shows the last four characters of the credential and nothing more.

Can I stop Claude Code from changing things in Docker Engine?

Yes. Each of the 12 actions can be switched off for a project. Turn off the 3 that change something and Claude Code can only read.

Will 12 actions crowd Claude Code's context?

No. Toolspoke shows Claude Code five bridge tools, plus a guide where a toolkit has one, and Claude Code searches for the Docker Engine action it needs when it needs it. Adding more toolkits does not add more tools to its list.

Can I add it once for every project?

Yes. Add --scope user to the command and Claude Code keeps Toolspoke in every project on this machine. Without it, the server is added to the project you ran the command in.

What does it cost?

Tool calls are free on every plan, and a Docker Engine call does not run in a sandbox, so it bills nothing.

Try Docker Engine in Claude Code

Free to start, and tool calls cost nothing on any plan.