Getting Started with McpVanguard#
Installation#
McpVanguard requires Python 3.11 or later.
Bash
Verify the installation:
Bash
Configuration#
McpVanguard is configured via environment variables or a .env file in your working directory. There is no YAML config file.
Create a .env file:
Bash
Quickstart — Local Sidecar Mode#
Wrap any existing MCP stdio server:
Bash
What happens when it runs:
- Vanguard starts the upstream MCP server as a subprocess.
- All JSON-RPC traffic between the agent and the server passes through the proxy.
- Layer 1 (YAML rules) is always active.
- Layer 3 (behavioral analysis) is active by default.
- Blocked calls are written to
audit.log.
Quickstart — Hosted Gateway Mode#
Expose the proxy as an SSE endpoint:
Bash
Clients connect via SSE. Always set VANGUARD_API_KEY when binding to a public interface.
Verify It's Working#
Bash
This prints the loaded rule count and active configuration.