Skip to content
MCP server

Dockerfile Lint

Lint Dockerfiles for root users, latest tags, secrets in ENV or ARG and more

Runs locallyStatus and history
Install
Pricing
Open source
Platforms
CLI, Linux, macOS
Runs
Locally
Version
0.3.0
Listing updated
2 days ago

About Dockerfile Lint

Dockerfile Lint is an open-source MCP server for developer tools. It runs locally on your machine and is started by your AI client.

This server does static analysis only and never invokes Docker. It parses Dockerfiles including comments, the escape directive, line continuations, heredocs and multi-stage builds, then reports findings with a rule id, severity, line and fix. Rules cover a final stage running as root, missing or latest tags, credential-like ENV and ARG names, a missing HEALTHCHECK, apt-get without cleanup, curl piped to sh, EXPOSE 22, COPY . . without sensible ignore coverage, and others.

A separate parse tool returns instructions with line ranges and stage names, and an explain tool describes a single rule. It also reads the sibling .dockerignore (up to 64 KB) to decide whether the copy-whole-context warning applies. The README is candid that the rules are text heuristics and a clean result does not scan the image's packages.

It runs over stdio from a pinned Docker image that sees only the directory you mount, makes no network requests and sends no telemetry.

Install

Run in a terminal

claude mcp add mcp-dockerfile-lint -- docker run -i --rm ghcr.io/basitalisandhu/mcp-dockerfile-lint:0.3.0

Add to claude_desktop_config.json

{
  "mcpServers": {
    "mcp-dockerfile-lint": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/basitalisandhu/mcp-dockerfile-lint:0.3.0"
      ]
    }
  }
}
Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "mcp-dockerfile-lint": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/basitalisandhu/mcp-dockerfile-lint:0.3.0"
      ]
    }
  }
}
Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to .vscode/mcp.json

{
  "servers": {
    "mcp-dockerfile-lint": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/basitalisandhu/mcp-dockerfile-lint:0.3.0"
      ]
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "mcp-dockerfile-lint": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/basitalisandhu/mcp-dockerfile-lint:0.3.0"
      ]
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "mcp-dockerfile-lint": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/basitalisandhu/mcp-dockerfile-lint:0.3.0"
      ]
    }
  }
}

Tools this server provides (3)

Taken from the project documentation; the running server may differ.

lint_dockerfile
Lint a Dockerfile and return findings with fixes.
parse_dockerfile
Parse instructions, stages and base images.
explain_rule
Explain one lint rule.

What it does

Production-focused rules
Flags root users, latest tags, missing digests and health checks.
Secret detection
Catches credential-like ENV and ARG names and literals.
Package manager hygiene
Checks apt-get, apk and pip flags.
Dockerfile parsing
Returns instructions, stages and base images.
Rule explanations
Gives severity, description and fix for one rule.
Dockerignore awareness
Considers .dockerignore coverage for .git, .env and node_modules.

Good for

  • Review a Dockerfile before opening a pull request
  • Find why a multi-stage build runs as root
  • Check a base image reference for pinned tags
  • Understand a lint rule and its fix

Pricing

Open source

MIT licensed

Prices change. Check basitalisandhu.github.io before you buy.

Dockerfile Lint FAQ

Does it need Docker to lint?

No. It is static analysis and Docker is never invoked; the server itself ships as a container.

Does it scan image packages?

No. A clean result only means the text rules passed.

What files does it read?

The Dockerfile you name (up to 1 MB) and its .dockerignore (up to 64 KB).

Is it on npm?

Not yet, according to the README; use the pinned GHCR image.

Is Dockerfile Lint free?

Yes. Dockerfile Lint is open source, so you can use and self-host it for free.

How do I add Dockerfile Lint to Claude Code?

Run this command in your terminal: claude mcp add mcp-dockerfile-lint -- docker run -i --rm ghcr.io/basitalisandhu/mcp-dockerfile-lint:0.3.0

What are the best alternatives to Dockerfile Lint?

The closest alternatives to Dockerfile Lint are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

Alternatives to Dockerfile Lint

  1. REA

    MCP server

    CLI and MCP server that lets coding agents reverse engineer apps and binaries

    Runs locally
    • Open source
    • 464K GitHub stars
    • Developer tools
  2. Codebase Memory

    MCP server

    Local MCP server that builds a code knowledge graph for AI coding agents

    Runs locally
    • Open source
    • 48.7K GitHub stars
    • Knowledge and memory
  3. GitHub

    MCP server

    Official MCP server connecting AI assistants to GitHub repos, issues and workflows

    Not checked yet
    • Remote
    • Open source
    • 34.5K GitHub stars
    • Developer tools
  4. MCP toolkit giving coding agents symbol-level code retrieval and editing

    Runs locally
    • Open source
    • 31.5K GitHub stars
    • Developer tools
  5. XERJ

    MCP server

    Local search engine for AI agents with cited answers over your code and docs

    Runs locally
    • Open source
    • 19.2K GitHub stars
    • Knowledge and memory
  6. Ouroboros

    MCP server

    Spec-first layer that pins requirements and verifies results of AI coding agent work

    Runs locally
    • Open source
    • 6.4K GitHub stars
    • Developer tools