- Explore MCP Servers
- mcp-docker
Mcp Docker
What is Mcp Docker
MCP Docker is a powerful integration tool that enables Docker operations through the Model Control Protocol (MCP) platform. It acts as a bridge between Docker commands and API services, facilitating seamless interaction with Docker containers and images via a standardized API interface.
Use cases
Use cases for MCP Docker include automating container management tasks, integrating Docker operations into CI/CD pipelines, generating reports on container usage, and managing multi-platform Docker images.
How to use
To use MCP Docker, you need to have Go 1.24.2 or higher and Docker installed. You can build it from source by cloning the repository and using the provided Makefile commands to build binaries or Docker images. You can also pull images from registries and manage Docker containers using various commands like ps, exec, and run.
Key features
Key features of MCP Docker include listing and managing Docker containers, executing commands within containers, inspecting changes to container filesystems, managing Docker images, pulling images from registries, and generating Software Bill of Materials (SBOM).
Where to use
MCP Docker can be used in various fields such as software development, DevOps, and cloud computing, where containerization and Docker management are essential for application deployment and orchestration.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Mcp Docker
MCP Docker is a powerful integration tool that enables Docker operations through the Model Control Protocol (MCP) platform. It acts as a bridge between Docker commands and API services, facilitating seamless interaction with Docker containers and images via a standardized API interface.
Use cases
Use cases for MCP Docker include automating container management tasks, integrating Docker operations into CI/CD pipelines, generating reports on container usage, and managing multi-platform Docker images.
How to use
To use MCP Docker, you need to have Go 1.24.2 or higher and Docker installed. You can build it from source by cloning the repository and using the provided Makefile commands to build binaries or Docker images. You can also pull images from registries and manage Docker containers using various commands like ps, exec, and run.
Key features
Key features of MCP Docker include listing and managing Docker containers, executing commands within containers, inspecting changes to container filesystems, managing Docker images, pulling images from registries, and generating Software Bill of Materials (SBOM).
Where to use
MCP Docker can be used in various fields such as software development, DevOps, and cloud computing, where containerization and Docker management are essential for application deployment and orchestration.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
MCP Docker Integration Tool
Overview
MCP Docker is a powerful integration tool that provides Docker operations through the Model Control Protocol (MCP) platform. It serves as a bridge between Docker commands and API services, allowing seamless interaction with Docker containers and images through a standardized API interface.
Available Operations
ps- List and manage Docker containersexec- Execute commands in containersdiff- Inspect changes to container filesystemshistory- Show image historyimage- Manage Docker imagesinspect- Get detailed information about Docker objectspull- Pull images from registriesrun- Create and start containerssbom- Generate Software Bill of Materialssearch- Search Docker images
Prerequisites
- Go 1.24.2 or higher
- Docker installed and running
- golangci-lint (for development)
Installation
Build from Source
# Clone the repository
git clone https://github.com/mark3labs/mcp-docker
cd mcp-docker
# Build for current platform
make build
# Build for all supported platforms
make build-all
Docker Image
# Build Docker image
make docker
# Build and push to registry
REGISTRY=your-registry make docker-push
Makefile Commands
| Command | Description | Example |
|---|---|---|
make build |
Build binary for current platform | make build |
make build-all |
Build for multiple platforms (linux/amd64, linux/arm64, darwin/amd64, darwin/arm64) | make build-all |
make docker |
Build Docker image | make docker |
make docker-push |
Push Docker image to registry | REGISTRY=your-registry make docker-push |
make test |
Run tests | make test |
make test-coverage |
Run tests with coverage | make test-coverage |
make lint |
Run linter | make lint |
make clean |
Remove build artifacts | make clean |
make clean-docker |
Remove Docker images | make clean-docker |
make clean-all |
Remove all artifacts and Docker images | make clean-all |
Customizable Variables
VERSION(default: 0.1.0)REGISTRY(default: empty)GOOS(default: linux)GOARCH(default: amd64)
Usage
Starting the Service
# Run directly
./mcp-docker serve
# Run via Docker
docker run -d \
--name mcp-docker \
--privileged \
-v /var/run/docker.sock:/var/run/docker.sock \
-e DOCKER_TLS_CERTDIR= \
-p 8080:8080 \
mcp-docker:latest
Development
Project Structure
. ├── api/ # API definitions ├── cmd/ # Command line interface ├── internal/ # Internal packages │ └── docker/ # Docker operations implementation ├── pkg/ # Public packages ├── Dockerfile # Container image definition ├── Makefile # Build and development commands └── main.go # Application entry point
Testing
# Run all tests
make test
# Run tests with coverage
make test-coverage
Linting
# Run linter
make lint
Docker Configuration
Environment Variables
DOCKER_TLS_CERTDIR: TLS certificate directoryDOCKER_API_VERSION: Docker API version (default: 1.48)TZ: Timezone (default: UTC)
Volume Mounts
/var/run/docker.sock:/var/run/docker.sock- Docker daemon socket
Network Configuration
The container requires access to:
- Host network (when using host networking mode)
- Docker daemon socket
- Exposed port 8080 for API access
Claude.AI Integration
{
"docker": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"--name",
"mcp-docker",
"--privileged",
"-v",
"/var/run/docker.sock:/var/run/docker.sock",
"-e",
"DOCKER_TLS_CERTDIR=",
"-e",
"DOCKER_API_VERSION=1.48",
"--network",
"host",
"mcp-docker:latest"
]
}
}
Dependencies
Main Dependencies
- github.com/mark3labs/mcp-go v0.20.1
- github.com/spf13/cobra v1.9.1
Indirect Dependencies
- github.com/google/uuid v1.6.0
- github.com/inconshreveable/mousetrap v1.1.0
- github.com/spf13/pflag v1.0.6
- github.com/yosida95/uritemplate/v3 v3.0.2
License
This project is licensed under the MIT License - see the LICENSE file for details.
The MIT License is a permissive license that is short and to the point. It lets people do anything they want with your code as long as they provide attribution back to you and don’t hold you liable.
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Security
This tool requires privileged access to the Docker daemon. Ensure proper security measures are in place when deploying in production environments.
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










