GWShield Image Builder
OfficialClick on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@GWShield Image Builder generate a hardened Dockerfile for my Go app"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Gatewarden Shield Image Builder MCP
AI-Assisted Hardened Container Image Generation
Generate production-grade Dockerfiles following the 15 GWShield hardening pillars. Works with Claude, Gemini, OpenCode, and any MCP-compatible AI agent.
What this tool does
This is a Model Context Protocol (MCP) server that encodes the full GWShield hardening methodology into an AI-accessible tool. It enables any AI coding agent to generate Dockerfiles, smoke tests, version pins, and supporting files that conform to the same standards used by the production GWShield image pipeline.
The server does not build images. It generates files.
Related MCP server: EVIDIQ Bastion
The 15 Hardening Pillars
Every generated Dockerfile enforces these pillars:
# | Pillar | Summary |
1 | FROM scratch/distroless | Runtime FROM scratch; distroless only with documented justification |
2 | Static binary | CGO_ENABLED=0 (Go) or musl-static (C/Rust); no unjustified dynamic deps |
3 | Non-root UID 65532 | USER 65532:65532 in final stage; no root start with privilege drop |
4 | No shell in runtime | No /bin/sh, no package manager, no curl/wget/nc |
5 | Multi-stage + digest-pinned | deps -> banner -> builder -> runtime; all FROM images sha256-pinned |
6 | Pinned gwshield builder | Use ghcr.io/gwshield/*-builder images as build base |
7 | Cosign keyless signing | Sigstore OIDC; no long-lived key material |
8 | SBOM attach | CycloneDX + SPDX bound to image digest |
9 | Trivy hard CRITICAL gate | 0 unfixed HIGH/CRITICAL at release; allowlist with evidence only |
10 | OCI label schema | org.opencontainers.image._ + io.gwshield._ labels |
11 | gwshield-init banner | Static C wrapper as ENTRYPOINT; exec() to real binary |
12 | Hardened compiler flags | -fstack-protector-strong, FORTIFY_SOURCE=2, RELRO, PIE |
13 | Source tarball + SHA-256 | Build from upstream source; verify tarball hash |
14 | Per-image smoke test | tests/smoke.sh for startup, non-root, no-shell, version check |
15 | CVE allowlist + risk statement | scan/allowlist.yaml + docs/risk-statement.md with evidence |
Installation
No global install required. The server runs on demand via npx.
Run once to confirm the server starts:
npx -y gwshield-image-builder-mcpThen add it to your agent config:
Claude Desktop / Claude Code
File: ~/.claude/claude_desktop_config.json
{
"mcpServers": {
"gwshield-image-builder": {
"command": "npx",
"args": ["-y", "gwshield-image-builder-mcp"]
}
}
}Restart Claude Desktop after saving.
OpenCode
File: ~/.config/opencode/config.json or opencode.json (project)
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"gwshield-image-builder": {
"type": "local",
"command": ["npx", "-y", "gwshield-image-builder-mcp"],
"enabled": true
}
}
}OpenCode uses "mcp" (not "mcpServers") with type: "local" and a command array.
Cursor
File: .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
{
"mcpServers": {
"gwshield-image-builder": {
"command": "npx",
"args": ["-y", "gwshield-image-builder-mcp"]
}
}
}Continue (VS Code / JetBrains)
File: .continue/mcpServers/gwshield.yaml (workspace)
name: GWShield Image Builder
version: 0.0.1
schema: v1
mcpServers:
- name: gwshield-image-builder
command: npx
args:
- "-y"
- "gwshield-image-builder-mcp"Gemini CLI
File: ~/.gemini/settings.json
{
"mcpServers": {
"gwshield-image-builder": {
"command": "npx",
"args": ["-y", "gwshield-image-builder-mcp"]
}
}
}From source
git clone git@github.com:gwshield/images-mcp.git
cd images-mcp
npm install
npm run buildThen point your MCP client to:
{
"mcpServers": {
"gwshield-image-builder": {
"command": "node",
"args": ["path/to/images-mcp/dist/index.js"]
}
}
}All agents use the npx stdio transport — no daemon, no port, no persistent process.
MCP Tools
Tool | Description |
| List all 15 hardening pillars with descriptions |
| Pick the right distroless or scratch base for a language |
| Generate a fully hardened multi-stage Dockerfile |
| Generate a pinned VERSIONS.env for reproducible builds |
| Generate a per-image smoke test script |
| Validate a Dockerfile against all 15 pillars |
| Generate a minimal, family-aware .dockerignore |
MCP Prompts
Prompt | Description |
| Full analysis + hardened Dockerfile generation for any image |
| Audit an existing Dockerfile against GWShield pillars |
| Build → scan → fix iteration loop with Trivy (max 5 iterations) |
MCP Resources
Resource | Description |
| All 15 pillars with rationale and implementation notes |
| Supported image families: Go, C, Rust |
| GWShield contributing guidelines for new images |
Example prompts
Ask your agent any of these after connecting the server:
"Harden my Go HTTP service"
Uses harden_image → suggest_runtime_base → generate_dockerfile (distroless runtime,
CGO_ENABLED=0, UID 65532, pinned builder digest) → validate_dockerfile confirms all 15 pillars.
"Review my existing Dockerfile"
Uses review_dockerfile → validate_dockerfile. Returns a structured report: which pillars
pass, which fail, and concrete fixes for each gap.
"Generate a smoke test for my nginx image"
Calls generate_smoke_test with the image family and binary path. Returns a script that checks
binary execution, non-root user, no shell, and clean exit code.
"Build, scan, and fix until clean"
Uses build_test_iterate. The agent guides you through docker build → trivy image → fix
→ repeat until Trivy reports zero HIGH or CRITICAL findings (max 5 iterations).
Image Family Classification
The server classifies services into build families to select the correct Dockerfile pattern:
Family | Runtime | Linking | Example services |
| scratch | CGO_ENABLED=0 | Traefik, Caddy, NATS |
| scratch + musl loader | musl static | nginx, Redis, Valkey, HAProxy |
| distroless/cc-debian12 | glibc dynamic | PostgreSQL |
| distroless/static-debian12 | CGO enabled | Pomerium, OTel Collector |
| scratch | musl target | Future Rust services |
Supply Chain Security
Component | Status | Details |
npm provenance (SLSA v1) | Active | Every published version has a SLSA Provenance v1 attestation linked from the npm registry |
SLSA attestation | Active | Verifiable via |
SHA-pinned GitHub Actions | Active | All |
Dependabot | Active | Weekly automated updates for npm dependencies and GitHub Actions |
Lockfile enforcement | Active |
|
Registry pin | Active |
|
Verifying a published version
Consumers can verify the provenance attestation for any published version using cosign:
# Verify SLSA provenance attestation for a specific version
cosign verify-attestation \
--type slsaprovenance1 \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-identity-regexp "^https://github.com/gwshield/images-mcp/.github/workflows/publish.yml@refs/tags/v" \
$(npm pack gwshield-image-builder-mcp --dry-run --json | jq -r '.[0].filename')Alternatively, provenance is visible directly on the npm registry page under the "Provenance" tab for each published version.
Reporting security issues
See SECURITY.md for the vulnerability disclosure policy. Use GitHub private security advisories to report vulnerabilities confidentially.
Build philosophy
This tool encodes the same hardening philosophy used across all Gatewarden Shield images:
From source, from scratch -- no vendor base images
Security first, not convenience first -- no init scripts, no shell
Scan evidence required -- no claims without proof
Transparent false positives -- scanner noise documented, not hidden
Inspiration and Acknowledgments
The design of this MCP server was influenced by
Viktor Farcic's work on AI-assisted
Dockerfile generation. His
generate-dockerfile
prompt in the dot-ai and
dot-ai-stack repositories
demonstrated that encoding Dockerfile best practices as structured AI
prompts produces consistently better output than ad-hoc generation.
Key ideas we adopted or adapted from his approach:
Project-analysis-first workflow -- analyze the codebase before generating, rather than relying solely on user-provided parameters
Explicit .dockerignore generation -- treat .dockerignore as a first-class build artifact, not an afterthought
Verify everything before adding it -- never assume a package, path, or binary exists; always verify from the actual project context
Build-test-iterate loop -- build the image, run it, check logs, run linters and scanners, iterate until clean (available via the
build_test_iterateprompt)
Where Viktor's approach is language-agnostic and general-purpose, this
server is opinionated and security-hardened: it enforces the 15 GWShield
pillars, targets scratch and distroless runtimes exclusively, and
generates the full file set (Dockerfile, versions.env, smoke.sh,
allowlist, risk statement) required by the GWShield image pipeline.
Thank you, Viktor, for making your prompts and methodology open source.
License
Apache-2.0 -- Gatewarden / RelicFrog Foundation
Available Tools
7 toolsgenerate_dockerfileC
Generate a hardened Dockerfile following all 15 GWShield pillars
Inputs: family (required), serviceName (required), serviceVersion (required), profile, +7 more.
generate_dockerignoreC
Generate a minimal, family-aware .dockerignore for the build context
Inputs: family (required), serviceName (required).
generate_smoke_testC
Generate a smoke test script (tests/smoke.sh) for a service
Inputs: serviceName (required), serviceVersion (required), profile, exposePorts.
generate_versions_envB
Generate a pinned versions.env file for a service
Inputs: serviceName (required), serviceVersion (required), alpineTag, alpineDigest.
list_pillarsA
Return the 15 GWShield hardening pillars with descriptions
Inputs: no named parameters.
suggest_runtime_baseC
Recommend scratch vs distroless based on service type and language
Inputs: serviceName (required), language.
validate_dockerfileC
Validate a Dockerfile against the 15 GWShield hardening pillars
Inputs: dockerfile (required), family.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a clearly distinct role: listing reference pillars, recommending a runtime base, generating four different artifacts, and validating a Dockerfile. The generate_* tools target different file types, so an agent can easily select the right one.
All tools follow a consistent snake_case verb_noun convention: list_pillars, suggest_runtime_base, generate_*, and validate_dockerfile. There are no mixed naming styles or vague verbs.
Seven tools are well-scoped for a container hardening/image generation server. Each tool supports a distinct part of the workflow without redundancy.
The surface covers the key lifecycle: reference pillars, base recommendation, Dockerfile generation, validation, and supporting build artifacts such as versions.env, smoke tests, and .dockerignore. Minor gaps remain, such as validating the generated supporting files or offering build execution/remediation guidance.
Maintenance
Related MCP Connectors
Hadolint-grade Dockerfile audit — 19 checks: secrets, privileges, supply chain, hygiene.
Audit Dockerfiles for root users, baked-in secrets, curl-pipe-shell and unpinned base images.
Security scanner for AI-written code: SAST, secrets, dependencies, IaC, containers and DAST.
IaC, CI and dependency security review for coding agents: local scan CLI plus hosted OAuth MCP.
Related MCP Servers
- AlicenseAqualityFmaintenanceMulti-engine container and system vulnerability scanning for AI agents. Wraps Trivy and Grype with cross-engine validation, SBOM generation, and IaC misconfiguration scanning.156 npmMIT

EVIDIQ Bastionofficial
AlicenseNot gradedqualityBmaintenanceAudits infrastructure configurations (Dockerfiles, GitHub Actions, Kubernetes, Terraform/Compose) against 14 deterministic security rules, returning BLOCK/REVIEW/PASS verdicts and signing attestations. Helps agents verify deployment configs before applying them.1MIT- AlicenseNot gradedqualityCmaintenanceEnables users to audit Dockerfiles for container-security anti-patterns, including missing USER, baked-in secrets, curl | sh / wget | bash, unpinned base images, and ADD with remote URLs. It parses Dockerfile structure to return risk levels and actionable fixes.MIT
- AlicenseNot gradedqualityBmaintenanceExposes a Dockerfile auditing engine to AI assistants, letting them scan a Dockerfile for the 32 deterministic layer-aware rules, print a stage/layer map showing what each layer adds or deletes, explain any rule's rationale and fix, and list available rules. Findings include file:line evidence so agents can surface and triage image-safety issues directly in Claude Code, Cursor, or Cline.MIT