Bring your own environment · MCP-native

A real Linux box for Cursor.

Background agents have to run somewhere. Make it a box you own — persistent, isolated, on your own infrastructure — driven over MCP or plain SSH. One box per agent, state that survives between sessions.

~ / give a Cursor agent its own box
# 1. create a box for the agent
$ containarium create cursor-agent-box

# 2a. drive it over SSH — Cursor opens it like any remote host
$ containarium ssh-config cursor-agent-box >> ~/.ssh/config

# 2b. …or over MCP, for typed shell + file tools
$ containarium mcp-url cursor-agent-box
→ add it to Cursor's MCP settings (.cursor/mcp.json)

Background agents

An agent working in the background is a machine you don't own.

Handing a task to a background agent means some environment, somewhere, is cloning your repo, installing your dependencies, and running your build. The question worth asking early is whose machine that is, and what happens to it between runs.

Your infrastructure, your rules

Self-host on a VM you control. Your base image, your network policy, your secrets — the agent's working copy of your codebase never leaves your network.

Warm between runs

A box persists. The toolchain stays installed and the caches stay warm, so the second task doesn't pay the first task's setup cost again.

Inspectable when it goes wrong

When an agent's run fails, SSH into the box and look. Debugging a black box from its transcript is guesswork; debugging a live filesystem isn't.

Why a box

Don't run parallel agents on your laptop.

Two agents on one machine share a package manager, a set of ports, and a toolchain. The failures that produces are intermittent, which is worse than loud.

Isolated from your machine

A bad install or a runaway command stays in the box — sandboxed from your host and from every other tenant.

One box per agent

Run several Cursor agents at once, a box each, routed by hostname. Nobody's npm install changes what anybody else compiles against.

Disposable

When a box reaches a state nobody can explain, delete it and get a new one. Cheap enough to be the first debugging step.

We run this ourselves — five agents, five boxes. How that works in practice.

Connecting

Two ways to drive the box.

Over SSH

Cursor is built on VS Code, so it does remote development over SSH out of the box. Append containarium ssh-config to your SSH config and open the box as a remote host — the editor and the agent both work inside it.

Over MCP

Each box runs an MCP server exposing shell and file operations. Register it in Cursor's MCP settings and the agent gets typed tools instead of scraping a terminal.

Not on Cursor? The same box drives Claude Code, Cline, OpenCode, or your own agent — it's MCP-native, so there's no client library to write.

FAQ

Common questions

What environment do Cursor background agents run in?

By default, one the vendor provisions. If you need that environment to be yours — your infrastructure, your base image, your network rules, your secrets — you have to supply it. A Containarium box is a persistent Linux container you own, reachable over SSH and drivable over MCP, that can serve as that environment.

How do I give Cursor its own sandbox?

Create a box, then either register its MCP server in Cursor's MCP settings for typed shell and file tools, or add the box to your SSH config and open it as a remote host. Either way the agent works in the box, not on your laptop.

Can Cursor use a remote environment over SSH?

Yes — Cursor is built on VS Code and supports remote development over SSH. A box gets a routable hostname through the sentinel, so it behaves like any other remote host in your config.

Does the environment persist between sessions?

Yes — a box is a long-lived LXC container or Kubernetes pod, so installed toolchains, warm caches, and working state survive until you delete it. Sandboxes that reset every invocation throw that away, which is most of why the second run is slow.

Can I self-host the environment?

Yes — the core is open source under Apache 2.0 and installs on a single Ubuntu VM, so the agent's code and data stay inside your network. A hosted option exists if you'd rather skip the ops.

Give your Cursor agents a real box.

Start free on the hosted cloud, or self-host the open source on your VM.