The Docker MCP server lets you manage Docker containers and compose stacks directly through Claude AI. It provides tools for container creation, deploying compose stacks, retrieving logs, and monitoring container status.
Before installing the Docker MCP server, ensure you have:
The easiest way to install Docker MCP for Claude Desktop is through Smithery:
npx @smithery/cli install docker-mcp --client claude
To manually set up the Docker MCP server, add the following configuration to your Claude Desktop config file:
MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"docker-mcp": {
"command": "uvx",
"args": [
"docker-mcp"
]
}
}
}
The Docker MCP server provides several tools that allow Claude to manage your Docker environment.
Use the create-container
tool to create and run a standalone Docker container:
{
"image": "image-name",
"name": "container-name",
"ports": {"80": "80"},
"environment": {"ENV_VAR": "value"}
}
You can ask Claude to create containers by specifying the image, container name, port mappings, and environment variables you need.
The deploy-compose
tool allows you to deploy multi-container applications with Docker Compose:
{
"project_name": "example-stack",
"compose_yaml": "version: '3.8'\nservices:\n service1:\n image: image1:latest\n ports:\n - '8080:80'"
}
Simply provide a project name and the compose YAML configuration for your stack.
To view logs from a specific container, use the get-logs
tool:
{
"container_name": "my-container"
}
This helps you troubleshoot issues or monitor container output.
The list-containers
tool shows all your Docker containers and their status:
{}
No additional parameters are required - Claude will retrieve and display the full list of containers.
If you need to debug the MCP server, you can use the MCP Inspector:
npx @modelcontextprotocol/inspector uv --directory <path-to-docker-mcp> run docker-mcp
This will provide a URL to access the debugging interface where you can monitor requests and responses between Claude and the MCP server.
The current version has some limitations to be aware of:
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.