About Dockerfile Lint
Dockerfile Lint is a static-analysis MCP server for developers reviewing Dockerfiles. It parses build instructions and reports production-oriented issues without invoking Docker.
Key features
- 01Lint security and image-build rules
- 02Parse stages and instruction locations
- 03Explain rule severity and fixes
- 04Read a file or supplied content
Use cases
- 01Check Dockerfiles before committing
- 02Review image-build security practices
- 03Understand a reported lint rule
MCP support
Exposes `lint_dockerfile`, `parse_dockerfile` and `explain_rule` tools to MCP clients over stdio.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
docker run -i --rm ghcr.io/basitalisandhu/mcp-dockerfile-lint:0.3.0Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.
ghcr.io/basitalisandhu/mcp-dockerfile-lint:0.3.0stdioTools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEdockerfile-lint MCP server
Parses Dockerfiles (comments, escape directive, line continuations, heredocs, multi-stage builds) and lints them for the mistakes that matter in production images. Static analysis only; Docker is never invoked.
Part of dev-mcp-servers. Stdio transport only; the server never opens a port.
Tools
| Tool | Input | What it returns |
|---|---|---|
lint_dockerfile | path or content, ignore? | Findings with rule id, severity, line and fix: final stage running as root, latest or missing tags, no digest, credential-like ENV/ARG names and literals, missing HEALTHCHECK, apt-get without cleanup or --no-install-recommends, apt-get upgrade, apk add without --no-cache, pip without --no-cache-dir, ADD for plain files or URLs, `curl |
parse_dockerfile | path or content | Instructions with line ranges and stage index, stages with AS names and base images, escape character. |
explain_rule | rule | Severity, description and fix for one rule. |
Install
Claude Code:
claude mcp add dockerfile-lint -- docker run --rm -i -v "$PWD:/work:ro" ghcr.io/basitalisandhu/mcp-dockerfile-lint:0.2.2
Add -s user to make it available in every project. Any client that reads .mcp.json (Claude Code, Claude Desktop, Cursor):
{
"mcpServers": {
"dockerfile-lint": {
"command": "docker",
"args": ["run", "--rm", "-i", "-v", "/path/to/your/project:/work:ro", "ghcr.io/basitalisandhu/mcp-dockerfile-lint:0.2.2"]
}
}
}
Pin the version as shown so that an update cannot change what runs in your editor without you noticing. The container sees only the mounted directory, so pass paths under /work. The package is not on npmjs.com yet, so npx does not work; see the repository README for GitHub Packages npm. From a checkout, use "command": "node", "args": ["<path>/packages/dockerfile-lint/dist/index.js"] after npm install && npm run build at the repository root.
What it touches
- Network: None.
- Local files: Reads the one file you name, up to 1 MB.
- Telemetry: none.
Notes
FROM $ARGbases are checked against the declaredARGs;scratchand stage references are exempt from tag checks.- Rules are heuristics on the text; a clean result does not scan the image's packages.
Build and test
npm install # at the repository root
npm run build -w @basitalisandhu/mcp-dockerfile-lint
npm test -w @basitalisandhu/mcp-dockerfile-lint
Tests use node:test and the SDK's in-memory transport; they do not reach the network.
Licence
MIT. See LICENSE.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.