mcp -docker
Docker's MCP Server
claude mcp add --transport stdio nideil-mcp-server-docker docker run -i --rm freezeolo/docker-mcp-server
How to use
This MCP server exposes a Docker-focused MCP endpoint that enables programmatic control over Docker Desktop from any MCP-aware client. It provides capabilities such as container lifecycle management (list, start, restart, stop, remove, create), network management (list, create, connect, disconnect, remove, inspect), image management (list, pull, push, remove, tag, build, inspect), and log retrieval for containers. With the docker-mcp-stdio entry point, you can integrate automation scripts, IDE tooling, or CI systems to orchestrate Docker containers and resources via the MCP protocol, without needing direct Docker CLI usage.
To use it, connect your MCP client to the server and invoke the available tools. For example, you can request a list of containers, create a new container with a specific image and environment, or pull and tag images for deployment pipelines. The server exposes detailed inputs for each operation, such as containerId for container-specific actions, imageName for image operations, and networkId for network-related tasks, making automation straightforward and script-friendly.
How to install
Prerequisites:
- Docker Desktop installed and running (Windows, macOS, or Linux).
- Optional: ensure the Docker daemon is accessible as required by your environment.
Steps:
- Install Docker if you haven't already. Visit https://docs.docker.com/get-docker/ and follow the installation instructions for your OS.
- Start the MCP server using the Docker image provided in this repository:
# Run the MCP server container in interactive mode
docker run -i --rm freezeolo/docker-mcp-server
This container acts as an MCP server implementing the Docker-related MCP endpoints. If you need to customize, you can pass additional environment variables or mount configurations as needed by your workflow. 3) (Optional) Expose the MCP server to your network or CI environment as appropriate for your setup. The default image assumes Docker Desktop is available in the host environment; adjust networking accordingly if running in remote contexts.
Additional notes
Tips and considerations:
- The example configuration in this repository uses the Docker image freezeolo/docker-mcp-server. Ensure this image is appropriate for your environment or replace it with a preferred image if needed.
- When running in Windows with Docker Desktop, follow the repository's guidance to expose the Docker daemon (tcp://localhost:2375) if your MCP clients require it. This is necessary for the MCP server to communicate with Docker Desktop.
- If you encounter connectivity issues, verify that the MCP server container can reach the Docker daemon on the host, and confirm that the Docker daemon is listening on the expected address/port.
- For production usage, consider pinning specific image versions, setting restart policies, and securing MCP access through authentication or network controls as appropriate for your environment.
- The Tools section lists a growing set of capabilities; use the available operations to automate container lifecycles, networks, and image management via MCP requests.