Provides tools for interacting with the Docker daemon to manage containers, images, networks, and volumes, including capabilities for container lifecycle management, log retrieval, and detailed resource inspection.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Docker MCP Serverlist all running containers and show their status"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Docker MCP Server
A fully functional, feature-rich, industry-standard compliant MCP (Model Context Protocol) Server that enables communication with Docker daemon. This server allows AI assistants like GitHub Copilot and Claude to interact with Docker containers, images, networks, and volumes through a standardized interface.
Quick Start
Features
✅ Complete Docker Operations: Create, run, start, stop, remove containers
✅ Proper Array Handling: Correctly handles command, entrypoint, and environment variables as arrays
✅ Image Management: Pull images, list images with detailed information
✅ Container Inspection: Get detailed container information and logs
✅ Network & Volume Support: List Docker networks and volumes
✅ VS Code Integration: Works seamlessly with GitHub Copilot and VS Code
✅ Industry Standard Compliant: Uses MCP SDK and follows best practices
Installation
Prerequisites
Node.js 18 or higher
Docker installed and running
npm or yarn package manager
Setup
Clone the repository:
Install dependencies:
Build the project:
Usage
Standalone Mode
Run the server directly:
VS Code Integration
To integrate with VS Code and GitHub Copilot, add the following to your MCP settings file:
For VS Code (~/.vscode/mcp-settings.json or in your workspace settings):
For Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
Alternative using npx (after publishing to npm):
Available Tools
Container Operations
list_containers
List all Docker containers (running or all)
create_container
Create a new Docker container
run_container
Create and start a container (recommended)
start_container
Start a stopped container
stop_container
Stop a running container
remove_container
Remove a container
inspect_container
Get detailed container information
container_logs
Get container logs
Image Operations
list_images
List Docker images
pull_image
Pull an image from registry
Network & Volume Operations
list_networks
List Docker networks
list_volumes
List Docker volumes
Key Features: Array Handling
This MCP server correctly handles arrays for:
Command: Passed as an array of strings
["python", "app.py", "--port", "8000"]Entrypoint: Passed as an array of strings
["/bin/bash", "-c"]Environment Variables: Passed as an array of
KEY=VALUEstrings["NODE_ENV=production", "PORT=3000"]Volume Bindings: Passed as an array of bind strings
["/host/path:/container/path"]
This resolves the common "array issue" where MCP servers incorrectly expect strings instead of arrays, causing errors when integrated with VS Code and GitHub Copilot.
Development
Scripts
npm run build- Compile TypeScript to JavaScriptnpm run watch- Watch mode for developmentnpm start- Run the compiled servernpm run dev- Build and run
Project Structure
Troubleshooting
Docker Connection Issues
If you get "Cannot connect to Docker daemon" errors:
Ensure Docker is running:
docker psCheck Docker socket permissions
On Linux: Add your user to the docker group:
sudo usermod -aG docker $USER
VS Code Integration Issues
If the MCP server doesn't appear in VS Code:
Verify the path to
dist/index.jsis absoluteCheck that the server builds successfully:
npm run buildRestart VS Code after updating MCP settings
Check VS Code Output panel for MCP-related errors
Array-Related Errors
This server is specifically designed to handle arrays correctly. If you encounter array errors:
Ensure you're passing arrays for
command,entrypoint, andenvfieldsVerify JSON formatting in tool arguments
Check that arrays contain string items
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
For detailed usage examples, see EXAMPLES.md.
For configuration help, see CONFIGURATION.md.
License
MIT License - see LICENSE file for details
Author
Swartdraak (eternusprocer@gmail.com)