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 Performance
L0 Cloud Gateway SSE/Network Bridge with optional API key auth <5ms
L1 Static Rules 80+ security signatures across 5 categories <1ms
L2 Semantic Intelligence Local Ollama LLM intent classification Async
L3 Behavioral Analysis Sliding-window anomaly detection (Scraping/Enum) Stateful

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 processes a "fire-and-forget" payload directly 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.

Enterprise 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 OpenAI, L3 Behavioral Redis Scaling) โœ… DONE
Phase 3 Flight Recorder (VEX & CHORA Integration) โœ… DONE
Phase 4 Distribution (v1.0.0 Stable, PyPI, WSL Verified) โœ… DONE
Phase 5 Enterprise Integration (Railway, 100% Finality) โœ… 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.2.tar.gz (1.1 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.2-py3-none-any.whl (40.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcp_vanguard-1.1.2.tar.gz
  • Upload date:
  • Size: 1.1 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.2.tar.gz
Algorithm Hash digest
SHA256 9612389376003e75c3faef6eebd883a420b072d13d656eb0eee1d2d60a9e0040
MD5 969db9bcbaae306545199ed48a9b6b8f
BLAKE2b-256 97128e43d45a13edfe36630421d4cb115f404b30eae42b21fbc87e184cddb3a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_vanguard-1.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: mcp_vanguard-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 40.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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 44951ccc0a2eebd237c57d2c7cd4bcf18eded12b4e5410c4c0d31cbf38ba2ea4
MD5 abb69f831219d158bad5263fdc1a0467
BLAKE2b-256 c22bbf02ddf2622e94800e85e57d1b88ab8ba14c2797883ab0cda4d6cdee8e65

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_vanguard-1.1.2-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