Security gateway and verification layer for the Model Context Protocol (MCP)
Project description
McpVanguard
Security gateway for MCP agents and tool servers.
McpVanguard sits between an AI agent and an MCP server, inspects tool traffic in real time, and enforces policy before sensitive calls reach the underlying tool. It can run locally in front of stdio servers or as a hosted gateway over SSE and Streamable HTTP.
Existing MCP servers do not need to be rewritten.
What It Does
McpVanguard is designed for teams that want a real enforcement boundary around MCP-based agent workflows.
- inspect MCP tool calls before execution
- block unsafe filesystem, command, and network patterns
- enforce auth, role, and scope requirements for sensitive tools
- inspect server metadata before it reaches downstream models
- track repeated suspicious behavior over time
- emit audit and telemetry signals for blocked, warned, and allowed traffic
Use Cases
- protect local desktop or developer-machine MCP servers without rewriting them
- add a hosted gateway in front of shared MCP servers
- test raw versus guarded behavior for risky tool workflows
- add policy enforcement to high-risk file, shell, and network-access tools
Quickstart
Install the package:
pip install mcp-vanguard
Wrap a local stdio MCP server:
vanguard start --server "npx @modelcontextprotocol/server-filesystem ."
Run as a hosted gateway:
export VANGUARD_API_KEY="your-secret-key"
vanguard sse --server "npx @modelcontextprotocol/server-filesystem ."
Deploy on Railway:
Getting Started
Bootstrap a local workspace:
# 1. Initialize safe zones and .env template
vanguard init
# 2. Optionally protect 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
How It Works
Every tool call is inspected before it reaches the upstream MCP server.
| Layer | Purpose | Notes |
|---|---|---|
| L1 - Rules | Deterministic blocking using signatures and safe boundaries | Fast path |
| L2 - Semantic | Optional intent scoring | Async |
| L3 - Behavioral | Session and sequence-aware anomaly checks | Stateful |
If a request is blocked, the agent receives a standard JSON-RPC error and the upstream server never sees the call.
Deployment Model
McpVanguard is best understood as a security gateway for MCP workflows.
- Local-first mode: wraps stdio MCP servers on a developer machine
- Gateway mode: exposes hardened SSE and Streamable HTTP endpoints for hosted or shared deployments
Typical path:
AI Agent -> McpVanguard -> MCP Server -> Tools / Files / External Systems
Current Capabilities
- hardened SSE and Streamable HTTP transport paths
- metadata poisoning inspection on
initializeandtools/list - JWT, JWKS, issuer, audience, claim, and scope checks for bearer-auth deployments
- server integrity and capability drift verification
- cross-server isolation and
server_idtraceability - signed-manifest, provenance, detached signature, and Sigstore-backed trust verification
- benchmark and taxonomy tooling for measurable coverage
Authentication
McpVanguard is local-first, but it also supports stronger hosted-gateway controls.
- stdio mode: no network auth required
- SSE / Streamable HTTP mode: supports
VANGUARD_API_KEY - Bearer / JWT mode: supports verified JWT/JWKS validation, issuer/audience/claim/scope checks, and auth-aware policy on the hosted gateway path
Semantic Backend Options
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 |
Integrity and Trust
McpVanguard includes:
- signed upstream server manifests
- capability baselines and drift checks
- provenance verification hooks
- detached artifact-signature verification
- Sigstore bundle verification with identity and issuer constraints
This should be described as server integrity, baseline verification, and trust verification, not as a full SBOM platform.
Project Status
2.0.0is the current release line- the core gateway and integrity features are the main shipped scope
- broader research and future control-plane work are intentionally outside the core release promise
See CHANGELOG.md for the release history and docs/DEPLOYMENT.md for deployment details.
Privacy
McpVanguard focuses on local inspection and gateway enforcement. See PRIVACY.md for current privacy and data-handling details.
Support
- Issues: github.com/provnai/McpVanguard/issues
- Contact: contact@provnai.com
- Security: see SECURITY.md
License
MIT License - see LICENSE.
Built by Provnai.
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-2.0.0.tar.gz.
File metadata
- Download URL: mcp_vanguard-2.0.0.tar.gz
- Upload date:
- Size: 670.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96937a5f7f16fe2c60690c4c555a1f7d9d475455cefabd7356e7cbc8f1d6bee9
|
|
| MD5 |
216717a0417929544ebba89259dbd31a
|
|
| BLAKE2b-256 |
830335481fd5c55a9ebe00210614e28e861b8e075dd10bb332c0416fab552ed9
|
Provenance
The following attestation bundles were made for mcp_vanguard-2.0.0.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-2.0.0.tar.gz -
Subject digest:
96937a5f7f16fe2c60690c4c555a1f7d9d475455cefabd7356e7cbc8f1d6bee9 - Sigstore transparency entry: 1616269170
- Sigstore integration time:
-
Permalink:
provnai/McpVanguard@8c1ccb97e942fb7f7e6c71e05583f454e2e36289 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/provnai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8c1ccb97e942fb7f7e6c71e05583f454e2e36289 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcp_vanguard-2.0.0-py3-none-any.whl.
File metadata
- Download URL: mcp_vanguard-2.0.0-py3-none-any.whl
- Upload date:
- Size: 635.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc9992a020e9c926d8107a9956878866422a515db7f1cded34f657ff25c80613
|
|
| MD5 |
56181833c3b4b5a3027841f863feb2eb
|
|
| BLAKE2b-256 |
0a70db567ae0f36cc64e98febdbfd6002629e6fa5568866eff3d61b9b67f8703
|
Provenance
The following attestation bundles were made for mcp_vanguard-2.0.0-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-2.0.0-py3-none-any.whl -
Subject digest:
fc9992a020e9c926d8107a9956878866422a515db7f1cded34f657ff25c80613 - Sigstore transparency entry: 1616269177
- Sigstore integration time:
-
Permalink:
provnai/McpVanguard@8c1ccb97e942fb7f7e6c71e05583f454e2e36289 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/provnai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8c1ccb97e942fb7f7e6c71e05583f454e2e36289 -
Trigger Event:
push
-
Statement type: