
Docker MCP Server
Provides direct control over Docker operations through AI assistants, allowing you to manage containers, images, and other Docker resources without switching to command line.
An MCP server that enables AI assistants to manage Docker containers, images, networks, and volumes through a standardized interface. It supports comprehensive operations like container lifecycle management and image pulling while ensuring correct handling of command and environment variable arrays.
What it does
- Create and run Docker containers
- Pull images from registries
- Start and stop containers
- View container logs and details
- List and manage Docker images
- Remove containers and cleanup resources
Best for
About Docker MCP Server
Docker MCP Server is a community-built MCP server published by Swartdraak that provides AI assistants with tools and capabilities via the Model Context Protocol. Docker MCP Server — AI-driven Docker container management and automation; manage containers, images, networks, and volum It is categorized under developer tools. This server exposes 37 tools that AI clients can invoke during conversations and coding sessions.
How to install
You can install Docker MCP Server in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
License
Docker MCP Server is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
Tools (37)
List all Docker containers
List Docker images
Create a new Docker container
Run a container (create and start). This is the preferred method for starting containers.
Start a stopped Docker container
Docker MCP Server
A comprehensive, production-ready, industry-standard compliant MCP (Model Context Protocol) Server that enables full Docker management capabilities for AI assistants like GitHub Copilot and Claude. Featuring 37 powerful tools covering containers, images, networks, volumes, and system operations.
📋 Table of Contents
- About
- Quick Start
- Features
- Installation
- Usage
- Available Tools
- Testing Your Connection
- Development
- Troubleshooting
- Contributing
- Documentation
- License
About
Docker MCP Server is a Model Context Protocol server that bridges AI assistants with Docker, enabling natural language Docker operations. Built with TypeScript and following industry best practices, it provides a complete Docker management solution for AI-powered development workflows.
Why Docker MCP Server?
- 🤖 AI-Native: Designed specifically for AI assistants (GitHub Copilot, Claude)
- 🔧 Complete Coverage: 37 tools covering all essential Docker operations
- 🌐 Remote Support: Connect to Docker on any host via TCP, HTTPS, or SSH tunnel
- 🔒 Security First: Full TLS/SSL support with certificate authentication
- 📦 Production Ready: Comprehensive error handling, type safety, and testing
- 📚 Well Documented: Extensive documentation with examples for every feature
- 🚀 Easy to Use: Simple installation and configuration
Use Cases
- AI-Assisted DevOps: Let AI assistants manage your Docker infrastructure
- Container Orchestration: Create, manage, and monitor containers through natural language
- Development Automation: Automate Docker workflows with AI assistance
- Remote Management: Securely manage Docker on remote hosts
- Learning & Exploration: Explore Docker capabilities with AI guidance
Quick Start
For npm Users (Recommended)
# Install globally
npm install -g @swartdraak/docker-mcp-server
# Or use with npx (no installation needed)
npx @swartdraak/docker-mcp-server
For Developers
# Clone the repository
git clone https://github.com/Swartdraak/Docker-MCP.git
cd Docker-MCP
# Install dependencies
npm install
# Build the project
npm run build
# Start the server
npm start
✨ Features
Core Capabilities
- ✅ 37 Docker Tools: Complete coverage of Docker operations including connection validation
- ✅ Remote Docker Support: Connect to Docker on remote hosts via TCP, HTTP, HTTPS, or SSH tunnel
- ✅ Secure Connections: Full TLS/SSL support for secure remote Docker management
- ✅ Container Management: Create, run, start, stop, restart, pause, unpause, rename, remove, exec, stats, logs
- ✅ Image Operations: List, pull, build, push, tag, remove, prune
- ✅ Network Management: List, create, remove, inspect, connect, disconnect
- ✅ Volume Management: List, create, remove, inspect, prune
- ✅ System Operations: Info, version, connection validation, prune (containers, images, volumes, networks)
- ✅ Proper Array Handling: Correctly handles command, entrypoint, and environment variables
- ✅ VS Code Integration: Works seamlessly with GitHub Copilot
- ✅ Industry Standard: Uses MCP SDK and Docker best practices
- ✅ TypeScript: Full type safety and modern JavaScript features
Recent Enhancements
- 🌐 Remote Docker Host Support: Connect to Docker on any remote host
- 🔒 TLS/HTTPS Support: Secure connections with certificate authentication
- 🔑 Environment-based Configuration: Easy setup via DOCKER_HOST, DOCKER_TLS_VERIFY, DOCKER_CERT_PATH
- 🚇 SSH Tunnel Support: Secure remote access without exposing Docker API
What's New in v2.0
- 🚀 25 New Tools: Added extensive container, image, network, and volume management
- 🔧 Container Exec: Execute commands in running containers
- 📊 Container Stats: Real-time CPU, memory, network, and I/O metrics
- 🏗️ Image Building: Build images from Dockerfile with build args
- 🔄 Advanced Lifecycle: Restart, pause, unpause, rename containers
- 🌐 Full Network CRUD: Create, inspect, connect, disconnect, remove networks
- 💾 Full Volume CRUD: Create, inspect, remove volumes
- 🧹 Resource Cleanup: Prune unused containers, images, volumes, networks
- ⚙️ System Info: Get Docker daemon information and version
Installation
Via npm (Recommended)
npm install -g @swartdraak/docker-mcp-server
From Source
Prerequisites
- Node.js 18 or higher
- Docker installed and running
- npm or yarn package manager
Setup
- Clone the repository:
git clone https://github.com/Swartdraak/Docker-MCP.git
cd Docker-MCP
- Install dependencies:
npm install
- Build the project:
npm run build
Usage
Standalone Mode
Run the server directly:
npm start
Remote Docker Configuration
The MCP server supports connecting to remote Docker hosts using environment variables:
Connect to Remote Docker via TCP
DOCKER_HOST=tcp://192.168.1.100:2375 npm start
Connect to Remote Docker via HTTPS with TLS
DOCKER_HOST=https://192.168.1.100:2376 \
DOCKER_TLS_VERIFY=1 \
DOCKER_CERT_PATH=~/.docker/certs \
npm start
Connect via SSH Tunnel
First, set up an SSH tunnel:
ssh -NL localhost:2375:/var/run/docker.sock user@remote-host
Then connect to the tunneled Docker:
DOCKER_HOST=tcp://localhost:2375 npm start
VS Code Integration
To integrate with VS Code and GitHub Copilot, add the following to your MCP settings file:
For Local Docker (~/.vscode/mcp-settings.json or in your workspace settings):
{
"mcpServers": {
"docker": {
"command": "node",
"args": ["/path/to/Docker-MCP/dist/index.js"]
}
}
}
For Remote Docker over TCP:
{
"mcpServers": {
"docker": {
"command": "node",
"args": ["/path/to/Docker-MCP/dist/index.js"],
"env": {
"DOCKER_HOST": "tcp://192.168.1.100:2375"
}
}
}
}
For Remote Docker with TLS:
{
"mcpServers": {
"docker": {
"command": "node",
"args": ["/path/to/Docker-MCP/dist/index.js"],
"env": {
"DOCKER_HOST": "https://192.168.1.100:2376",
"DOCKER_TLS_VERIFY": "1",
"DOCKER_CERT_PATH": "/home/user/.docker/certs"
}
}
}
}
For Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"docker": {
"command": "node",
"args": ["/path/to/Docker-MCP/dist/index.js"]
}
}
}
Alternative using npx (after publishing to npm):
{
"mcpServers": {
"docker": {
"command": "npx",
"args": ["@swartdraak/docker-mcp-server"]
}
}
}
Testing Your Connection
Connection Test Utility
Before using the MCP server, you can test your Docker connection with the included test utility:
# Test local Docker connection
node test-connection.js
# Test remote Docker via TCP
DOCKER_HOST=tcp://192.168.1.100:2375 node test-connection.js
# Test remote Docker via TLS
DOCKER_HOST=https://192.168.1.100:2376 \
DOCKER_TLS_VERIFY=1 \
DOCKER_CERT_PATH=~/.docker/certs \
node test-connection.js
# Test SSH tunnel connection
DOCKER_HOST=tcp://localhost:2375 node test-connection.js
The test utility will:
- ✓ Validate your configuration
- ✓ Check TLS certificates (if applicable)
- ✓ Test connection to Docker daemon
- ✓ Verify Docker operations (list containers, images, networks, volumes)
- ✓ Display system information
- ✓ Provide troubleshooting recommendations
validate_connection Tool
Once the MCP server is running, you can also use the validate_connection tool from your AI assistant:
"Validate my Docker connection"
This tool performs runtime connectivity tests and returns:
- Connection status
- Docker version and API information
- System information
- Test results for common operations
Manual Testing
You can also test your connection directly with Docker CLI:
# Set environment variables
export DOCKER_HOST=tcp://192.168.1.100:2375
# Test commands
docker version
docker info
docker ps
For detailed setup instructions, troubleshooting, and platform-specific guides, see:
- CONFIGURATION.md - MCP server configuration examples
- REMOTE_SETUP.md - Comprehensive remote connection setup guide (includes Windows 11 specific instructions)
Available Tools (37 Total)
Container Operations (15 tools)
list_containers
List all Docker containers (running or all)
{
"all": true
}
`cre
README truncated. View full README on GitHub.
Alternatives
Related Skills
Browse all skillsUI design system toolkit for Senior UI Designer including design token generation, component documentation, responsive design calculations, and developer handoff tools. Use for creating design systems, maintaining visual consistency, and facilitating design-dev collaboration.
Bash Automated Testing System (BATS) for TDD-style testing of shell scripts. Use when: (1) Writing unit or integration tests for Bash scripts, (2) Testing CLI tools or shell functions, (3) Setting up test infrastructure with setup/teardown hooks, (4) Mocking external commands (curl, git, docker), (5) Generating JUnit reports for CI/CD, (6) Debugging test failures or flaky tests, (7) Implementing test-driven development for shell scripts.
Guide for building TypeScript CLIs with Bun. Use when creating command-line tools, adding subcommands to existing CLIs, or building developer tooling. Covers argument parsing, subcommand patterns, output formatting, and distribution.
Use when working with the OpenAI API (Responses API) or OpenAI platform features (tools, streaming, Realtime API, auth, models, rate limits, MCP) and you need authoritative, up-to-date documentation (schemas, examples, limits, edge cases). Prefer the OpenAI Developer Documentation MCP server tools when available; otherwise guide the user to enable `openaiDeveloperDocs`.
Master API documentation with OpenAPI 3.1, AI-powered tools, and modern developer experience practices. Create interactive docs, generate SDKs, and build comprehensive developer portals. Use PROACTIVELY for API documentation or developer portal creation.
Integrate Vercel AI SDK applications with You.com tools (web search, AI agent, content extraction). Use when developer mentions AI SDK, Vercel AI SDK, generateText, streamText, or You.com integration with AI SDK.