Automate Docker operations through AI agents with this powerful Model Context Protocol integration. Manage containers, monitor deployments, and orchestrate workflows using natural language commands.
The Docker MCP Server is designed to streamline Docker container management using AI-driven automation. It provides a seamless interface for creating, monitoring, and controlling Docker containers through the Model Context Protocol (MCP).
# Clone and setup
git clone https://github.com/yourusername/docker-mcp.git
cd docker-mcp
npm install
# Start the MCP server (requires Docker running)
node index.js
// config/docker.config.js
export const dockerConfig = {
socketPath: process.env.DOCKER_SOCKET || '/var/run/docker.sock'
};
Add the server to your MCP configuration file (cline_mcp_settings.json
):
{
"mcpServers": {
"dockerMcp": {
"command": "node",
"args": ["docker-mcp/index.js"],
"env": {},
"disabled": false,
"autoApprove": []
}
}
}
This configuration will:
1. Make the Docker MCP server available system-wide
2. Auto-start with your development environment
3. Allow seamless integration with other MCP tools
{
"image_name": "string",
"tag": "string"
}
Creates a new container from specified image and tag.
{
"container_id": "string"
}
Retrieves detailed information about a container.
{
"container_id": "string"
}
Checks current status of a container (running, paused, exited).
{
"container_id": "string",
"desired_state": "start|pause|kill"
}
Manages container state transitions.
<use_mcp_tool>
<server_name>dockerMcp</server_name>
<tool_name>createConatinerByImage</tool_name>
<arguments>
{
"image_name": "nginx",
"tag": "latest"
}
</arguments>
</use_mcp_tool>
# For production environments:
export DOCKER_SOCKET="/var/run/docker.sock" # Restrict socket permissions
We welcome contributions! Please follow our contribution guidelines.
# Start the MCP server
node index.js
Note: Requires Docker Engine running with exposed Docker socket.
This is an MCP server for Docker basic container management, including creating, getting, and stopping/starting/removing containers.
No releases published
No packages published