docs/guide/mcp.md
Dozzle supports the Model Context Protocol (MCP) to allow AI coding assistants to interact with your Docker containers. When enabled, Dozzle exposes an MCP endpoint at /api/mcp using the Streamable HTTP transport, served from the same container — no extra processes or sidecars needed.
This feature is disabled by default. To enable it, set the --enable-mcp flag or DOZZLE_ENABLE_MCP environment variable to true.
::: code-group
docker run --volume=/var/run/docker.sock:/var/run/docker.sock -p 8080:8080 amir20/dozzle --enable-mcp
services:
dozzle:
image: amir20/dozzle:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 8080:8080
environment:
DOZZLE_ENABLE_MCP: true
:::
All tools are read-only and do not modify containers.
| Tool | Description |
|---|---|
list_containers | List all containers across all hosts. Supports optional state filter. |
get_container_logs | Fetch structured logs with detected levels, JSON parsing, and multi-line grouping. |
list_hosts | List all connected Docker hosts. |
get_container_stats | Get CPU and memory usage history for a container. |
Add the following to your .vscode/mcp.json or user MCP settings:
{
"servers": {
"dozzle": {
"type": "http",
"url": "http://localhost:8080/api/mcp"
}
}
}
Add the following to your Claude Desktop MCP configuration:
{
"mcpServers": {
"dozzle": {
"type": "streamable-http",
"url": "http://localhost:8080/api/mcp"
}
}
}
[!NOTE] Replace
localhost:8080with your Dozzle instance address. If Dozzle is configured with a custom base path (e.g.,--base /dozzle), the MCP endpoint will be at/dozzle/api/mcp.
The MCP endpoint is part of the authenticated API group. When authentication is enabled, MCP clients must provide valid credentials.
With --auth-provider simple, MCP clients need to include a valid JWT token in the Authorization header. To obtain a token:
POST request to /api/token with your username and password.For example, in VS Code MCP settings:
{
"servers": {
"dozzle": {
"type": "http",
"url": "http://localhost:8080/api/mcp",
"headers": {
"Authorization": "Bearer <your-jwt-token>"
}
}
}
}
With --auth-provider forward-proxy, the reverse proxy in front of Dozzle handles authentication and injects the appropriate headers. MCP clients should connect through the same proxy, and authentication will be handled transparently.
With no authentication provider configured (default), the MCP endpoint is publicly accessible. No additional configuration is needed.