# MCP stdio ShellGuard

> MCP stdio ShellGuard is an open-source MCP server for security. Guard child_process calls in MCP stdio servers and audit source for shell injection. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI
- **Repository:** https://github.com/studiomeyer-io/mcp-stdio-shellguard
- **MCP Registry name:** io.studiomeyer/stdio-shellguard
- **Categories:** [security](https://ai-powered.com/categories/security), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-18

## About

This bundle targets the class of remote-code-execution bugs where a stdio MCP server passes unsanitised input to a shell. It has three layers you can adopt separately: `guardExec` and `guardSpawn` wrappers with a default-deny allowlist, sandbox profiles and replay detection; an AST audit CLI named `mcp-shellguard-audit`; and a reference MCP server with 8 tools.

The audit scans TypeScript and JavaScript for 12 anti-patterns, from critical ones such as `exec` with a template literal to low ones like a missing timeout. It resolves renamed `child_process` bindings, so aliases are caught, and it can output SARIF 2.1.0 and gate CI by severity.

Sandbox profiles are strict (5 s), standard (30 s) and permissive (5 min), with output and file-descriptor limits; callers can tighten but not widen them. Trust tiers run from low to critical depending on allowlist, argument patterns, sandbox and replay protection.

## Features

- **Guarded exec and spawn:** Default-deny allowlist, sandbox and replay window.
- **AST audit CLI:** Scans source for 12 shell-injection anti-patterns.
- **SARIF output:** Exports findings for CI gating.
- **Sandbox profiles:** Strict, standard and permissive limits.
- **Trust tiers:** Rates each tool low to critical.
- **Alias resolution:** Catches renamed child_process imports.

## Good for

- Audit an MCP server's source for unsafe shell calls
- Replace raw exec calls with an allowlisted wrapper
- Fail CI on high-severity findings
- Rate how well a registered tool is constrained

## Install

### Claude Code (Terminal)

```sh
claude mcp add stdio-shellguard -- npx -y mcp-stdio-shellguard
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "stdio-shellguard": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-stdio-shellguard"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "stdio-shellguard": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-stdio-shellguard"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "stdio-shellguard": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "mcp-stdio-shellguard"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "stdio-shellguard": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-stdio-shellguard"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "stdio-shellguard": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-stdio-shellguard"
      ]
    }
  }
}
```

## Tools

- `guard_exec`: Defended child_process.exec with allowlist, sandbox and replay checks.
- `guard_spawn`: Defended spawn returning SHA-256 hashes of output.
- `register_allowlist`: Registers a tool name with executable and argument regexes.
- `audit_source`: Scans a path for shell-injection patterns.
- `audit_report`: Formats an audit as markdown, JSON or SARIF.
- `replay_check`: Hashes an invocation and checks the replay window.
- `sandbox_status`: Reports the active sandbox profile and limits.
- `trust_tier`: Derives a tool's trust tier with hints.

## FAQ

### How do I run the audit?

`npx -y -p mcp-stdio-shellguard mcp-shellguard-audit scan ./src`.

### Does the guard allow shell:true?

guard_spawn hard-rejects shell true.

### Which Node versions?

Node 20 or newer.

### Licence?

MIT.

### Is MCP stdio ShellGuard free?

Yes. MCP stdio ShellGuard is open source, so you can use and self-host it for free.

### How do I add MCP stdio ShellGuard to Claude Code?

Run this command in your terminal: claude mcp add stdio-shellguard -- npx -y mcp-stdio-shellguard

### What are the best alternatives to MCP stdio ShellGuard?

The closest alternatives to MCP stdio ShellGuard are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/mcp-stdio-shellguard
