Skip to content

dive-mcp

MCP server for dive — inspect container image layers, find wasted space, and run CI-style efficiency checks from AI coding assistants.

  • Layer analysis


    Inspect image layers, digests, sizes, and build commands without leaving your editor.

    MCP tools

  • Efficiency scoring


    Get wasted-byte totals, efficiency scores, and CI-style pass/fail thresholds.

    CI check

  • Works in your assistant


    Drop-in configs for Cursor, Claude Code, Codex, and Claude Desktop.

    Configuration

Quick start

Prerequisites

Install dive and ensure Docker or Podman is running. dive-mcp shells out to your local dive binary — it is not bundled.

go install github.com/codenio/dive-mcp/cmd/dive-mcp@latest
dive-mcp --version

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "dive-mcp": {
      "command": "dive-mcp",
      "args": []
    }
  }
}
claude mcp add dive-mcp -- dive-mcp

Add to ~/.codex/config.toml:

[mcp_servers.dive-mcp]
command = "dive-mcp"
args = []

Restart your MCP client, then ask:

Analyze alpine:latest with dive-mcp and tell me the efficiency score and top wasted files.

See Configuration for environment variables and example configs.

Tools

Tool Description
analyze_image Image size, efficiency score, wasted bytes, layer count
list_layers Per-layer digest, size, and build command
get_wasted_space Top duplicated files across layers
ci_check Pass/fail against efficiency and waste thresholds

Documentation

Doc Contents
Configuration Client setup and environment variables
MCP tools MCP tool reference
Development guide Build, test, pre-commit hooks
Architecture How dive-mcp invokes and parses dive
Dive compatibility Supported dive versions
Releasing Maintainer release workflow