# shellward

Scans your project for data-leak risks and dangerous commands, then blocks prompt injection and exfiltration at runtime. Built for AI projects under Chinese regulation.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 139
- Author: jnMetaCode
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/jnMetaCode/shellward
- Updated: 2026-09-28
- HTML: https://affpapa.org/en/nevibecode/mcp/shellward

## What it does

shellward is an MCP server with 7 tools: injection detection, PII scanning, command safety checks, and DLP. It sits between your agent and the outside world, intercepting suspicious calls before they leave.

Scanning runs with a single command, `npx shellward scan` — no install, read-only, nothing uploaded. You get a red/yellow/green scorecard mapped to Chinese regulatory requirements plus concrete findings with `file:line` locations. Calls to overseas LLM endpoints and SDKs are flagged as cross-border data channels. For any overseas model it finds, the server suggests domestic alternatives with a compatible `base_url`, so migration often means changing one line.

Setup uses the environment variables `SHELLWARD_MODE`, `SHELLWARD_LOCALE`, and `SHELLWARD_THRESHOLD`, passed when you add the server. Without them it still starts, but thresholds fall back to defaults. There is also a web mode: `shellward web --local` opens a local GUI where you paste a project path — code never leaves your machine.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `SHELLWARD_MODE`, `SHELLWARD_LOCALE`, `SHELLWARD_THRESHOLD` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env SHELLWARD_MODE=<SHELLWARD_MODE> --env SHELLWARD_LOCALE=<SHELLWARD_LOCALE> --env SHELLWARD_THRESHOLD=<SHELLWARD_THRESHOLD> --transport stdio shellward -- npx -y shellward
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add shellward --env SHELLWARD_MODE=<SHELLWARD_MODE> --env SHELLWARD_LOCALE=<SHELLWARD_LOCALE> --env SHELLWARD_THRESHOLD=<SHELLWARD_THRESHOLD> -- npx -y shellward
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "shellward": {
            "command": "npx",
            "args": [
                "-y",
                "shellward"
            ],
            "env": {
                "SHELLWARD_MODE": "<SHELLWARD_MODE>",
                "SHELLWARD_LOCALE": "<SHELLWARD_LOCALE>",
                "SHELLWARD_THRESHOLD": "<SHELLWARD_THRESHOLD>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "shellward": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "shellward"
            ],
            "env": {
                "SHELLWARD_MODE": "<SHELLWARD_MODE>",
                "SHELLWARD_LOCALE": "<SHELLWARD_LOCALE>",
                "SHELLWARD_THRESHOLD": "<SHELLWARD_THRESHOLD>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e SHELLWARD_MODE=<SHELLWARD_MODE> -e SHELLWARD_LOCALE=<SHELLWARD_LOCALE> -e SHELLWARD_THRESHOLD=<SHELLWARD_THRESHOLD> shellward npx -y shellward
```
Replace <…> with your own values

## When to use it
- find calls to overseas LLM endpoints in a project
- check whether personal data leaks into prompts
- block dangerous commands before the agent runs them
- spot hardcoded keys and tokens in source files
- produce a compliance report for an audit

## Example prompts
- Run `shellward scan` and show me what risks are in this project
- Check this file for personal data and hardcoded keys
- Compare our code against PIPL requirements and tell me what's missing

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [mcp](https://affpapa.org/en/nevibecode/mcp/kubeshark-mcp.md) — MCP server · ★ 12109
- [Robin: AI-Powered Dark Web OSINT](https://affpapa.org/en/nevibecode/mcp/robin-ai-powered-dark-web-osint.md) — MCP server · ★ 7658
- [jshookmcp](https://affpapa.org/en/nevibecode/mcp/jshookmcp.md) — MCP server · ★ 2061
- [OpenOSINT](https://affpapa.org/en/nevibecode/mcp/openosint.md) — MCP server · ★ 1802

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
