envguard-mcp
Compares Docker --env-file parsing against Node dotenv and POSIX sh, audits drift in docker-compose.yml, and can generate an escaped fail-fast Compose snippet.
Compares Node dotenv v16 [.env](/mcp/integrations/dotenv) parsing behavior against Docker and POSIX sh, detecting inline-comment, quoting, bcrypt, export, and CRLF divergences with redacted fingerprints.
envguard-mcp — 3-Runtime .env Parser, Client-Bundle Secret Leak & 4-Way Drift MCP Server + GitHub Action
Zero-dependency, 100% offline Model Context Protocol (MCP) Server, CLI, and GitHub Action enabling AI coding agents (Claude Desktop, Claude Code, Cursor, Windsurf, Antigravity) and pull-request CI pipelines to catch:
3-Runtime
.envParser Divergences across Nodedotenvv16,docker run --env-file, and POSIXsh/docker compose(inline#password truncation, literal"..."quotes in Docker,$2b$12$bcrypt corruption,exportrejections, and WindowsCRLF\rtrailing bytes).Frontend Bundle Secret Leaks where private keys, database URIs, live API secrets, or Supabase
service_roleJWTs are accidentally exposed underNEXT_PUBLIC_,VITE_,NUXT_PUBLIC_,REACT_APP_,EXPO_PUBLIC_, orPUBLIC_.4-Way Configuration Drift across
.env,.env.example,docker-compose.yml, and polyglot source code (process.env,import.meta.env,Deno.env,Bun.env,os.environ,os.Getenv,std::env::var).
Zero-Secret-Leak Guarantee: Every MCP tool and CI report strictly redacts raw values into
<redacted len:N bytes:B fnv1a:HHHHHHHH>fingerprints so production secrets never enter LLM context windows or CI logs.
MCP Tools Exposed (stdio)
Tool | Purpose | Safety Annotations |
| Compares exact parsed byte lengths and FNV-1a hashes across Node |
|
| Audits |
|
| Computes 4-way cross-drift across |
|
| Produces a zero-secret |
|
Related MCP server: mendapi
Quick Start (MCP Client & Local CLI)
# Start MCP server over stdio (supports both NDJSON and Content-Length framing)
npx -y github:z121245017-ai/envguard-mcp
# List MCP tool schemas
npx -y github:z121245017-ai/envguard-mcp --list
# Compare 3-runtime .env parser behavior from terminal (raw secrets redacted)
npx -y github:z121245017-ai/envguard-mcp --cli compare_env_runtime_parsers '{"envText":"DB_PASS=p@ss#word123\nREDIS_PASS=\"secret\""}'Claude Desktop / Cursor / Windsurf / Antigravity Config
{
"mcpServers": {
"envguard": {
"command": "npx",
"args": ["-y", "github:z121245017-ai/envguard-mcp"]
}
}
}Docker (node:22-alpine, non-root USER node)
docker build -t envguard-mcp .
docker run -i --rm envguard-mcpGitHub Action (z121245017-ai/envguard-mcp@v1)
Add envguard-mcp@v1 to .github/workflows/ to block pull requests that introduce NEXT_PUBLIC_ / VITE_ secret leaks or forget to document new process.env / import.meta.env keys in .env.example:
name: EnvGuard Secret Leak & Drift Check
on:
pull_request:
permissions:
contents: read
jobs:
envguard:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Audit client-bundle secret leaks and .env.example drift
uses: z121245017-ai/envguard-mcp@v1
with:
env-example: '.env.example'
code-paths: 'src,app'
fail-on-client-leaks: 'true'
fail-on-example-drift: 'true'Action Inputs & Outputs
Name | Kind | Default | Description |
| Input |
| Workspace directory to scan. |
| Input |
| Optional |
| Input |
| Path to |
| Input |
| Optional path to |
| Input |
| Comma-separated source directories or files scanned for environment variable references. |
| Input |
| Exit |
| Input |
| Exit |
| Input |
| Exit |
| Output | — |
|
| Output | — | Deterministic safety score ( |
| Output | — | Count of client-bundle secret exposure findings. |
| Output | — | Count of undocumented variables missing from |
| Output | — | Count of 3-runtime |
| Output | — | Redacted JSON summary (raw secret values are never included). |
Verification
npm testLicense
MIT License — 0 external npm dependencies, 0 network calls, 100% local execution.
Available Tools
4 toolsaudit_env_compose_code_driftBRead-onlyIdempotent
Computes deterministic 4-way configuration cross-drift across .env, .env.example, docker-compose.yml, and polyglot source code references (process.env, import.meta.env, os.environ), returning redacted findings and a 0-100 deployment safety score.
Inputs: envText, codeText, codePaths, targetEnv, +6 more.
compare_env_runtime_parsersARead-onlyIdempotent
Compares exact parsed byte lengths and FNV-1a hashes across Node dotenv v16, docker run --env-file, and POSIX sh / docker compose, catching inline # truncation, literal quotes, $ bcrypt corruption, and CRLF \r bugs while strictly redacting raw secret values.
Inputs: envText, envFilePath.
detect_client_bundle_secret_leaksARead-onlyIdempotent
Audits .env files and frontend source configs for private keys, Supabase service_role JWTs, API secrets, or database URIs accidentally prefixed with NEXT_PUBLIC_, VITE_, NUXT_PUBLIC_, REACT_APP_, EXPO_PUBLIC_, or PUBLIC_, redacting all secret values.
Inputs: envText, codeText, codePaths, envFilePath.
generate_sanitized_env_exampleARead-onlyIdempotent
Generates a zero-secret .env.example template (automatically renaming leaked NEXT_PUBLIC_/VITE_ server secrets) and an escaped fail-fast docker-compose.yml snippet from local config structure without leaking any secret values.
Inputs: envText, codeText, composeText, envFilePath, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct env-security workflow: parser comparison, leak detection, config drift auditing, and sanitized template generation. The first and third tools both analyze env/compose configuration, so an agent may need to read descriptions carefully to choose between them, but their outputs and purposes differ.
All four names use snake_case and are verb-led or action-oriented, with clear domain-specific nouns. The pattern is consistent, though names are unusually long and the first tool is slightly more noun-heavy than the others.
Four tools is a tight, well-scoped set for an env-security auditing server. Each tool maps to a distinct step in the workflow, with no filler or redundant tools.
The surface covers comparison, leak detection, drift auditing, and safe example generation, which form a coherent lifecycle. It lacks a direct remediation or fix-application tool, but generation of sanitized examples partially fills that gap.
Maintenance
Related MCP Connectors
Deterministic OpenAPI 3.x SemVer diff, SPF 10-lookup flattener & WCAG 2.2 / EN 301 549 MCP server.
Diff and poisoning detection for MCP servers: catch schema drift and prompt poisoning.
LLM cost optimization gateway, repo token-waste auditor & model arbitrage MCP server.
Monitor MCP servers, API contracts and AI outputs for schema drift. Alerts on breaking changes.
Related MCP Servers
- AlicenseAqualityDmaintenanceA deterministic MCP server that guards AI/agent output by detecting secrets, injection, and PII in ~85µs with zero dependencies. Gives a clear ship/block verdict and runs locally or hosted.2Apache 2.0
- AlicenseNot gradedqualityCmaintenanceMCP server that watches upstream API providers for breaking changes, scans your codebase for impact, and drafts migration fixes locally, all offline-first with zero network.97 npm1AGPL 3.0
- AlicenseNot gradedqualityCmaintenanceA tiny local MCP server and CLI that lets AI agents read only allowlisted environment variables, redacts known secrets from text, and logs every access.MIT
- AlicenseAqualityBmaintenance100% local-first, zero-dependency 5-pillar Git repository auditor & Client Codebase Audit / Project Handover PDF report generator MCP server. Scans secrets, lockfiles, CI/tests, Git bus-factor & handover docs locally.4MIT