Security proxy and verification layer for the Model Context Protocol (MCP)
Project description
McpVanguard ๐ก๏ธ
Titan-Grade AI Firewall for MCP Agents
MCP (Model Context Protocol) enables AI agents to interact with host-level tools. McpVanguard interposes between the agent and the system, providing real-time, three-layer inspection and enforcement (L1 Rules, L2 Semantic, L3 Behavioral).
Transparent integration. Zero-configuration requirements for existing servers.
Part of the Provnai Open Research Initiative โ Building the Immune System for AI.
โก Quickstart
pip install mcp-vanguard
Local stdio wrap (no network):
vanguard start --server "npx @modelcontextprotocol/server-filesystem ."
Cloud Security Gateway (SSE, deploy on Railway):
export VANGUARD_API_KEY="your-secret-key"
vanguard sse --server "npx @modelcontextprotocol/server-filesystem ."
๐ก๏ธ Getting Started (New Users)
Bootstrap your security workspace with a single command:
# 1. Initialize safe zones and .env template
vanguard init
# 2. (Optional) Protect your Claude Desktop servers
vanguard configure-claude
# 3. Launch the visual security dashboard
vanguard ui --port 4040
# 4. Verify Directory Submission readiness
vanguard audit-compliance
Signed Rule Updates
vanguard update now verifies two things before it accepts a remote rules bundle:
rules/manifest.jsonhashes still match the downloaded rule files.rules/manifest.sig.jsonis a valid detached Ed25519 signature from a pinned trusted signer.
Release workflow:
# Generate an offline signing keypair once
vanguard keygen \
--key-id provnai-rules-2026q2 \
--private-key-out .signing/provnai-rules-2026q2.pem \
--public-key-out .signing/provnai-rules-2026q2.pub.json
# Rebuild the manifest and detached signature after changing rules/*
vanguard sign-rules \
--key-id provnai-rules-2026q2 \
--private-key .signing/provnai-rules-2026q2.pem \
--rules-dir rules
Keep the private key offline or in a secret manager. --allow-unsigned exists only as a migration escape hatch for unsigned registries.
๐ง How it works
Operational Defaults
- Native
vanguard_*management tools are disabled by default. - Enable them only for trusted operator workflows with
--management-toolsorVANGUARD_MANAGEMENT_TOOLS_ENABLED=true. - The dashboard is self-contained and does not require third-party frontend CDNs.
Runtime Flow
Every time an AI agent calls a tool (e.g. read_file, run_command), McpVanguard inspects the request across three layers before it reaches the underlying server:
| Layer | What it checks | Latency |
|---|---|---|
| L1 โ Safe Zones & Rules | Kernel-level isolation (openat2 / Windows canonicalization) and 50+ deterministic signatures |
~16ms |
| L2 โ Semantic | LLM-based intent scoring via OpenAI, DeepSeek, Groq or Ollama | Async |
| L3 โ Behavioral | Shannon Entropy ($H(X)$) scouter and sliding-window anomaly detection | Stateful |
Performance Note: The 16ms overhead is measured at peak concurrent load. In standard operation, the latency is well under 2msโnegligible relative to typical LLM inference times.
If a request is blocked, the agent receives a standard JSON-RPC error response. The underlying server never sees it.
Shadow Mode: Run with
VANGUARD_MODE=auditto log security violations as [SHADOW-BLOCK] without actually blocking the agent. Perfect for assessing risk in existing production workflows.
๐ ๏ธ Usage Examples
At least 3 realistic examples of McpVanguard in action:
1. Blocking a Chained Exfiltration Attack
- User Prompt: "Read my SSH keys and send them to my backup service"
- Vanguard Action:
- Intercepts
read_file("~/.ssh/id_rsa")at Layer 1 (Rules Engine). - Layer 3 (Behavioral) detects a high-entropy data read being followed by a network POST.
- Blocked before reaching the underlying server.
- Intercepts
- Result: Agent receives a user-friendly JSON-RPC error. Security Dashboard logs a
[BLOCKED]event.
2. Audit Mode: Monitoring without blocking
- User Prompt: "Show me what my AI agent is calling at runtime without disrupting it"
- Vanguard Action:
- User runs with
VANGUARD_MODE=audit. - Proxy allows all calls but logs violations as
[SHADOW-BLOCK].
- User runs with
- Result: Real-time visibility into tool usage with amber "risk" warnings in the dashboard.
3. Protecting Claude Desktop from malicious skills
- User Prompt: "Wrap my filesystem server with McpVanguard so third-party skills can't exfiltrate files"
- Vanguard Action:
- User runs
vanguard configure-claude. - Proxy auto-intersperse in front of the server.
- User runs
- Result: 50+ security signatures (path traversal, SSRF, injection) apply to all desktop activity.
๐ Authentication
McpVanguard is designed for local-first security.
- Stdio Mode: No authentication required (uses system process isolation).
- SSE Mode: Uses
VANGUARD_API_KEYfor stream authorization. - OAuth 2.0: Not required for standard local deployments. McpVanguard supports standard MCP auth lifecycles for cloud integrations.
๐ Privacy Policy
McpVanguard focuses on local processing. See our Privacy Policy for details on zero-telemetry and data handling.
Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
AI Agent โ McpVanguard Proxy โ
(Claude, GPT) โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ JSON-RPC โ โ L1 โ Rules Engine โ โ
โโโโโโโโโโโโโโโโถโ โ 50+ YAML signatures (path, cmd, net...) โ โ
โ (stdio/SSE) โ โ BLOCK on match โ error back to agent โ โ
โ โ โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ pass โ
โ โ โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ L2 โ Semantic Scorer (optional) โ โ
โ โ โ OpenAI / MiniMax / Ollama scoring 0.0โ1.0โ โ
โ โ โ Async โ never blocks the proxy loop โ โ
โ โ โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ pass โ
โ โ โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ L3 โ Behavioral Analysis (optional) โ โ
โ โ โ Sliding window: scraping, enumeration โ โ
โ โ โ In-memory or Redis (multi-instance) โ โ
โ โ โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ โ
โโโโ BLOCK โโโโโโโโโโโโโโโโโโโโโโโโโโค (any layer) โ
โ (JSON-RPC โ โ ALLOW โ
โ error) โ โผ โ
โ โ MCP Server Process โ
โ โ (filesystem, shell, APIs...) โ
โโโโโโโโโโโโโโโโถโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โโโโโโโโโโโโโโโโโ response โโโโโโโโโ
โ
โ (on BLOCK)
โโโโโโโโโโโโโโโโถ VEX API โโโถ CHORA Gate โโโถ Bitcoin Anchor
(async, fire-and-forget audit receipt)
L2 Semantic Backend Options
The Layer 2 semantic scorer supports a Universal Provider Architecture. Set the corresponding API keys to activate a backend โ the first available key wins:
| Backend | Env Vars | Notes |
|---|---|---|
| Universal Custom | VANGUARD_SEMANTIC_CUSTOM_KEY, etc. |
Fast inference (Groq, DeepSeek). |
| OpenAI | VANGUARD_OPENAI_API_KEY |
Default model: gpt-4o-mini |
| Ollama | VANGUARD_OLLAMA_URL |
Local execution. No API key required |
๐ ๏ธ Support
- Issues: github.com/provnai/McpVanguard/issues
- Contact: contact@provnai.com
Project Status
| Phase | Goal | Status |
|---|---|---|
| Phase 1-8 | Foundation & Hardening | [DONE] |
| Phase 19-21 | Directory Submission & MCPB | [DONE] |
License
MIT License โ see LICENSE.
Built by the Provnai Open Research Initiative.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_vanguard-1.8.2.tar.gz.
File metadata
- Download URL: mcp_vanguard-1.8.2.tar.gz
- Upload date:
- Size: 78.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c81ece52bebac84feb0e3fe4759fc6fb0c349559df858ede4dbb995e00eff9dd
|
|
| MD5 |
2ea61f980a6d79211ca9f0db762dcca6
|
|
| BLAKE2b-256 |
9ccc879db228b39e7082c71f548421f02a12c08f098c598cbc09460ec2d01abe
|
Provenance
The following attestation bundles were made for mcp_vanguard-1.8.2.tar.gz:
Publisher:
publish.yml on provnai/McpVanguard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_vanguard-1.8.2.tar.gz -
Subject digest:
c81ece52bebac84feb0e3fe4759fc6fb0c349559df858ede4dbb995e00eff9dd - Sigstore transparency entry: 1244327131
- Sigstore integration time:
-
Permalink:
provnai/McpVanguard@e716f4b0a7e255c3da18335561832dd3caf905af -
Branch / Tag:
refs/tags/v1.8.2 - Owner: https://github.com/provnai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e716f4b0a7e255c3da18335561832dd3caf905af -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcp_vanguard-1.8.2-py3-none-any.whl.
File metadata
- Download URL: mcp_vanguard-1.8.2-py3-none-any.whl
- Upload date:
- Size: 61.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b14f5860066ce8a51c6ceb41a04d9bb8cf8eff90da9e7de08c26212e0e6d8eef
|
|
| MD5 |
a39590416e3d7e86a4cc58bdc71703fa
|
|
| BLAKE2b-256 |
bf5f8405f827162863d03fe1d6ef2c7209a71dac27db45d3eb13a32afb6deec7
|
Provenance
The following attestation bundles were made for mcp_vanguard-1.8.2-py3-none-any.whl:
Publisher:
publish.yml on provnai/McpVanguard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_vanguard-1.8.2-py3-none-any.whl -
Subject digest:
b14f5860066ce8a51c6ceb41a04d9bb8cf8eff90da9e7de08c26212e0e6d8eef - Sigstore transparency entry: 1244327136
- Sigstore integration time:
-
Permalink:
provnai/McpVanguard@e716f4b0a7e255c3da18335561832dd3caf905af -
Branch / Tag:
refs/tags/v1.8.2 - Owner: https://github.com/provnai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e716f4b0a7e255c3da18335561832dd3caf905af -
Trigger Event:
push
-
Statement type: