# Cage Security

> Cage Security is an open-source MCP server for security. Offline MCP server giving AI coding assistants deterministic AppSec audit tools. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted, API
- **Repository:** https://github.com/draarivpatel-ui/cage-mcp-server
- **MCP Registry name:** io.github.draarivpatel-ui/cage-mcp-server
- **Categories:** [security](https://ai-powered.com/categories/security)
- **Listing updated:** 2026-11-28

## About

Cage Security runs locally as a stdio MCP server and hands AI coding assistants a set of fixed application-security checks. Each of its ten tools wraps a separate published npm security package, covering path traversal, HTTP headers, redirects, dotenv files, cookies, ZIP archives, log redaction, CORS policies, JSON input and source snippet linting.

The server makes no network calls and does not rely on a model or remote scanner, so the same input yields the same findings. Tool input is treated as data and never executed, and ZIP archives are inspected in memory rather than extracted. Unsafe results come back as structured findings rather than tool errors.

It suits developers who use Claude Code, Codex CLI, Cursor or Windsurf and want their assistant to check redirects, cookie settings, env files or GitHub Actions snippets during coding. Findings are static guardrails and are meant to supplement code review and testing rather than prove an application secure.

## Features

- **Ten bounded audit tools:** Covers paths, headers, redirects, dotenv, cookies, ZIP entries, logs, CORS, JSON and code snippets.
- **Offline deterministic checks:** Makes no network requests and uses no model, so repeated runs produce identical results.
- **No command execution:** Tool input is never evaluated, passed to a shell or run as source code.
- **Secret-aware output:** Dotenv values and cookie values are redacted, and a log redaction tool strips credentials and PII patterns.
- **Strict stdio framing:** Accepts newline-delimited and Content-Length JSON-RPC framing with bounded frame and header sizes.
- **Pinned npm installation:** Runs via npx with a pinned version so client setups do not pick up unexpected releases.

## Good for

- Check redirect targets and origin policies while writing login or callback flows
- Lint CORS and cookie configuration before merging a web service change
- Redact sensitive values from logs before pasting them into an AI chat
- Audit JSON payloads for prototype-pollution keys and duplicate fields
- Scan a code snippet for dangerous eval or HTML sinks and risky GitHub Actions patterns

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add cage-mcp-server -- npx -y cage-mcp-server
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

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

### Claude Desktop (claude_desktop_config.json)

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

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

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

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

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

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

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add cage-mcp-server -- npx -y cage-mcp-server
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.cage-mcp-server]
command = "npx"
args = ["-y", "cage-mcp-server"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

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

Or run: gemini mcp add -s user cage-mcp-server npx -- -y cage-mcp-server

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

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

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

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

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

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

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "cage-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "cage-mcp-server"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

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

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

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

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

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

Use .kiro/settings/mcp.json to add it to one workspace only.

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

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

## Tools

From the tool list in its README, going by the names, 10 names don't say. From the server's own tool labels and tool names; not verified by us.

- `audit_path`: Lexically resolve a path inside an absolute root and report traversal and length violations.
- `audit_headers`: Validate header names and values, audit CSP and Set-Cookie strings, and compare headers with a baseline.
- `audit_redirect`: Evaluate redirect targets against origin, host, protocol, query, fragment and blocked-path policy.
- `audit_env`: Parse dotenv text without expansion and report secret hygiene without returning values.
- `audit_cookie`: Parse Cookie headers or serialize a hardened Set-Cookie header.
- `audit_zip_entries`: Inspect a small base64 ZIP archive in memory for traversal, bombs and other structural hazards.
- `redact_log`: Sanitize log text or records by redacting credentials, tokens and optional PII patterns.
- `audit_cors`: Lint a CORS policy and evaluate a bounded request for origin, method and credential behavior.
- `audit_json`: Inspect JSON text for duplicate keys, prototype-pollution keys, depth, size and Unicode hazards.
- `lint_security_code`: Scan a bounded source snippet for eval and HTML sinks, command injection, hardcoded credentials and risky CI patterns.

## FAQ

### Does Cage Security send my code or data over the network?

No. The server states it makes no network requests and does not depend on a cloud API or remote scanner.

### Which AI clients can use Cage Security?

The README includes setup examples for Claude Code, Codex CLI, Cursor and Windsurf.

### Does Cage Security execute the code I submit?

No. Tool input is never evaluated or executed; snippets are written to a temporary file only so the linter can scan them as data.

### What does a failed audit look like?

An unsafe result returns ok set to false with a list of findings. The error flag is reserved for operational failures inside the tool.

### Is Cage Security free?

Yes. Cage Security is open source, so you can use and self-host it for free.

### How do I add Cage Security to Claude Code?

Run this command in your terminal: claude mcp add cage-mcp-server -- npx -y cage-mcp-server

### What are the best alternatives to Cage Security?

The closest alternatives to Cage Security are MCP configuration audit, MCP Security Guard, MCP Customs, MCP Server Security Scanner and AI Tool Audit.

## Where this comes from

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

## Alternatives

- [MCP configuration audit](https://ai-powered.com/mcp/mcp-configuration-audit): MCP configuration audit is an open-source MCP server for security.
- [MCP Security Guard](https://ai-powered.com/mcp/mcp-security-guard): MCP Security Guard is an open-source MCP server for security.
- [MCP Customs](https://ai-powered.com/mcp/mcp-customs): MCP Customs is an open-source MCP server for security.
- [MCP Server Security Scanner](https://ai-powered.com/mcp/mcp-server-security-scanner): MCP Server Security Scanner is a freemium MCP server for security.
- [AI Tool Audit](https://ai-powered.com/mcp/ai-tool-audit): AI Tool Audit is an open-source MCP server for security.
- [MCP Security & Vulnerability Auditor](https://ai-powered.com/mcp/mcp-security-and-vulnerability-auditor): MCP Security & Vulnerability Auditor is an open-source MCP server for security.
- [Audit AI](https://ai-powered.com/mcp/audit-ai): Audit AI is an open-source MCP server for databases.
- [Ci Guard MCP](https://ai-powered.com/mcp/ci-guard-mcp): Ci Guard MCP is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/cage-security
