Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

Aegis-MCP

Latest version: v0.2.0

Overview

Last scanned
2 Dec 2026
Published
2 Dec 2026
MCP server Transport: stdio Publisher: AlejandroCasa
0 Stars
0 Forks
1 Versions
Python Repo language

Scan summary

Aegis-MCP was last scanned on 2 Dec 2026 at version 0.2.0. Risk score 10 of 100 (low). No malicious behavior was detected.

  • Releases: First and only release on 2 Dec 2026.
  • Findings: 1 rule fired in version 0.2.0 (6 instances: 6 medium). The score describes this version only.
  • MCP server: Runs over stdio.

Versions

1 version published
Versions and the rules that fired in each
VersionPublishedStatus
0.2.0 LATEST 2 Dec 2026 1 rule fired

Rules fired in 0.2.0: 1

Findings

6 Medium

Findings for v0.2.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

Encoded string decodes to a command or instruction

An encoded string in the package decodes, without being run, to a shell command, a network call, a code-execution call or an instruction aimed at an AI agent. The content was hidden from a plain read of the code. Encoding has legitimate uses, so the decoded content needs review.

MEDIUM
Checking access…

🔒 Create a free account to see all 6 findings with descriptions and instance counts

The score describes 0.2.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

Aegis-MCP

A lightweight, cloud-native Zero-Trust Firewall, DLP Redactor & Cryptographic Audit Proxy for Model Context Protocol (MCP) servers, built with Python 3.12, FastAPI, Pydantic v2, SQLite, and uv.

Aegis-MCP sits between AI Agents (Claude Desktop, Cursor, autonomous orchestrators) and downstream MCP servers, inspecting every tools/call invocation in real time to block Indirect Prompt Injection, Destructive SQL/Shell Execution, and Path Traversal, while automatically scrubbing PII & Secrets and recording every decision in a tamper-evident SHA-256 hash-chained SQLite ledger.


Architecture

flowchart LR
    host["MCP Host<br/>(Claude Desktop, Cursor, agents)"]
    subgraph gateway["Aegis-MCP Gateway"]
        direction LR
        auth["Auth / RBAC / ABAC"]
        canon["Canonicalize"]
        threat["Threat Rules & Taint"]
        dlp["DLP"]
        ledger["SHA-256 Ledger & Merkle"]
        auth --> canon --> threat --> dlp --> ledger
    end
    upstream["Upstream MCP Servers"]
    host -->|"tools/call, resources/read, prompts/get"| auth
    ledger -->|"ALLOWED / SANITIZED"| upstream
    upstream -->|"toolguard-screened, DLP-redacted replies"| host

Every request from an MCP host passes through the gateway pipeline in order: identity and policy checks (app/auth.py, app/policy.py, app/constraints.py), anti-evasion canonicalization (app/normalize.py), threat rules and toxic-flow taint tracking (app/firewall.py, app/taint.py), DLP redaction (app/redactor.py), and the hash-chained audit ledger with Merkle checkpoints (app/ledger.py, app/merkle.py). Only allowed or sanitized calls reach the upstream MCP server.

Key Capabilities
  • Zero-Trust MCP Tool-Call Inspection (POST /api/v1/mcp/inspect):
    • Evaluates MCP tool invocations (agent_id, server_name, tool_name, arguments, environment) against deterministic security policies in < 2 ms.
    • Threat Detection Engine (app/firewall.py):
      • prompt_injection: Blocks instruction override attempts (ignore previous instructions, system prompt:, <|im_start|>).
      • path_traversal: Blocks unauthorized filesystem escapes (../, /etc/passwd, /etc/shadow, .ssh/id_rsa, .env).
      • destructive_sql: Blocks destructive SQL/DDL payloads (DROP TABLE, TRUNCATE TABLE, DELETE FROM ... WHERE 1=1).
      • command_injection: Blocks shell metacharacter chaining and destructive system commands (rm -rf, ; curl, | bash, `, $()).
  • Real-Time DLP & Secret Redaction (app/redactor.py):
    • Automatically scrubs sensitive data inside nested tool arguments before forwarding to MCP servers or external LLMs:
      • Secrets & Tokens: OpenAI/Anthropic/GitHub keys (sk-..., ghp_..., AKIA...) and Bearer tokens $\rightarrow$ [REDACTED_SECRET].
      • Emails: Standard email addresses $\rightarrow$ [REDACTED_EMAIL].
      • IBANs: European/International bank accounts $\rightarrow$ [REDACTED_IBAN].
  • Tamper-Evident SHA-256 Audit Ledger (GET /api/v1/audit & GET /api/v1/audit/verify):
    • Every inspection decision (ALLOWED, SANITIZED, BLOCKED) is persisted in an embedded SQLite ledger (sqlite3 stdlib, default /tmp/aegis_mcp.db for readOnlyRootFilesystem: true compatibility).
    • Each record (hash v2, app/ledger.py) computes entry_hash as the SHA-256 of the RFC 8785 (JCS) canonical JSON of the full entry (prev_hash, timestamp, identity/scope, decision, risk score, violations, DLP categories, sanitized-arguments digest, policy version/mode, would_block, MCP session id), forming an immutable chain verifiable via GET /api/v1/audit/verify. Legacy v1 links (SHA256(prev_hash | timestamp | agent_id | server_name | tool_name | decision | risk_score)) are migrated additively and still verified; a v1 link after a v2 link is rejected as a downgrade.
  • Anti-Evasion Canonicalization (app/normalize.py): threat rules and DLP also run on NFKC-normalized, zero-width/bidi-stripped (CVE-2021-42574), tag-revealed, homoglyph-folded, percent/HTML-decoded and bounded recursive Base64/hex-decoded views; matches only visible after decoding add obfuscated_payload.
  • Prometheus Observability (GET /metrics) & Perimeter Auth (X-API-Key):
    • Zero-dependency Prometheus 0.0.4 text exposition tracking aegis_mcp_requests_total, aegis_mcp_blocked_total, aegis_mcp_redactions_total, aegis_mcp_ledger_errors_total, and the aegis_mcp_inspection_duration_seconds SLO histogram (1 ms–500 ms buckets around the 10 ms p99 objective). Label values are sanitized and capped at 64 per label (overflow → other); no agent_id/session_id labels.
    • OpenTelemetry traces (app/telemetry.py) over OTLP/HTTP with GenAI/MCP semantic conventions (gen_ai.system, mcp.server.name, mcp.tool.name, mcp.method.name, aegis.decision, aegis.risk_score, pseudonymized aegis.session.id) for the HTTP server span, the JSON-RPC proxy, /mcp Streamable HTTP and MCPFirewall.inspect; W3C traceparent is honored.
    • DLP-scrubbed structured JSON logs with trace_id, span_id, request_id (X-Request-Id), decision and risk_score; Grafana dashboard deploy/grafana/aegis-mcp.json and PrometheusRule alerts deploy/prometheus/aegis-mcp-rules.yaml (p99 > 10 ms, toxic-flow / tool-drift spikes, chain/checkpoint errors).
  • 4-Phase Zero-Tolerance CI/CD & Container Hardening:
    • Multi-stage Dockerfile running under UID 10001 (appuser) with Kubernetes manifests (k8s/) and OPA/Rego policies (policy/).
  • Threat Model, Security Policy & Compliance Mapping:
    • docs/THREAT-MODEL.md: STRIDE analysis for every trust boundary (MCP client, gateway transports, upstream servers, audit ledger and Ed25519 checkpoints, operators, webhooks/OTLP), a residual risk register, and a control matrix against the OWASP LLM Top 10 2025, OWASP Agentic AI Threats, MITRE ATLAS, NIST AI RMF, the EU AI Act (Art. 12 & 14) and ISO/IEC 42001.
    • SECURITY.md: supported versions, private vulnerability disclosure (GitHub Security Advisories), response targets, and how to verify releases (cosign, SLSA) and the audit ledger (scripts/verify_ledger.py).

Tech Stack

Layer Technology
Language & runtime Python 3.12, managed with uv (uv.lock, uv_build)
Web framework FastAPI on Uvicorn (ASGI)
Data validation & settings Pydantic v2, pydantic-settings
Upstream transports httpx (JSON-RPC 2.0, MCP Streamable HTTP / SSE) and the stdio wrapper (app/stdio_wrap.py)
Identity & cryptography PyJWT, cryptography (Ed25519 checkpoints), SHA-256, RFC 8785 (JCS) canonical JSON
Policy YAML RBAC/ABAC documents (pyyaml) and OPA/Rego admission policies (policy/)
Audit storage SQLite (sqlite3 stdlib, WAL mode)
Observability Prometheus text exposition, OpenTelemetry OTLP/HTTP, structured JSON logs
Quality tooling pytest, pytest-cov, mypy (strict), ruff, black, isort, bandit, pip-audit, radon, xenon, atheris, mutmut, k6
Delivery Multi-stage Dockerfile, Kubernetes manifests (k8s/), Grafana and Prometheus assets (deploy/)

Quick Start

Install as an Agent Skill (Claude Code, Cursor, Windsurf, Copilot)

Install the free, official Aegis-MCP skill from Agensi.io to let your coding agent wire app.stdio_wrap, generate RBAC/ABAC/taint YAML policies (dev-monitor.yaml / prod-strict.yaml), run tool-poisoning scans, and verify the audit ledger automatically.

make install   # uv sync --frozen
make dev       # uv run uvicorn app.main:app --reload --port 8000
make test      # pytest with coverage (--cov-fail-under=85)
make check     # full gate: lock, format, lint, types, SAST, deps, complexity, coverage, fuzz, detection, latency, red-team
make redteam   # promptfoo adversarial red-team against the gateway (Node.js 22 / npx)
make docker    # docker build -t aegis-mcp:latest .
Local Run & Simulation
# Option A: Run locally with uv
uv run uvicorn app.main:app --reload --port 8000

# Option B: Run MCP security & DLP traffic simulation
uv run python -m scripts.simulate_mcp_traffic --dry-run

# Option C: Build and run hardened production container
docker build -t aegis-mcp:latest .
docker run --rm -p 8000:8000 aegis-mcp:latest
Firewalling local stdio MCP servers (Claude Desktop / Cursor / Windsurf)

app.stdio_wrap sits between a local MCP host and any stdio MCP server subprocess:

uv run python -m app.stdio_wrap [--server-name NAME] [--agent-id AGENT] \
  [--environment dev|staging|prod] [--policy PATH] [--db-path PATH] -- <command> [args...]

Replace the server's command/args in your host's mcpServers config with the wrapper (use absolute paths; --directory points uv at this checkout):

{
  "mcpServers": {
    "filesystem": {
      "command": "uv",
      "args": [
        "run", "--directory", "/opt/aegis-mcp", "python", "-m", "app.stdio_wrap",
        "--server-name", "filesystem-mcp", "--agent-id", "cursor",
        "--policy", "/opt/aegis-mcp/policy/local.yaml",
        "--", "npx", "-y", "@modelcontextprotocol/server-filesystem", "/srv/workspace"
      ]
    },
    "postgres": {
      "command": "uv",
      "args": [
        "run", "--directory", "/opt/aegis-mcp", "python", "-m", "app.stdio_wrap",
        "--server-name", "postgres-mcp", "--environment", "prod",
        "--policy", "/opt/aegis-mcp/policy/local.yaml",
        "--", "npx", "-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/app"
      ]
    }
  }
}
  • Framing: UTF-8 newline-delimited JSON-RPC 2.0 on stdin/stdout (lines capped at 1 MiB from the host and 5 MiB from the server); the server's stderr and wrapper diagnostics go to stderr only.
  • Inbound: tools/call, resources/read and prompts/get run the full MCPFirewall.inspect pipeline (threat rules, RBAC, tool_constraints, toolguard drift/poisoning, toxic-flow taint, DLP, ledger). Blocked calls are never forwarded and are answered with -32003 (violations, audit_hash). Discovery requests, notifications/* and client responses are DLP-redacted; other methods get -32601, client batches -32600.
  • Outbound: replies are matched to their pending request and toolguard-screened (initialize pinning, */list TOFU pinning, drift hiding, poisoning hiding, RBAC least-privilege tools/list), DLP-redacted (a redaction promotes the session to private_data taint), and reserved codes -32003/-32004 are rewritten to -32000. Server-initiated messages are DLP-redacted; unsolicited responses are dropped.
  • Session: one stdio-<32 hex> session id per wrapper lifetime binds taint tracking and ledger v2 entries across every call.
  • Secret hygiene: every AEGIS_* variable (e.g. AEGIS_API_KEY, AEGIS_DLP_HMAC_KEY) is stripped from the server's environment; the server is spawned with shell=False.
Marketplace Plugin Bundle

plugins/aegis-mcp/ is a self-contained, publishable plugin bundle: a plugin.json manifest, logo, mcp_config.json stdio-wrapper template, and ready-to-use dev-monitor / prod-strict example policies. See the plugin README for installation and wiring, and the agent skill for the install, govern, and verify workflow.


Configuration

Gateway Environment Variables (AEGIS_*)

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • MCP Registry io.github.AlejandroCasa/aegis-mcp

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Plug and Pray: Your AI Agents Are Taking Orders From Strangers
Research

Plug and Pray: Your AI Agents Are Taking Orders From Strangers

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Frame 2085668439 (1)
Group 1261154229