# ShellWard MCP server

> Provides security tools for AI agents to detect prompt injections, scan for PII, and block dangerous commands or data exfiltration at runtime.

- Repository: https://github.com/jnMetaCode/shellward
- Page: https://hostedmcp.org/servers/jnmetacode/shellward
- Transport: stdio
- Stars: 139
- License: Apache-2.0
- Latest version: 0.5.11

## Install

### Claude Code

```sh
claude mcp add shellward -- npx -y shellward
```

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

```json
{
  "mcpServers": {
    "shellward": {
      "command": "npx",
      "args": [
        "-y",
        "shellward"
      ]
    }
  }
}
```

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

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

### VS Code CLI

```sh
code --add-mcp '{"name":"shellward","type":"stdio","command":"npx","args":["-y","shellward"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "shellward": {
      "command": "npx",
      "args": [
        "-y",
        "shellward"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add shellward -- npx -y shellward
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.shellward]
command = "npx"
args = ["-y", "shellward"]
```

### Gemini CLI

```sh
gemini mcp add -s user shellward npx -- -y shellward
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "shellward": {
      "command": "npx",
      "args": [
        "-y",
        "shellward"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `SHELLWARD_LOCALE` | no | no | Locale: auto, zh, or en |
| `SHELLWARD_MODE` | no | no | Security mode: enforce (block + log) or audit (log only) |
| `SHELLWARD_THRESHOLD` | no | no | Injection detection threshold 0-100 (lower = stricter) |

## FAQ

### How can I use ShellWard as an MCP server?

You can add it to your MCP config (like claude_desktop_config.json) using npx to fetch the shellward-mcp binary.

### Does ShellWard upload my data to a server?

No, the scan is zero-install, read-only, and does not upload any data; it runs locally.
