AegisCode
Setup

Put a checkpoint in front of your agent.

Everyday MCP use is a one-liner via npx. Only the package check talks to the network (the npm and PyPI registries). The optional AI review lives in the web app.

1. Connect your agent over MCP

Claude Code:

shell
claude mcp add aegiscode -- npx -y -p github:Wali05/AegisCode aegis mcp

Cursor (.cursor/mcp.json in your project, or the global one):

json
{
  "mcpServers": {
    "aegiscode": {
      "command": "npx",
      "args": [
        "-y",
        "-p",
        "github:Wali05/AegisCode",
        "aegis",
        "mcp"
      ]
    }
  }
}

Codex (~/.codex/config.toml):

toml
[mcp_servers.aegiscode]
command = "npx"
args = ["-y", "-p", "github:Wali05/AegisCode", "aegis", "mcp"]

The first run can take a minute while npm installs dependencies and builds the CLI. Later runs reuse the cache. Any other MCP client: the same npx … aegis mcp command over stdio, from your project folder.

2. Or clone if you are hacking on it

shell
git clone https://github.com/Wali05/AegisCode.git ~/aegiscode
cd ~/aegiscode && npm ci
claude mcp add aegiscode -- node ~/aegiscode/bin/aegis.mjs mcp

3. Tell the agent to use it

Add this to your CLAUDE.md, AGENTS.md or Cursor rules:

markdown
## Security checks

Before committing, call the `scan_changes` tool from the aegiscode MCP server and fix every
new issue it reports (apply the verified fix when one is given).
Before adding a dependency, call `check_packages` with the package names.
ToolWhat it does
scan_changesScans uncommitted, staged, or since-branch changes and returns only the issues they introduce. The one to call before committing.
scan_codeScans a file's contents before it is written. Includes verified fixes the agent can apply directly.
check_packagesChecks package names on npm / PyPI before they're added: nonexistent, lookalike, brand-new, install scripts, deprecated.
scan_pathsScans files or folders (inside the project only), following data flow across them.
explain_ruleExplains a rule id such as AEG-TAINT-SQL: what it catches and how to fix it.

What the agent gets back:

scan_changes
AegisCode: 1 changed file(s) — 2 new issue(s), 0 fixed, 3 pre-existing (not shown).
- [CRITICAL] src/db/orders.ts:4 SQL injection: HTTP request input (from src/routes/orders.ts) → line 4 (AEG-TAINT-SQL, CWE-89)
  flow: src/routes/orders.ts:6 HTTP request input → src/routes/orders.ts:6 passed to findOrders() in src/db/orders.ts → L4 concatenated into string → L4 reaches sql injection sink
  verified fix (Use a parameterised query), replace line 4 with:
    return pool.query("SELECT * FROM orders WHERE customer = $1", [customerId]);
- [HIGH] src/routes/orders.ts:2 `pdf-invoice-parser-pro` does not exist on npm (AEG-PKG-001)
  fix: Find the real package that provides this functionality and depend on that, or remove the import.

4. Block risky commits

The hook scans only staged changes and fails only on issues the commit introduces (high and above by default). Skip it once with git commit --no-verify.

shell
cd your-project
node ~/aegiscode/bin/aegis.mjs hook install
# or: npx -y -p github:Wali05/AegisCode aegis hook install
# stricter: AEGIS_FAIL_ON=medium git commit ...

5. Gate pull requests in CI

yaml
- run: |
    git clone --depth 1 https://github.com/Wali05/AegisCode .aegis
    npm ci --prefix .aegis --omit=dev --ignore-scripts
- run: node .aegis/bin/aegis.mjs scan --since origin/main --sarif aegis.sarif --fail-on high
- uses: github/codeql-action/upload-sarif@v4
  if: always()
  with: { sarif_file: aegis.sarif }

For a full scan that ignores existing issues, write a baseline once with --write-baseline aegis-baseline.json, commit it, and run with --baseline aegis-baseline.json.