Back to Browse

LayerLint MCP Server

Developer ToolsModerate5.8MCP RegistryLocal
Free

Server data from the Official MCP Registry

MCP server for Dockerfile linting, layer-cache rules, and analysis.

About

MCP server for Dockerfile linting, layer-cache rules, and analysis.

Security Report

5.8
Moderate5.8Moderate Risk

LayerLint is a read-only Dockerfile linter exposing scan and lint tools over MCP stdio, with no authentication required and no evident malicious behavior, exfiltration, shell execution, or hardcoded secrets in the provided code. Its file-read permissions match its purpose of scanning Dockerfiles, and the MCP tools are annotated read-only. Minor observations include the lack of path restriction on scan_path and the unauthenticated nature of the local stdio server, which are reasonable for a local developer tool. Supply chain analysis found 8 known vulnerabilities in dependencies (0 critical, 3 high severity).

9 files analyzed · 11 issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

File System Read

Reads files on your machine. Normal for tools that analyze or process local data.

system_info

Check that this permission is expected for this type of plugin.

How to Install

Install command not verified. See the repository for install instructions.

View repository

Documentation

View on GitHub

From the project's GitHub README.

LayerLint

Release License: MIT Go Report Card CI

Dockerfile linter that finds layer-cache anti-patterns before they slow your CI builds.

alt text

Quickstart

go install github.com/vviveksharma/layerLint/cmd/layerlint@latest
layerlint scan .

Sample output:

HIGH Dockerfile:4
Dependency install runs after broad source copy

This dependency step runs after a broad COPY/ADD, so source changes can invalidate the dependency cache.

Suggestion:
Copy dependency manifests first, install dependencies, then copy the rest of the source.

Other install options:

# Checksum-verified install script (Linux/macOS)
curl -sSL https://raw.githubusercontent.com/vviveksharma/layerLint/main/install.sh | sh

# From a release archive (asset name: layerlint_<version>_<Os>_<Arch>.tar.gz|zip)
# Both layerlint_* and legacy layerLint_* names work; the installer resolves the
# exact name from the release's checksums.txt.
# Example: layerLint_2.0.0_Linux_x86_64.tar.gz or layerlint_2.1.0_Linux_x86_64.tar.gz

Website: https://layerlint.in

What it checks

  • Copying everything before npm install / go mod download (cache bust)
  • Using FROM node:latest (non-reproducible)
  • Running as root
  • Missing .dockerignore
  • And more — see docs/rules.md or layerlint rules list

Usage

layerlint scan .                          # recursive discovery
layerlint scan Dockerfile app.dockerfile  # multiple files
layerlint scan --dockerfile Dockerfile    # backwards-compatible flag

layerlint scan . --format json --output report.json
layerlint scan . --format sarif --output results.sarif
layerlint scan . --format html --output report.html
layerlint scan . --fail-on-severity high

layerlint rules list
layerlint rules explain broad-copy-before-deps
layerlint version

Exit codes

CodeMeaning
0No findings at or above --fail-on-severity
1Findings at or above the threshold
2Usage, parse, or runtime error

JSON schema: docs/schema/report.schema.json

MCP

LayerLint ships a read-only Model Context Protocol server over stdio. It exposes scan_path, lint_dockerfile, list_rules, and explain_rule to AI coding agents. See mcp_tools.md for every command with real server responses.

Claude Desktop / Cursor:

{"mcpServers":{"layerlint":{"command":"layerlint","args":["mcp"]}}}

Claude Code:

claude mcp add layerlint -- layerlint mcp

Codex (~/.codex/config.toml):

[mcp_servers.layerlint]
command = "layerlint"
args = ["mcp"]

LayerLint vs Hadolint vs Dive

ToolWhat it doesWhen to use it
LayerLintStatic Dockerfile lint focused on layer-cache anti-patterns (and related reproducibility/security checks). Offline CLI + CI/Action.You want fast CI gates for cache-busting Dockerfile patterns.
HadolintGeneral Dockerfile linter (best-practice rules) that also uses ShellCheck for shell inside RUN.Broad Dockerfile style/best-practice linting, including shell in RUN. Source: hadolint/hadolint.
DiveExplores a built image’s layers, file changes, and estimated wasted space.After build, inspect image contents/efficiency. Source: wagoodman/dive.

Overlap: LayerLint and Hadolint both lint Dockerfiles statically; they emphasize different rule sets. Dive analyzes images, not Dockerfiles. Many teams use a Dockerfile linter in CI and Dive when investigating image size.

CI / GitHub Action

- uses: vviveksharma/layerLint@main
  with:
    dockerfile: ./Dockerfile
    fail-on-severity: high

More examples: docs/ci-cd-integration.md and .github/workflows/examples/.

Pre-commit

# .pre-commit-config.yaml
repos:
  - repo: https://github.com/vviveksharma/layerLint
    rev: v1.0.1   # pin a release tag
    hooks:
      - id: layerlint

Platform-specific install notes

tar -xzf layer[Ll]int_*.tar.gz
chmod +x layerlint
sudo mv layerlint /usr/local/bin/

Extract layerlint.exe and add its folder to PATH.

Testing

go test ./...
go build -o layerlint ./cmd/layerlint
./layerlint scan --dockerfile testFiles/broad-copy-before-deps-failure

Fixtures in testFiles/ are intentionally bad Dockerfiles (passed via --dockerfile).

Run LayerLint MCP using Docker

LayerLint can also run as a containerized MCP server.

Pull the image:

docker pull ghcr.io/vviveksharma/layerlint:3.0.1

Start the MCP server:

docker run -i --rm \
  -v "$PWD":/work:ro \
  -w /work \
  ghcr.io/vviveksharma/layerlint:3.0.1 \
  mcp

The project directory is mounted read-only at /work.

Configure your MCP client:

{
  "mcpServers": {
    "layerlint": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-v",
        "/absolute/path/to/project:/work:ro",
        "-w",
        "/work",
        "ghcr.io/vviveksharma/layerlint:3.0.1",
        "mcp"
      ]
    }
  }
}

Available MCP tools:

  • scan_path
  • lint_dockerfile
  • list_rules
  • explain_rule

See MCP Tool Documentation for tool schemas and examples.

Contributing

See CONTRIBUTING.md and AGENTS.md.

  1. Add a rule file under internal/rules/
  2. Implement ID() + Check()
  3. Add metadata in internal/rules/meta.go
  4. Register in internal/scanner/scanner.go
  5. Add tests + a testFiles/*-failure fixture

Links

MIT License — Copyright (c) 2026 Vivek Sharma

Reviews

No reviews yet

Be the first to review this server!