@thelord/mcp-server-docker-npx
v0.4.0
Published
π Docker MCP Server with NPX support - Manage Docker containers, images, networks, and volumes with natural language. Includes Docker socket access and remote Docker support via SSH/TCP.
Downloads
361
Maintainers
Readme
π MCP Server Docker (NPX Package)
A powerful Model Context Protocol (MCP) server for Docker management with NPX support. Control Docker containers, images, networks, and volumes using natural language through Claude and other MCP-compatible AI clients.
π Quick Start
# Run directly with npx (no installation needed)
npx mcp-server-docker-npx
# Or install globally
npm install -g mcp-server-docker-npx
mcp-server-docker⨠Features
- π³ 21 Docker Tools: Complete container, image, network, and volume management
- π Docker Socket Access: Auto-detection and mounting for Docker-in-Docker scenarios
- π Remote Docker Support: SSH, TCP, and socket connections
- π― Natural Language Interface: Use with Claude Desktop and other MCP clients
- π₯οΈ Cross-Platform: Works on macOS, Linux, and Windows
- π¦ Zero Configuration: Auto-detects Docker installations and sockets
π οΈ Installation Options
Option 1: NPX (Recommended)
npx mcp-server-docker-npx --helpOption 2: Global Install
npm install -g mcp-server-docker-npx
mcp-server-docker --helpOption 3: Python Backend (Required)
# Install the Python MCP server backend
pip install mcp-server-docker
# Or with uv
uv tool install mcp-server-dockerπ§ Claude Desktop Configuration
Add this to your Claude Desktop MCP configuration:
Local Docker
{
"mcpServers": {
"docker": {
"command": "npx",
"args": ["mcp-server-docker-npx"]
}
}
}Remote Docker (SSH)
{
"mcpServers": {
"docker-remote": {
"command": "npx",
"args": ["mcp-server-docker-npx", "--docker-host", "ssh://user@hostname"]
}
}
}Remote Docker (TCP)
{
"mcpServers": {
"docker-tcp": {
"command": "npx",
"args": ["mcp-server-docker-npx"],
"env": {
"DOCKER_HOST": "tcp://192.168.1.100:2376"
}
}
}
}π οΈ Available Tools
π¦ Containers (9 tools)
list_containers- List all Docker containerscreate_container- Create a new containerrun_container- Run an image in a new containerrun_container_with_socket- π Run container with Docker socket accessrecreate_container- Stop, remove, and recreate a containerstart_container- Start a stopped containerstop_container- Stop a running containerremove_container- Remove a containerfetch_container_logs- Get container logs
πΏ Images (4 tools)
list_images- List Docker imagespull_image- Pull an image from registrypush_image- Push an image to registrybuild_image- Build image from Dockerfileremove_image- Remove an image
π Networks (3 tools)
list_networks- List Docker networkscreate_network- Create a Docker networkremove_network- Remove a Docker network
πΎ Volumes (3 tools)
list_volumes- List Docker volumescreate_volume- Create a Docker volumeremove_volume- Remove a Docker volume
π System & Socket (3 tools)
docker_socket_info- π Get Docker socket informationdocker_system_info- π Get detailed system informationdocker_compose- Natural language container orchestration
π Remote Docker Examples
SSH Connection
# Connect to remote Docker via SSH
npx mcp-server-docker-npx --docker-host ssh://[email protected]
# With environment variable
DOCKER_HOST=ssh://user@hostname npx mcp-server-docker-npxTCP Connection
# Connect via TCP
npx mcp-server-docker-npx --docker-host tcp://192.168.1.100:2376
# With TLS
DOCKER_HOST=tcp://hostname:2376 DOCKER_TLS_VERIFY=1 npx mcp-server-docker-npxπ Docker Socket Features
Auto-Detection
The server automatically detects Docker sockets on your system:
- Linux:
/var/run/docker.sock,/run/docker.sock - macOS: Docker Desktop, Colima, and standard locations
- Windows: Named pipes for Docker Desktop
Docker-in-Docker
# Run a container with Docker socket access
# This allows the container to control the Docker daemon
run_container_with_socket:
image: "docker:latest"
mount_docker_socket: true
command: ["docker", "ps"]π¨ Security Considerations
- Docker Socket Access: Mounting the Docker socket gives full control over the Docker daemon
- Remote Connections: Use SSH keys for authentication when connecting remotely
- Container Permissions: Review containers before running, especially with socket access
π Environment Variables
DOCKER_HOST- Docker daemon host URLMCP_SERVER_DOCKER_HOST- Override Docker host for MCP serverDOCKER_TLS_VERIFY- Enable TLS verificationDOCKER_CERT_PATH- Path to TLS certificatesMCP_SERVER_AUTO_DETECT_SOCKET- Enable/disable socket auto-detection
π§ͺ Testing
# Test the NPX wrapper
npm test
# Test Python backend installation
npm run install-python
# Test with remote Docker
npx mcp-server-docker-npx --docker-host ssh://user@hostnameπ€ Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test with
npm test - Submit a pull request
π License
MIT License - see LICENSE file for details.
π Links
- GitHub: mcp-server-docker
- NPM Package: mcp-server-docker-npx
- MCP Protocol: Model Context Protocol
- Claude Desktop: Anthropic Claude
π Stats
- 21 Docker Tools available
- Cross-platform support (macOS, Linux, Windows)
- Auto-detection of Docker installations
- Remote Docker support via SSH/TCP
- Docker-in-Docker capabilities
Made with β€οΈ for the MCP community
