A community-driven registry for Claude, Cursor, Windsurf, Cline & more. Not affiliated with Anthropic.
Are you the author? Sign in to claim
Open-source security gateway for MCP agents and tools. Inspect tool calls before execution, enforce policy, block risky
Security gateway for MCP agents and tool servers.
McpVanguard sits between an AI agent and an MCP server, normalizes and inspects tool traffic in real time, and enforces a layered policy before sensitive calls reach the underlying tool. It runs locally in front of stdio servers or as a hosted gateway over SSE and Streamable HTTP.
Product profiles — monitor, balanced, strict — let you adopt incrementally: start with audit-only discovery, move to balanced enforcement, then enable strict hardening for production-sensitive systems.
Existing MCP servers do not need to be rewritten.
MCP workflows are powerful, but once tools touch files, shells, or networks, guardrails matter.
McpVanguard adds a runtime enforcement boundary so you can:
McpVanguard is for developers and platform teams who want explicit policy enforcement around MCP workflows.
Use one raw path and one guarded path against the same MCP server.
This gives you a fast signal that policy is active and enforcement behaves as expected.
Install the package:
pip install mcp-vanguard
Optional deployment extras:
# Multi-instance L3 behavioral state
pip install "mcp-vanguard[redis]"
# RE2-backed deterministic regex matching where the wheel is available
pip install "mcp-vanguard[re2]"
# Hosted/full deployment extras
pip install "mcp-vanguard[full]"
Wrap a local stdio MCP server:
# Balanced profile (default OSS/developer behavior)
vanguard start --profile balanced --server "npx @modelcontextprotocol/server-filesystem ."
# Strict profile (production hardening)
vanguard start --profile strict --server "npx @modelcontextprotocol/server-filesystem ."
Run as a hosted gateway:
export VANGUARD_API_KEY="your-secret-key"
vanguard sse --profile balanced --server "npx @modelcontextprotocol/server-filesystem ."
For public/non-loopback hosted deployments, strict profile refuses to start unless transport auth is configured with VANGUARD_API_KEY or OAuth/JWKS settings. balanced remains suitable for demos and staged rollouts, but will warn loudly when exposed without auth.
Hosted deployments can also enable opt-in per-session budgets for tool-call rate, risky decisions, and repeated blocked attempts. These act as circuit breakers around the layered policy path without changing defaults for local OSS use.
For private-network MCP servers reached through Anthropic MCP tunnels, the recommended placement is tunnel -> McpVanguard -> private MCP server. Tunnels reduce network exposure. McpVanguard enforces the execution boundary.
McpVanguard is also tracking the MCP 2026-07-28 release candidate. The 2.1.x line includes additive Mcp-Method / Mcp-Name consistency checks when those headers are present, plus explicit _meta inspection coverage. See docs/MCP_2026_07_28_RC_COMPATIBILITY.md.
Deploy on Railway:
Need a complete deployment walkthrough? See docs/DEPLOYMENT.md, docs/railway-deployment-guide.md, and docs/ANTHROPIC_MCP_TUNNELS.md.
Bootstrap a local workspace:
# 1. Initialize safe zones and .env template
vanguard init
# 2. Optionally update Claude Desktop server entries
vanguard configure-claude
# 3. Launch the local security dashboard
vanguard ui --port 4040
# 4. Run compliance and readiness checks
vanguard audit-compliance
McpVanguard uses five core inspection layers, L0 through L3 plus L1.5, with auth policy and a final policy composer around them. Every tool call is inspected before it reaches the upstream MCP server.
| Layer | Purpose | Notes |
|---|---|---|
| L0 - Preflight | Normalize and annotate (URL decode, NFKC, strip zero-width, size/depth gates) | Always on |
| Auth | OAuth scope enforcement and destructive-tool policy | Role-aware |
| L1 - Rules | Deterministic blocking using signatures, recursive argument inspection, and safe boundaries | Fast path |
| L1.5 - Camouflage | Detect trust-signal camouflage and scorer manipulation | Profile-sensitive |
| L2 - Semantic | Optional intent scoring (can escalate/block, cannot downgrade deterministic blocks) | Async |
| L3 - Behavioral | Session and sequence-aware anomaly checks | Stateful |
| Policy Composer | Final verdict: ALLOW / WARN / REVIEW / SHADOW-BLOCK / BLOCK | Explainable |
The five core inspection layers are L0, L1, L1.5, L2, and L3. Auth policy and the final policy composer sit around that core path.
If a request is blocked, the agent receives a standard JSON-RPC error and the upstream server never sees the call. The audit log records the primary reason and all supporting findings.
Safe zones are deterministic path-boundary checks, not a substitute for OS sandboxing or container isolation. They inspect standard and common custom path-like argument names recursively, but production deployments should still tune rules/safe_zones.yaml for the actual schemas and directories your MCP tools are allowed to touch. See docs/SAFE_ZONES.md.
For operator triage, JSON audit logs include SIEM-friendly decision fields and structured policy_explanation data with the primary layer, rule family, profile effect, upstream-call status, and tuning hint. See docs/BLOCK_DECISIONS.md.
McpVanguard is best understood as a security gateway for MCP workflows.
Typical path:
AI Agent -> McpVanguard -> MCP Server -> Tools / Files / External Systems
initialize and tools/listserver_id traceabilityreceipt_v1 JSONL emission for offline-verifiable runtime evidence with mcp-receipt after export/signingMcpVanguard includes packaged benchmark corpora for adversarial and benign MCP traffic. Use them to compare profiles before deployment:
vanguard benchmark-run --profile monitor
vanguard benchmark-run --profile balanced
vanguard benchmark-run --profile strict
vanguard benchmark-profiles
vanguard benchmark-baselines
The benchmark results are a release and tuning signal, not a promise of universal detection or zero false positives. See docs/BENCHMARKS.md for interpretation guidance and the recommended release gate.
For the public research note behind the layered design, see Why MCP Security Needs Layered Runtime Enforcement.
McpVanguard is local-first and supports stronger hosted-gateway controls when needed.
VANGUARD_API_KEYblock, and requires Origin when an allowlist is configuredNative vanguard_* management tools are disabled by default. If you enable them, also choose an explicit management-plane mode:
disabled: no native management tools are exposedsame_session_dev: local/dev only; read and mutating tools share the governed MCP session and startup prints a warningoperator_only: read-only tools may be visible, but mutating tools require an admin role or vanguard:admin / scope:admin scopeFor production, keep mutating management out of normal governed agent sessions unless the caller is an authenticated operator. Management actions are audited and denied/mutating attempts are risk-visible.
The optional Layer 2 semantic scorer supports multiple backends. The first configured backend wins.
| Backend | Env Vars | Notes |
|---|---|---|
| Universal Custom | VANGUARD_SEMANTIC_CUSTOM_KEY, related custom vars | Fast inference providers such as Groq or DeepSeek |
| OpenAI | VANGUARD_OPENAI_API_KEY | Default model: gpt-4o-mini |
| Ollama | VANGUARD_OLLAMA_URL | Local execution, no API key required |
For a more detailed local/offline setup guide, see docs/LOCAL_SEMANTIC_MODE.md.
McpVanguard includes:
This should be described as server integrity, baseline verification, and trust verification, not as a full SBOM platform.
2.1.x is the current runtime hardening patch line for layered enforcementL0 -> L1 -> L1.5 -> L2 -> L3 -> Policy Composer) is implemented and covered by local and CI verificationmonitor / balanced / strict) are the supported deployment modes for this release lineSee CHANGELOG.md for the release history and docs/DEPLOYMENT.md for deployment details.
McpVanguard focuses on local inspection and gateway enforcement. See PRIVACY.md for current privacy and data-handling details.
Does this replace my MCP server?
No. McpVanguard sits in front of your existing MCP server and enforces policy before calls reach it.
Do I need to rewrite tools or agent code?
Usually no. Most setups start by routing one workflow through McpVanguard.
Is this only for hosted setups?
No. It supports local-first stdio wrapping and hosted gateway modes.
MIT License - see LICENSE.
Built by Provnai.
MCP server integration for DaVinci Resolve Studio
mcp-language-server gives MCP enabled clients access semantic tools like get definition, references, rename, and diagnos
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots