Cursor · MCPAgent Integrations · 4 min read
Isolate Cursor AI Agent Commands Inside Local Linux MicroVMs
Prevent Cursor agent loops from corrupting host dependencies or reading ~/.ssh by routing every terminal command through sandbox-mcp and reviewing unified patches with sandbox_diff.
- MCP config
- .cursor/mcp.json or ~/.cursor/mcp.json
- Agent rule
- .cursor/rules/sandbox.mdc
- Warm attach
- 20–50 ms per task
Install Cursor MCP + always-on sandbox.mdc rule
./_out/bin/sandboxctl mcp install cursor --project ~/code/app
# Or install once globally across all repositories:
./_out/bin/sandboxctl mcp install cursor --globalKey Engineering Points · 11-Tool MCP Server & One-Command IDE Wiring
All 10 key points →- 1sandbox-mcp implements JSON-RPC 2.0 over stdio and bridges seamlessly into sandboxd over Unix domain sockets or loopback TCP.
- 2sandboxctl mcp install antigravity creates .agents/plugins/kagex/ (or ~/.gemini/config/plugins/kagex/ with --global) containing plugin.json, mcp_config.json, rules/AGENTS.md, and skills/sandbox/SKILL.md.
- 3sandboxctl mcp install cursor configures .cursor/mcp.json (or ~/.cursor/mcp.json) alongside always-applied .cursor/rules/sandbox.mdc.
- 4sandboxctl mcp install claude writes .claude/skills/sandbox/SKILL.md and registers the MCP server via claude mcp add with --scope project or --scope user.
- 5sandboxctl mcp install codex backs up ~/.codex/config.toml to config.toml.bak, appends [mcp_servers.sandbox] (30s startup, 900s tool timeout), and updates AGENTS.md.
- 6Eleven specialized tools cover full dev workflows: sandbox_exec, sandbox_read_file, sandbox_write_file, sandbox_diff, sandbox_apply, sandbox_pull, sandbox_snapshot, sandbox_network, sandbox_port, sandbox_status, and sandbox_destroy.
Always-Applied .mdc Rule Generation
Alongside registering the stdio server in mcp.json, Kagex generates .cursor/rules/sandbox.mdc instructing Composer to use sandbox_exec, sandbox_diff, and sandbox_apply instead of host shells.
Safe Host Lockfile Sync
Pass --auto-pull if you want updated package-lock.json or go.sum files mirrored back automatically with backup artifacts for instant sandboxctl undo.
Inspect this architecture live in 3D
Step through MCP ingress, Ghost Secrets, CoW blades, and run sandboxctl commands interactively in your browser.
Frequently Asked Questions
Open Cursor Settings -> MCP, ensure the sandbox server toggle is active, and monitor live calls in your terminal via sandboxctl events.
#Cursor MCP sandbox#Cursor AI microVM#.cursor/mcp.json sandbox#sandbox.mdc Cursor rules#safe Cursor Composer execution