
MCP stdio ShellGuard
Drop-in defense against shell injection attacks in MCP stdio servers. Wraps child_process.exec and spawn with an allowlist registry, sandbox profiles (strict/standard/permissive with cgroup-v2 support), and replay detection. Ships three pieces: guardExec/guardSpawn functions you call from your own server, an AST audit CLI (mcp-shellguard-audit) that scans TypeScript/JavaScript for 12 anti-patterns from template literal injection to missing timeouts, and a reference server with 8 tools. Built after the Ox-Security disclosure of 200k vulnerable MCP servers. Reach for this if you're building MCP tools that shell out to git, docker, or system commands and want defense in depth before user input hits exec.
- tools
- 8
- transport
- STDIO
- last updated
- Nov 1, 2026
Tools
8 toolsPublic tool metadata for what this MCP can expose to an agent.
guard_execDefended `child_process.exec`. Forces args[] vector, allowlist + sandbox + replay.
Defended `child_process.exec`. Forces args[] vector, allowlist + sandbox + replay.
No parameter schema in public metadata yet.
guard_spawnDefended `child_process.spawn`. Returns SHA-256 hashes of stdout/stderr instead of full bodies. Hard-rejects `shell:true`.
Defended `child_process.spawn`. Returns SHA-256 hashes of stdout/stderr instead of full bodies. Hard-rejects `shell:true`.
No parameter schema in public metadata yet.
register_allowlistRegister a tool name with executable + args regex. Without registration the default-deny applies.
Register a tool name with executable + args regex. Without registration the default-deny applies.
No parameter schema in public metadata yet.
audit_sourceScan a TS/JS path for shell-injection anti-patterns. Returns `AuditFinding[]` + summary.
Scan a TS/JS path for shell-injection anti-patterns. Returns `AuditFinding[]` + summary.
No parameter schema in public metadata yet.
audit_reportFormat an audit result as markdown / json / SARIF 2.1.0.
Format an audit result as markdown / json / SARIF 2.1.0.
No parameter schema in public metadata yet.
replay_checkCompute canonical SHA-256 hash for an invocation and report whether it's already in the replay window.
Compute canonical SHA-256 hash for an invocation and report whether it's already in the replay window.
No parameter schema in public metadata yet.
sandbox_statusReport active sandbox profile + concrete limits + cgroup-v2 active flag.
Report active sandbox profile + concrete limits + cgroup-v2 active flag.
No parameter schema in public metadata yet.
trust_tierDerive LOW/MEDIUM/HIGH/CRITICAL tier for a registered tool plus improvement hints.
Derive LOW/MEDIUM/HIGH/CRITICAL tier for a registered tool plus improvement hints.
No parameter schema in public metadata yet.
Sponsors
Readme
Details
- Repository
- github.com/studiomeyer-io/mcp-stdio-shellguard
- Category
- Developer Tools
- Package
mcp-stdio-shellguard- Transport
- STDIO
- Registry
- MCP registry, active