docker_mcp_server
Model Context Protocol MCP Server for Docker Commands. Provides Docker and Docker Swarm commands as MCP Tools.
claude mcp add --transport stdio makbn-docker_mcp_server java -jar docker-mcp-server.jar --docker-host=tcp://localhost:2376 --tls-verify --cert-path=/etc/docker/certs --server-name=docker_mcp_server --server-version=1.0.0.0 --max-connections=150 --docker-config=/custom/docker/config \ --env DOCKER_MCP_LOG_FILE="Path to log output file" \ --env DOCKER_MCP_LOG_LEVEL="Logging level (TRACE, DEBUG, INFO, etc.)"
How to use
This MCP server exposes existing Docker commands as MCP Tools using the MCP Mediator framework. It automatically generates MCP Tools from the Docker client/service methods, so you can discover and invoke Docker operations through MCP tooling without writing separate API clients. The server is configured to connect to a Docker daemon (via --docker-host) and then presents a suite of tools such as docker_start_container, docker_stop_container, docker_list_containers, docker_pull_image, docker_inspect_container, docker_remove_image, and many more. Tools can be discovered by your MCP client UI or runtime and invoked with parameters that map to Docker CLI options or API fields. When non-annotated methods are enabled, the mediator can generate tools from method signatures, class names, and package structure, expanding the available tool set beyond explicitly annotated commands.
To run, provide the Java runtime and the docker-mcp-server.jar along with the necessary Docker and server configuration options (host, TLS settings, server name/version, and Docker config path). The server then exposes the generated MCP Tools for consuming clients to use in automation, dashboards, or CLI workflows.
How to install
Prerequisites:
- Java Development Kit (JDK) 11 or newer
- Maven (for building from source) if you plan to compile the project
- Access to a Docker daemon (or a remote Docker host) configured for MCP usage
Installation steps:
-
Clone the repository (and its submodules): git clone --recurse-submodules https://github.com/makbn/docker_mcp_server.git cd docker_mcp_server
-
Build the project (via Maven): mvn clean package // This will produce a JAR, for example: target/mcp-mediator-implementation-docker-[version].jar
-
Run the MCP server: java -jar docker-mcp-server.jar --docker-host=tcp://localhost:2376
--tls-verify
--cert-path=/etc/docker/certs
--server-name=docker_mcp_server
--server-version=1.0.0.0
--max-connections=150
--docker-config=/custom/docker/config -
Optional: Build a native image (GraalingVM) if you need a standalone executable: mvn clean package native-image -jar mcp-mediator-implementation-docker-[version].jar // Run the resulting executable directly
-
Validate discovery and usage from a client or CLI tool configured to query MCP tools from the server.
Additional notes
Tips and common considerations:
- Ensure the Docker daemon is reachable from the MCP server host (check --docker-host and network ACLs).
- If using TLS, provide the correct certificate path via --cert-path and ensure TLS verification aligns with your setup (--tls-verify).
- The MCP server uses environment variables DOCKER_MCP_LOG_LEVEL and DOCKER_MCP_LOG_FILE to control logging behavior; adjust as needed for debugging and production parity.
- The tool set can expand automatically if createForNonAnnotatedMethods(true) is enabled in the MCP Mediator configuration, enabling tools derived from non-annotated Docker service methods.
- When upgrading the server or mediator, re-run the build to regenerate the executable and ensure compatibility with the Docker API version in use.
- If a tool is not appearing in discovery, verify that the underlying Docker command is exposed by the mediator and that any required method annotations or naming conventions are satisfied.
Related MCP Servers
mcp-for-beginners
This open-source curriculum introduces the fundamentals of Model Context Protocol (MCP) through real-world, cross-language examples in .NET, Java, TypeScript, JavaScript, Rust and Python. Designed for developers, it focuses on practical techniques for building modular, scalable, and secure AI workflows from session setup to service orchestration.
jadx-ai
Plugin for JADX to integrate MCP server
sonarqube
Model Context Protocol (MCP) server for SonarQube
sandbox
A Model Context Protocol (MCP) server that enables LLMs to run ANY code safely in isolated Docker containers.
pluggedin-app
The Crossroads for AI Data Exchanges. A unified, self-hostable web interface for discovering, configuring, and managing Model Context Protocol (MCP) servers—bringing together AI tools, workspaces, prompts, and logs from multiple MCP sources (Claude, Cursor, etc.) under one roof.
awesome s
A curated list of excellent Model Context Protocol (MCP) servers.