Free MCP Config Security Scanner (mcp.json) — 18 Automated Local Checks
Audit mcp.json, .cursor/mcp.json, .vscode/mcp.json, and claude_desktop_config.json before hardcoded API keys, unpinned npx supply-chain RCE, or prompt-injection payloads reach developer laptops. Runs 100% client-side in your browser with 0 bytes uploaded.
Interactive mcp.json Security Scanner (18 Rules)
100% in-browser · 0 bytes sent · < 10 msPaste any Model Context Protocol JSON/JSONC configuration below or load the vulnerable sample to inspect line-accurate findings, CWE/SOC 2/ISO/DORA mappings, and IDE Quick Fixes. Zero network requests leave your browser.
.vsix locally—or unlock Pro once (no subscription) for full workspace audits, stackguard-cli, SARIF 2.1.0, and SHA-256 sealed SOC 2 / ISO 27001 / DORA reports.
All 18 Real MCP Security Rules (MCP001–MCP018)
Every rule below is evaluated by the exact same TypeScript JSONC AST engine inside this browser scanner, the VS Code / Cursor / Windsurf .vsix extension, and stackguard-cli.
| Rule ID | Severity | Risk & Compliance Mapping | Quick Fix & Remediation |
|---|---|---|---|
MCP001Free |
CRITICAL |
Hardcoded secret or API key in MCP config
A secret, API key, or bearer token is hardcoded in mcp.json env or headers instead of referencing a secret input or environment variable.
|
1-Click IDE Quick Fix
Replace the literal value with a VS Code/Cursor secret input (${input:SECRET_NAME}) or environment variable reference (${ENV_VAR}).
|
MCP002Free |
HIGH |
Unpinned npx package in MCP server
An MCP server launched via npx does not pin an exact package version (or uses @latest), exposing developer machines to silent supply-chain RCE.
|
1-Click IDE Quick Fix
Pin an exact verified semver version (e.g. @modelcontextprotocol/server-filesystem@0.6.2).
|
MCP003Free |
CRITICAL |
Dangerous remote shell pipe in MCP command
MCP command executes remote code via curl/wget piped to sh/bash/zsh, enabling arbitrary code execution without integrity verification.
|
Guided Remediation
Install the MCP server from a version-pinned package or verified local binary instead of piping remote scripts to a shell.
|
MCP004Free |
CRITICAL |
Inline eval or dynamic shell execution in MCP args
MCP server uses eval, sh -c, bash -c, node -e, or python -c, increasing command-injection surface and bypassing static binary allowlists.
|
Guided Remediation
Invoke the MCP server executable directly with explicit argument arrays instead of shell wrappers or inline eval.
|
MCP005Free |
HIGH |
Overly permissive bypass flag in MCP server args
MCP server passes dangerous flags such as --allow-all, --dangerously-skip-permissions, --yolo, --no-sandbox, or --trust-all.
|
Guided Remediation
Remove bypass flags and configure least-privilege tool and filesystem scopes explicitly.
|
MCP006Free |
HIGH |
MCP server bound to 0.0.0.0 (all interfaces)
Binding a local MCP server to 0.0.0.0 exposes unauthenticated tool execution across the LAN or corporate Wi-Fi.
|
1-Click IDE Quick Fix
Bind local MCP servers strictly to 127.0.0.1.
|
MCP007Free |
CRITICAL |
Sensitive host directory exposed to MCP server
MCP server arguments grant access to sensitive credential paths (~/.ssh, ~/.aws, ~/.gnupg, ~/.kube, /etc/shadow, ~/.config/gcloud).
|
Guided Remediation
Restrict MCP filesystem roots strictly to the active project directory.
|
MCP008Pro |
CRITICAL |
Root (/) or full home directory (~) exposed to MCP server
Exposing the entire root filesystem (/) or user home directory (~/$HOME) lets any prompt injection read all local credentials and source code.
|
Guided Remediation
Scope filesystem arguments to a single workspace subdirectory (e.g. ${workspaceFolder}).
|
MCP009Pro |
MEDIUM |
Unpinned uvx/pipx/bunx/docker package in MCP server
MCP server launched via uvx, pipx, bunx, pnpx, or docker run does not pin an exact version tag or digest.
|
Guided Remediation
Pin an exact package version (pkg==1.2.3 / pkg@1.2.3) or immutable container digest (@sha256:...).
|
MCP010Pro |
HIGH |
Cleartext HTTP remote MCP endpoint
Remote MCP SSE/HTTP server uses cleartext http:// over a non-localhost network, exposing prompts, context, and headers to interception.
|
1-Click IDE Quick Fix
Use https:// with valid TLS certificates for all non-localhost MCP endpoints.
|
MCP011Pro |
MEDIUM |
Auto-install npx -y / --yes on unscoped package
Using npx -y or --yes silently downloads and executes packages on editor startup, amplifying typosquatting risk on unscoped packages.
|
Guided Remediation
Prefer verified scoped packages with pinned exact versions or pre-installed local binaries.
|
MCP012Pro |
CRITICAL |
Embedded credentials in MCP URL or database URI
A connection URI in MCP args or URL embeds a literal username and password.
|
Guided Remediation
Inject database or HTTP credentials via environment variables rather than literal connection strings.
|
MCP013Pro |
MEDIUM |
TLS certificate verification disabled in MCP env
Setting NODE_TLS_REJECT_UNAUTHORIZED=0 or PYTHONHTTPSVERIFY=0 disables TLS certificate validation and enables MitM attacks.
|
1-Click IDE Quick Fix
Remove the override or set it to 1 and configure trusted corporate CA certificates via NODE_EXTRA_CA_CERTS.
|
MCP014Pro |
MEDIUM |
Destructive write/drop privilege enabled on MCP server
Database or infra MCP server enables write/delete/drop flags (--allow-write, --read-write, READ_ONLY=false), widening AI blast radius.
|
Guided Remediation
Run database and production MCP servers in read-only mode by default and gate writes behind explicit approvals.
|
MCP015Pro |
MEDIUM |
Excessive MCP server blast radius or wildcard tool allowlist
Wildcard auto-approval (alwaysAllow: ['*'] / allowedTools: ['*']) or >10 servers in one config dramatically expands prompt-injection impact.
|
Guided Remediation
Enumerate exact safe read-only tools in auto-allow lists and disable unused MCP servers.
|
MCP016Pro |
CRITICAL |
Prompt-injection or tool-poisoning pattern in MCP config
Suspicious instruction override or covert exfiltration wording detected in MCP metadata/description/env (<IMPORTANT>, ignore previous instructions, exfiltrate).
|
Guided Remediation
Audit the MCP server definition immediately and remove untrusted instruction text.
|
MCP017Pro |
MEDIUM |
Elevated privilege wrapper (sudo/doas/pkexec) in MCP command
Launching an MCP server through sudo, doas, pkexec, or runas grants root privileges to an AI-driven tool.
|
Guided Remediation
Run the MCP server as an unprivileged user without sudo.
|
MCP018Pro |
LOW |
Process injection environment variable in MCP config
MCP env defines LD_PRELOAD, DYLD_INSERT_LIBRARIES, or NODE_OPTIONS=--require, which can hijack child process execution.
|
Guided Remediation
Remove dynamic library/preload overrides from MCP server environment definitions.
|
Frequently Asked Questions
Does this MCP config scanner upload my mcp.json or API keys?
No. StackGuard bundles its 18-rule MCP JSONC AST parser into scanner-bundle.js and runs entirely inside your browser. Zero bytes of your mcp.json, environment variables, or headers are ever transmitted over the network.
Which Model Context Protocol config files are supported?
StackGuard audits mcp.json, .cursor/mcp.json, .vscode/mcp.json, and claude_desktop_config.json (both mcpServers and servers schemas, including JSONC comments).
What MCP risks do rules MCP001–MCP018 catch?
They catch hardcoded API keys (MCP001), unpinned npx/uvx/docker packages (MCP002, MCP009), curl|sh pipes and inline eval (MCP003, MCP004), dangerous permission bypass flags like --allow-all (MCP005), 0.0.0.0 LAN bindings (MCP006), sensitive host mounts like ~/.ssh or / (MCP007, MCP008), cleartext HTTP endpoints (MCP010), embedded DB/HTTP credentials (MCP012), TLS overrides (MCP013), wildcard tool allowlists (MCP015), prompt-injection / tool-poisoning strings (MCP016), sudo wrappers (MCP017), and LD_PRELOAD process injection (MCP018).
How do I enforce these 18 MCP rules in VS Code, Cursor, or CI?
Install the free stackguard-0.2.0.vsix extension for real-time IDE diagnostics and 1-click Quick Fixes, or unlock StackGuard Pro ($29 Solo / $49 Team one-time via Polar.sh) to run all 72 rules in IDE and CI with SARIF 2.1.0 and SHA-256 sealed SOC 2 / ISO 27001 / DORA reports.