EnvShield MCP server
Commit Nov 7, 2026Audits environment security, detects secret leaks, and validates parity between .env and .env.example files.
Also known as fastpresspages/envshield
- Stars
- 0
- Tools
- 4
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- Nov 7, 2026
- License
- Apache-2.0
What is EnvShield MCP?
EnvShield audits environment security, detects secret leaks, and validates parity between .env and .env.example files. It exposes 4 tools, such as audit_env, scan_secrets, validate_env.
Summary generated from the project's README
About EnvShield MCP server
Securing sensitive credentials and maintaining environment variable consistency is what developers achieve using EnvShield. This tool functions as a security auditor and schema validator that prevents accidental leaks of API keys, such as those for AWS, OpenAI, or Stripe, by using Shannon entropy analysis and regex patterns. It is designed for use within CI pipelines, GitHub Actions, or directly through AI coding agents like Claude Code and Cursor via a stdio JSON-RPC MCP server.
Users can run the server locally using npx to perform full audits, scan specific files for high-entropy tokens, or validate parity between .env and .env.example files. The server ensures that required keys are present and match specific type constraints like url, email, or boolean. It also includes a utility to generate sanitized templates from live environment files, replacing sensitive values with safe placeholders. Because it has zero runtime dependencies and requires no external network access, it provides a fast way to verify repository hygiene before deployment.
What you can do with it
- 1Detect leaked credentialsScan your configuration files for high-entropy tokens and specific API keys like GitHub PATs or Slack credentials.
- 2Verify environment parityCheck that your .env.example file contains all the necessary keys and correct types required by your active .env file.
- 3Automate template generationCreate a sanitized version of your environment file to use as a template for other developers.
- 4Audit repository security hygienePerform a comprehensive check of your directory to ensure .gitignore is protecting your sensitive files.
Written from the project's README. Every use case is checked against a quote from it.
EnvShield MCP tools 4
Detected from the READMEaudit_envscan_secretsvalidate_envgenerate_example
| audit_env | — | |
| scan_secrets | — | |
| validate_env | — | |
| generate_example | — |
Automated checks
Ran Nov 15, 2026Full report →Not verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachablefastpresspages/envshield is public and reachablegithub.com/fastpresspages/envshield ↗Pass
- Package names this repository as its sourceNot checked
- Build provenance (Sigstore attestation)Not checked
- Open source license (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-11-07github.com/fastpresspages/envshield ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNot checked
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model4 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNo tool named like delete, drop or execPass
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubEnvShield 🛡️
Zero-dependency environment security auditor, secret leak detector, and schema validator for CI and AI agents.
Audits repository .gitignore protection, detects live credentials in .env.example templates, checks type and parity between .env and .env.example, and automatically generates safe .env.example files.
Built by FastPress Labs. 100% free, Apache-2.0, zero runtime dependencies.
Why EnvShield?
- Accidental Credential Commits: Committing
.envfiles or leaving real API keys inside.env.exampleis one of the most common security breaches. - Environment Variable Parity Drifts: Staging or local dev breaks because someone added
STRIPE_WEBHOOK_SECRETto their code but forgot to document it in.env.example. - Agent & CI Protection: AI coding agents and CI runners need a fast, zero-install, zero-network utility to verify repository hygiene before publishing or deploying.
Quickstart
Run directly without installing:
# Full environment security audit
npx -p github:fastpresspages/envshield envshield audit
# Scan any file for leaked API keys & high-entropy tokens
npx -p github:fastpresspages/envshield envshield scan .env.example
# Validate parity between .env and .env.example
npx -p github:fastpresspages/envshield envshield check .env --example .env.example
# Generate a sanitized .env.example from your live .env
npx -p github:fastpresspages/envshield envshield generate .env -o .env.example
Features
- Zero Runtime Dependencies: Pure Node.js (>=18.17). No external packages, no telemetry, no tracking.
- Leak Detection: Shannon entropy analysis combined with precision regex patterns for AWS, GitHub PATs, OpenAI, Anthropic, Stripe, Slack, Database credentials, Google API keys, JWTs, and private keys.
- Parity & Schema Validation: Checks missing keys, extra keys, and type constraints (
port,number,boolean,url,email,enum). - Template Sanitizer: Automatically generates production-ready
.env.examplefiles with masked placeholders while preserving non-sensitive defaults. - Multi-Interface: CLI, programmatic JavaScript API, Model Context Protocol (MCP) server, and GitHub Action.
CLI Reference
Usage: envshield [command] [options]
Commands:
audit [dir] Run full environment security audit (default)
scan <file_or_dir> Scan file for secret leaks and high-entropy credentials
check <env> --example <ex> Validate parity and types between .env and .env.example
generate [env_file] Generate sanitized .env.example from concrete .env
Options:
--fail-under <score> Fail (exit code 2) if audit score is below threshold (0-100)
--format <fmt> Output format: terminal, json, or markdown (default: terminal)
-o, --out <file_or_dir> Write output to specified file or directory
-v, --version Print version (0.1.0)
-h, --help Show help message
Model Context Protocol (MCP) Server
EnvShield includes a standard stdio JSON-RPC MCP server (envshield-mcp) so Claude Code, Cursor, Windsurf, OpenCode, and any MCP client can audit environments natively:
Add to your MCP settings (claude_desktop_config.json, opencode.json, etc.):
{
"mcpServers": {
"envshield": {
"command": "npx",
"args": ["-p", "github:fastpresspages/envshield", "envshield-mcp"]
}
}
}
Exposed MCP Tools:
audit_env: Audits directory.gitignoreand.envsecurity hygiene.scan_secrets: Scans code or text for credential leaks.validate_env: Compares.envagainst.env.example.generate_example: Creates sanitized.env.exampletemplates.
GitHub Action
Fail CI builds whenever secrets leak or environment files are left unprotected:
- name: Audit Environment Security
uses: fastpresspages/envshield@v0.1.0
with:
path: .
fail-under: 80
example: .env.example
Outputs:
score: Numeric score (0-100)grade: Letter grade (A+ to F)status:passorfail
Programmatic API
import {
auditRepository,
scanText,
parseEnv,
validateParity,
generateExample,
} from 'envshield';
// 1. Audit repository
const report = auditRepository('./my-project');
console.log(`Grade: ${report.grade} (${report.score}/100)`);
// 2. Scan text for leaks
const leaks = scanText('AWS_KEY=AKIAIOSFODNN7EXAMPLE');
console.log(`Found ${leaks.length} leaks`);
// 3. Generate sanitized .env.example
const example = generateExample(rawEnvContent);
More from FastPress Labs
- LaunchGrade — 54-check launch page auditor CLI, Action & MCP.
- RepoGrade — 33-check repository health auditor CLI, Action & MCP.
- ContextPack — Token-budgeted codebase context packer for LLMs.
- FastPress Skills — Installable agent skills for shipping, scanning, and inbox triage.
- FastPress Start — Zero-build launch page template rated A+ 100/100.
License
Apache-2.0. Copyright (c) 2026 FastPress Labs.
EnvShield MCP questions
What tools does EnvShield MCP provide?
It exposes 4 tools, including audit_env, scan_secrets, validate_env, generate_example.
What can EnvShield audit?
It audits repository .gitignore protection, detects live credentials in .env.example templates, and checks type and parity between .env and .env.example.
Does EnvShield have any dependencies?
No, it is a zero-dependency tool built with pure Node.js.
What kind of secrets can it detect?
It uses Shannon entropy and regex to find AWS, GitHub PATs, OpenAI, Anthropic, Stripe, Slack, database credentials, Google API keys, JWTs, and private keys.
How can I use it with an AI agent?
You can add it as an MCP server to clients like Claude Code, Cursor, or Windsurf using the provided stdio JSON-RPC configuration.