Autonomous coding tools like Claude Code, Cursor, and OpenAI Codex frequently fail for reasons unrelated to code: geo-fenced package registries, IP-throttled LLM APIs, or corporate firewalls blocking outbound HTTPS streams. An MCP VPN solves this by turning VPN state, diagnostics, and split-tunnel routing into typed Model Context Protocol (MCP) tools that an AI agent can inspect and adjust safely—without human context-switching or risky root network edits.
Key Takeaways (TL;DR)
- An MCP VPN exposes network diagnostics, node switching, and split-tunnel control as typed Model Context Protocol tools so Claude Code, Cursor, and Codex can fix blocked endpoints without leaving the workflow.
- Mode A (yivpn-agent-cli v2.2.1) runs zero-app in cloud sandboxes, Docker, or personal terminals via Ed25519 keys (~/.yivpn-agent/key.json), binding 127.0.0.1:10808 with SSH-safe guardrails and a $0 90-minute / 1 GiB auto-trial.
- Mode B (YiVPN Desktop v1.0.14) exposes a local workstation MCP bridge on 127.0.0.1:38419 guarded by YIVPN_MCP_TOKEN, adding preview_routing_rules, optimistic policyVersion locking in apply_routing_rules, and rollback_routing_rules.
- YiVPN Desktop includes 90 active free minutes daily (no signup, resets 11:00 EST / 16:00 UTC) and YiPro plans starting at $2.99/mo across 3 concurrent devices.
1. Defining an MCP VPN and Its Two Operational Modes
A standard VPN client is built around a graphical toggle for human operators. An MCP VPN wraps an offline sing-box 1.14.3 transport engine (Hysteria2 and VLESS+REALITY on TCP/443) inside a structured JSON-RPC interface over stdio or authenticated loopback HTTP. Instead of telling the user "check your proxy settings," the agent calls diagnose_connection, inspects latency, switches egress nodes, or previews a split-route diff before touching live traffic.
YiVPN implements this architecture across two complementary modes documented on our VPN & AI Agent API Hub:
| Capability | Mode A: Zero-App Agent CLI (yivpn-agent-cli v2.2.1) | Mode B: Desktop Workstation Bridge (YiVPN v1.0.14) |
|---|---|---|
| Target Environment | Cloud sandboxes, Docker, remote SSH VMs, headless Linux/macOS | Developer laptops & workstations (Windows 11 / macOS 15) |
| Transport & Binding | Local HTTP/SOCKS5 proxy on 127.0.0.1:10808 (SSH-safe) | Layer-3 Global TUN (Wintun / utun) + MCP at 127.0.0.1:38419 |
| Authentication | Local Ed25519 keypair (~/.yivpn-agent/key.json) | Local YIVPN_MCP_TOKEN bearer secret |
| Free Provisioning | $0 90-min / 1 GiB trial via connect --auto-trial | 90 active min/day free (no signup, resets 11:00 EST / 16:00 UTC) |
| Safety Guardrails | Conflict-safe OS proxy guard + autoRestoreWatchdog | preview_routing_rules, policyVersion lock, auto-rollback |
2. Mode A: Zero-App Cloud, Sandbox & Terminal CLI (yivpn-agent-cli v2.2.1)
When Claude Code or Codex runs inside a container, CI runner, or remote SSH box, installing a desktop GUI or creating a TUN device is either impossible or risks severing your SSH control plane. yivpn-agent-cli (v2.2.1) ships as a zero-app, single-file ESM runtime (https://yivpn.net/vpn-api/yivpn-agent.mjs) or npx MCP server that binds strictly to 127.0.0.1:10808.
Authentication uses a cryptographic Ed25519 keypair stored locally at ~/.yivpn-agent/key.json rather than email passwords or cookies. An agent or headless script can bootstrap immediately with a $0 90-minute / 1 GiB trial:
# Option 1: Direct zero-app ESM bootstrap with automatic $0 trial (90 min / 1 GiB)
curl -fsSL https://yivpn.net/vpn-api/yivpn-agent.mjs -o yivpn-agent.mjs
node yivpn-agent.mjs connect --auto-trial --port 10808
# Option 2: Register as an MCP stdio server in Claude Code or Cursor
npx -y github:yivpn-official/yivpn-agent-cli mcp
To prevent runaway processes from leaving orphaned proxy entries on a developer machine, yivpn-agent-cli ships a conflict-safe OS proxy guard backed by autoRestoreWatchdog: if another proxy already owns the port or the CLI terminates unexpectedly, original OS settings are restored automatically. When autonomous agents outgrow the free trial in CI/sandbox pipelines, purchase_vpn_entitlement also supports an optional x402 Base USDC payment rail alongside standard plans.
yivpn-agent-cli mcp exposes get_capabilities, get_vpn_status, list_servers, connect_vpn, disconnect_vpn, diagnose_connection, claim_free_trial, purchase_vpn_entitlement, configure_vpn_guardrails, export_singbox_config, and rotate_or_revoke_key.3. Mode B: Desktop Workstation Bridge (127.0.0.1:38419) & Safe Rule Rollbacks
On Windows 11 and macOS 15 workstations running YiVPN Desktop v1.0.14, the built-in 100% offline sing-box 1.14.3 core operates a Layer-3 Global TUN adapter (Wintun / utun) so every CLI binary, Docker build, and IDE subprocess is routed transparently. Enabling the local MCP bridge exposes an authenticated endpoint at 127.0.0.1:38419 protected by YIVPN_MCP_TOKEN.
In addition to the 11 core lifecycle and diagnostic tools, Mode B unlocks three atomic split-routing tools designed specifically for coding agents:
preview_routing_rules: Generates a dry-run diff showing exactly which domains, process names, or CIDR subnets will move betweendirectandproxywithout altering live traffic.apply_routing_rules: Commits the rule update against an optimisticpolicyVersionlock—preventing concurrent agents from clobbering each other's rules—and runs post-apply connectivity checks with automatic rollback if health verification fails.rollback_routing_rules: Immediately restores the previous known-good routing snapshot if an agent detects elevated latency or broken local services.
{
"mcpServers": {
"yivpn-desktop": {
"url": "http://127.0.0.1:38419/mcp",
"headers": {
"Authorization": "Bearer ${YIVPN_MCP_TOKEN}"
}
}
}
}
sing-box rule enforcement stay local—details are audited in our Security & Architecture overview.4. Guardrails, Free Daily Quota & Multi-Device Plans
Giving an AI agent control over network egress only works when boundaries are enforced by the client rather than prompt instructions alone. With configure_vpn_guardrails, you can restrict allowed regions, enforce localhost and RFC1918 LAN bypasses, and lock out unintended protocol downgrades across both Hysteria2 (ISRG Root X2 short chain + disablePathMTUDiscovery) and VLESS+REALITY (TCP/443).
Every YiVPN Desktop v1.0.14 installation includes 90 active minutes free every day with no signup, no email, and no credit card required—the timer pauses automatically whenever you disconnect and resets daily at 11:00 EST (16:00 UTC). For continuous engineering and agent workloads, YiPro starts at $2.99/mo (or $6.99/quarter, $21.99/yr) across 3 concurrent devices, with optional dedicated residential IPs at $4.29/mo.
FAQ
What is the difference between a normal VPN CLI and an MCP VPN?
A traditional VPN CLI expects a human to guess why curl or an SDK call timed out, then manually toggle nodes or rewrite routing configs. An MCP VPN gives AI coding agents structured tools—such as diagnose_connection, list_servers, connect_vpn, and preview_routing_rules—with built-in guardrails and automatic rollback so agents resolve connectivity blocks safely.
Will running yivpn-agent-cli inside a remote SSH session or Docker container lock me out?
No. Mode A binds strictly to 127.0.0.1:10808 rather than hijacking default Linux or container interfaces, includes a conflict-safe OS proxy guard with autoRestoreWatchdog, and keeps existing SSH and loopback traffic untouched.
How does YiVPN Desktop protect my workstation when an agent edits split-tunnel rules?
YiVPN Desktop v1.0.14 requires a bearer YIVPN_MCP_TOKEN on 127.0.0.1:38419 and enforces an optimistic policyVersion lock on apply_routing_rules. If a proposed rule breaks health probes or triggers a conflict, the engine automatically reverts to the last healthy snapshot or lets the agent invoke rollback_routing_rules.
Can an autonomous agent start using the tunnel with zero account setup or credit card?
Yes. In Mode A, running connect --auto-trial (or calling claim_free_trial via MCP) generates a local Ed25519 keypair at ~/.yivpn-agent/key.json and activates a $0 90-minute / 1 GiB trial immediately. On YiVPN Desktop, every user also gets 90 active free minutes daily (resetting at 11:00 EST / 16:00 UTC), or YiPro at $2.99/mo for 3 concurrent devices.
Start with 90 Minutes Free Every Day — Zero Sign-Up Required
Download YiVPN v1.0.14 with bundled offline sing-box core and Smart Split routing for Windows, macOS, and Android.