Skip to main content

Security proxy and verification layer for the Model Context Protocol (MCP)

Project description

๐Ÿ›ก๏ธ McpVanguard

The Interception & Verification Layer for MCP Agents

McpVanguard is an open-source security proxy and active firewall for the Model Context Protocol (MCP). It acts as a real-time "Reflex System" between AI agents and their tools, protecting the host system from malicious intent, prompt injection, and data exfiltration.

Part of the Provnai Open Research Initiative โ€” Building the Immune System for AI.

Tests PyPI version License: Apache 2.0 Python 3.11+

No changes to your agent. No changes to your server. Just wrap it.


โšก Quickstart

Deploy on Railway

๐Ÿ“– Full Railway Deployment Guide

# 1. Install
pip install mcp-vanguard

# 2. Start as a Cloud Security Gateway (SSE)
# Set an API key to protect your endpoint
export VANGUARD_API_KEY="your-secret-key"
vanguard sse --server "npx @modelcontextprotocol/server-filesystem ."

# 3. Traditional Stdio Wrap (no network, no auth needed)
vanguard start --server "npx @modelcontextprotocol/server-filesystem ."

# 4. Enable VEX Flight Recorder (Immutable Audit)
export VANGUARD_VEX_URL="https://api.vexprotocol.com"
export VANGUARD_VEX_KEY="your-agent-jwt"
vanguard sse --server "..." --behavioral

# 5. Sync latest threat signatures from GitHub
vanguard update

๐Ÿง  The Interception Layer

McpVanguard sits at the Interception Layer of the Provnai stack. It prevents the gap between Cognitive Intent (what the agent thinks) and Environmental Execution (what actually happens to your PC).

3-Layer Defense-in-Depth

Layer Component Defense Mechanism Latency (P99)
L1 Static Rules 80+ security signatures across 5 categories ~16ms
L2 Semantic Intelligence Local Ollama LLM intent classification Async
L3 Behavioral Analysis Sliding-window anomaly detection (Scraping/Enum) Stateful

๐Ÿš€ Performance (Scale Verified)

McpVanguard is designed for high-concurrency production environments. Our latest benchmarks show:

  • Throughput: 240+ requests/second.
  • Security Overhead: <20ms (Layer 1).
  • Stability: Zero packet loss or state corruption across 5,000+ request bursts.

Rule Categories (Layer 1)

  • Filesystem: Path traversal, null bytes, restricted roots (/etc/, ~/.ssh/), Cyrillic homograph detection.
  • Command: Pipe-to-shell, reverse shells, semicolon/&&/newline command chaining, expansion bypasses.
  • Network: SSRF, cloud metadata endpoints (AWS/GCP/Azure), IPv6 and hex/octal encoded IPs.
  • Jailbreak: Prompt extraction, instruction-ignore patterns, unicode hidden characters.
  • Privilege: SUID binary creation, LD_PRELOAD injection, crontab manipulation.

๐Ÿ›ก๏ธ VEX Protocol Integration (Flight Recorder)

McpVanguard integrates natively with the VEX Protocol. Whenever the proxy blocks a malicious action (L1/L2/L3), it instantly sends a background report to the VEX API.

The VEX Server cryptographically hashes the blocked intent, runs it through the CHORA Gate, and anchors an immutable receipt (PoE) to the Bitcoin blockchain.

Auditors can mathematically prove exactly why an agent was blocked without relying entirely on local log trust.


๐Ÿ—๏ธ How It Works

McpVanguard Architecture

                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
     AI Agent       โ”‚     McpVanguard Proxy        โ”‚        โ”‚   VEX API    โ”‚
  (Claude, GPT)     โ”‚                             โ”‚โ”€โ”€Asyncโ”€โ–ถโ”‚ (CHORA Gate) โ”‚
        โ”‚           โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚โ”€โ”€JSON-RPCโ–ถโ”‚  โ”‚  L1: Rules Engine    โ”‚   โ”‚                โ”‚
        โ”‚           โ”‚  โ”‚  L2: Semantic Scorer  โ”‚   โ”‚                โ–ผ
        โ”‚           โ”‚  โ”‚  L3: Behavioral Logic โ”‚   โ”‚      [Bitcoin Anchor]
        โ”‚           โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
        โ”‚โ—€โ”€ BLOCK โ”€โ”€โ”‚        or ALLOW โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚      MCP Server
        โ”‚  (Status  โ”‚                             โ”‚ (filesystem, shell...)
        โ”‚   Code)   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Traffic is inspected on every message, in both directions. Blocked messages return a standard JSON-RPC error response โ€” the server never sees the attack.


๐Ÿ—บ๏ธ Project Status

Phase Goal Status
Phase 1 Foundation (Proxy, CLI, Defensive Rules) โœ… DONE
Phase 2 Intelligence (L2 Semantic, L3 Behavioral Scaling) โœ… DONE
Phase 3 Flight Recorder (VEX & CHORA Integration) โœ… DONE
Phase 4 Distribution (v1.0.0 Stable, PyPI, WSL Verified) โœ… DONE
Phase 5 Production Hardening (v1.1.3 stability & Telemetry) โœ… DONE

๐Ÿ“š Resources


๐Ÿ“„ License

Apache License 2.0 โ€” see LICENSE.

Built by the Provnai Open Research Initiative. "Verifying the thoughts and actions of autonomous agents."

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_vanguard-1.1.3.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_vanguard-1.1.3-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

File details

Details for the file mcp_vanguard-1.1.3.tar.gz.

File metadata

  • Download URL: mcp_vanguard-1.1.3.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcp_vanguard-1.1.3.tar.gz
Algorithm Hash digest
SHA256 e738ed8b0414e622db93c92d609a5ce320da1439a3bc6a06efb4c45e032a4f92
MD5 c9cefe7a5b795afb913234467ae6103e
BLAKE2b-256 c284c64ca614bec9122c3ceb42a29fd3a7eda4f3cd9ce96762f8c0198fc2a9b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_vanguard-1.1.3.tar.gz:

Publisher: publish.yml on provnai/McpVanguard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcp_vanguard-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: mcp_vanguard-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 43.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcp_vanguard-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3af02ef79da30c9c1e2a43eed9383bb77f667e90c8815d9a3e75d9fbe590a99d
MD5 5bc7231c0226790e680943e1dd0a0a58
BLAKE2b-256 03f8d684e39f01d9a8c6c8c2f1ac76de86312e98789436c80f39f5fa0b7fa606

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_vanguard-1.1.3-py3-none-any.whl:

Publisher: publish.yml on provnai/McpVanguard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page