cage-mcp-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cage-mcp-server audit this path for traversal: ../../etc/passwd"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
cage-mcp-server
cage-mcp-server is an offline Model Context Protocol server that gives AI coding assistants deterministic application-security guardrails. It exposes ten bounded MCP tools backed directly by ten published npm security packages: sentinel-lint, pathcage, headersafe, redirectcage, envcage, cookiecage, zipcage, logcage, corscage, and jsoncage.
The server speaks JSON-RPC 2.0 over stdio. It supports the newline-delimited framing used by MCP stdio clients and strict Content-Length framing for harnesses that use that transport style.
Security model
Offline and deterministic: the server makes no network requests and does not depend on a model, a cloud API or a remote scanner.
No command execution: tool input is never evaluated, passed to a shell or executed as source.
lint_security_codewrites a snippet only sosentinel-lintcan scan it as data.Tightly bounded: JSON-RPC frames are limited to 2 MiB, header blocks to 8 KiB, and every tool applies stricter input limits before calling a security package.
Prototype-pollution resistant:
__proto__,constructorandprototypekeys are rejected in the JSON-RPC envelope before arguments are used. JSON text supplied as a string can still be audited for those keys byaudit_json.Filesystem minimization: the server never reads or writes caller-selected paths. The only filesystem write is a mode-0600 temporary source snippet in the operating-system temporary directory for
lint_security_code; it is removed in afinallyblock before the tool returns. ZIP archives are inspected in memory and never extracted.Secret minimization: dotenv values are never returned. Parsed Cookie values are redacted. Set-Cookie audit values are redacted. Use
redact_logbefore putting potentially sensitive log data into a model transcript.Fail-closed framing: malformed JSON, invalid UTF-8, duplicate length headers, unsupported headers, oversized frames and prototype-pollution keys produce bounded JSON-RPC errors rather than process crashes.
Static analysis limits: findings are deterministic guardrails, not proof that an application is secure. They complement review, testing and runtime controls.
Related MCP server: VibeGuard MCP Server
Install and run
Node.js 18 or newer is required.
From a source checkout:
npm ci
npm test
npm run smoke
node bin/cage-mcp-server.mjsThe process intentionally writes no startup banner. MCP clients own stdin and stdout.
MCP client configuration
The examples use the intended npm executable cage-mcp-server@1.0.0. Pinning the exact version prevents a future package release from being selected silently.
Claude Code
CLI registration:
claude mcp add cage-security -- npx -y cage-mcp-server@1.0.0Equivalent project-scoped .mcp.json:
{
"mcpServers": {
"cage-security": {
"command": "npx",
"args": ["-y", "cage-mcp-server@1.0.0"]
}
}
}Codex CLI
CLI registration:
codex mcp add cage-security -- npx -y cage-mcp-server@1.0.0Equivalent ~/.codex/config.toml entry:
[mcp_servers.cage-security]
command = "npx"
args = ["-y", "cage-mcp-server@1.0.0"]
startup_timeout_sec = 10
tool_timeout_sec = 30Cursor
Add this server to the Cursor MCP configuration:
{
"mcpServers": {
"cage-security": {
"command": "npx",
"args": ["-y", "cage-mcp-server@1.0.0"]
}
}
}Windsurf
Open the MCP config file from the Cascade MCP menu and add:
{
"mcpServers": {
"cage-security": {
"command": "npx",
"args": ["-y", "cage-mcp-server@1.0.0"]
}
}
}Refresh the MCP server list after saving.
Tool reference
MCP tool | Backing package | Purpose | Required input |
|
| Lexically resolve a path inside an absolute root and report traversal, encoded traversal and length violations. No filesystem access. |
|
|
| Validate header names and values, audit CSP and Set-Cookie strings, and compare supplied headers with a strict baseline. | one of |
|
| Evaluate relative or absolute redirect targets against explicit origin, host, protocol, query, fragment and blocked-path policy. |
|
|
| Parse dotenv text without expansion or interpolation, optionally validate a schema, and report secret hygiene without returning values. |
|
|
| Parse Cookie headers with duplicate and encoding protection, or serialize a hardened Set-Cookie header. |
|
|
| Inspect a small base64 ZIP archive in memory for traversal, polyglot structure, compression bombs, special files, encryption and metadata inconsistencies. |
|
|
| Sanitize line-forging controls and redact credentials, tokens, sensitive object keys and optional high-precision PII patterns. | exactly one of |
|
| Lint a CORS policy and optionally evaluate a bounded request for origin, method, credential, preflight and private-network behavior. | none; |
|
| Inspect JSON text for duplicate keys, prototype-pollution keys, excess depth or size, unsafe numbers, Unicode hazards and NUL hazards. |
|
|
| Scan one bounded source snippet for dangerous eval and HTML sinks, command-injection patterns, hardcoded credential shapes, insecure MCP configuration and risky GitHub Actions patterns. |
|
Every tool accepts a JSON object and returns both MCP text content and structured content. An unsafe audit result normally has ok: false; it is not a tool execution failure. isError: true is reserved for operational failures inside the tool.
Example JSON-RPC exchange
Newline-delimited stdio:
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"example-client","version":"1.0.0"}}}
{"jsonrpc":"2.0","method":"notifications/initialized"}
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"audit_json","arguments":{"json":"{\"__proto__\":{\"x\":1}}"}}}The final response has a structured result similar to:
{
"ok": false,
"findings": [
{
"code": "JSONCAGE_PROTOTYPE_KEY",
"message": "prototype pollution key rejected",
"position": 1,
"key": "__proto__"
}
]
}Registry metadata
server.json describes the package for the Official MCP Registry using schema 2025-12-11. Its name matches the mcpName field in package.json, which is how the registry verifies npm package ownership.
glama.json declares draarivpatel-ui as the GitHub maintainer for Glama ownership claims.
Development
npm ci
npm test
npm run test:fuzz
npm run smoke
npm auditThe test suite uses only node:test. It covers direct behavior for all ten tools, newline-delimited and Content-Length stdio sessions, malformed JSON, oversized frames, prototype pollution, unknown methods, invalid arguments and repository hygiene.
Runtime dependencies are intentionally limited to the ten security packages. fast-check is the only development dependency, used only by the property-based fuzz tests. The fuzz suite uses seed 20261127 by default, and FUZZ_SEED can override it to replay a failure.
Repository layout
Path | Purpose |
| Executable stdio entrypoint |
| JSON-RPC validation, hybrid framing, lifecycle and tool dispatch |
| Tool schemas, strict input validation and package adapters |
| Bounded validation helpers and prototype-key rejection |
| Unit, integration, adversarial and hygiene tests |
| Live stdio smoke test used by CI |
| Official MCP Registry publishing metadata |
| Glama maintainer ownership metadata |
License
MIT. See LICENSE.
Available Tools
10 toolsaudit_cookieAudit or serialize cookiesB
Parse a Cookie header with duplicate and percent-encoding protection, or serialize a Set-Cookie value with hardened cookiecage defaults. Parsed cookie values are redacted from the response.
Inputs: mode (required), name, value, header, +2 more.
audit_corsAudit a CORS policyC
Lint a CORS configuration with corscage and optionally evaluate a bounded request shape for origin, method, preflight, credential, private-network, and header exposure decisions.
Inputs: policy, evaluate.
audit_envAudit dotenv contentB
Parse dotenv text with envcage without shell expansion or interpolation, optionally validate it against a small schema DSL, and report secret hygiene without returning secret values.
Inputs: dotenv (required), schema, maxBytes, maxEntries, +3 more.
audit_headersAudit HTTP security headersB
Audit HTTP headers with headersafe, including CSP and Set-Cookie analysis, CRLF validation, and comparison against a strict security header baseline.
Inputs: csp, headers, setCookie.
audit_jsonAudit a JSON payloadB
Inspect JSON text with jsoncage for duplicate keys, prototype pollution keys, depth, size, node count, unsafe numbers, invalid Unicode, BOM, and NUL hazards.
Inputs: json (required), options.
audit_pathAudit a path for traversal outside a rootB
Resolve a caller-supplied path inside an absolute root with pathcage and report traversal, encoded traversal, symlink-independent lexical escapes, and length violations. This is lexical and does not read the filesystem.
Inputs: path (required), root, decodeCheck, maxPathLength.
audit_redirectAudit a redirect targetC
Check a relative or absolute redirect target with redirectcage against explicit origin, host, protocol, query, fragment, dot-segment, and blocked-path policy.
Inputs: target (required), fallback, allowHash, maxLength, +10 more.
audit_zip_entriesAudit ZIP archive entriesA
Inspect a small base64 ZIP archive with zipcage and report traversal, polyglot, compression-ratio, encrypted-entry, duplicate-name, special-file, and metadata inconsistencies without extracting files.
Inputs: archiveBase64 (required), options.
lint_security_codeLint source for security issuesB
Run sentinel-lint rules against one bounded source snippet in an isolated temporary file. The scanner never executes the snippet, never follows symlinks, and the temporary file is deleted before the tool returns.
Inputs: code (required), filename, maxFileSize.
redact_logRedact and sanitize logsB
Neutralize log forging, terminal controls, secrets, credentials, sensitive object keys, optional high-precision PII patterns, and oversized structured records with logcage.
Inputs: pii, mode, text, record, +8 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool targets a distinct input artifact (path, headers, code snippet, redirect, dotenv, cookie, ZIP, log, CORS config, JSON), so an agent can usually pick correctly. The main overlaps are audit_headers (which also does Set-Cookie analysis) vs audit_cookie, and audit_cors vs audit_headers, plus secret-handling appearing in both audit_env and redact_log.
Eight of ten tools follow a clean audit_<noun> pattern with predictable snake_case. lint_security_code and redact_log deviate in verb only, but both read naturally and the deviation signals a genuinely different action rather than sloppiness.
Ten tools is squarely in the sweet spot for a security-auditing server. Each tool covers a distinct hazard class and none feels like filler or a redundant wrapper.
The surface covers most common untrusted-input categories (paths, headers, redirects, env, cookies, ZIP, JSON, logs, source, CORS) with both reporting and sanitization verbs. Minor gaps remain for full-URL/SSRF analysis, HTML/XML/XXE, and templating or shell-command input auditing.
Maintenance
Related MCP Connectors
Zero-config MCP security scanner for AI-generated apps. 25K+ vulnerability patterns.
Zero-install security baseline for AI coding agents — OWASP/CWE-cited rules over MCP.
30 offline AI security MCP tools (7 free): prompt, PII, RAG, MCP, A2A, x402, policy, IaC & code.
Free MCP security tools for AI coding agents. Check npm/PyPI package versions, identify known OSV vulnerabilities, compare with the latest releases, and review up to 3 dependencies before deployment.
Related MCP Servers
- AlicenseAqualityBmaintenanceMCP security server for AI coding agents. 12 tools: pre-install guardian, vulnerability audit, supply-chain attack detection via static code analysis, and CycloneDX 1.6 SBOM generation. Zero runtime dependencies.1599 npm15Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI coding tools to scan projects for security vulnerabilities, hardcoded secrets, injection flaws, and privacy violations with 699 rules and 76 MCP tools, all running locally with zero telemetry.2,608 npm7MIT
- AlicenseBqualityBmaintenanceEnables AI agents to run deterministic, fully local static security and compliance audits of code, configurations, and dependencies through 32 MCP tools covering 24 vulnerability categories. It also detects the project stack, generates risk reports and checklists, suggests stack-aware remediations, and re-validates fixes to confirm vulnerabilities were eliminated.321MIT
- AlicenseBqualityBmaintenanceExposes seven MCP tools that let an AI coding agent detect a project's stack, fetch the priority security checks for that platform, search 2,057 OWASP-derived check cards with file-and-commit provenance, and record evidence-backed pass/fail results in a report.7MIT