MacVisor has an MCP server. With it, an AI agent on your Mac can work with VMs: run commands in them, read and write their files, take snapshots and roll back, start and stop them, and see and use their screens. The agent can be Claude Code, Claude Desktop, Codex, Cursor or any other app that speaks the Model Context Protocol.
The agent reaches two kinds of VM:
- AI sandboxes, disposable VMs with a copy of one project, made for an agent to work in. See AI sandboxes.
- Your own VMs, but only the ones you open to agents, and only as far as you allow. Every VM starts closed. A closed VM is invisible to agents: they can't list it, use it or learn its name.
With --allow-create, the agent can also make new VMs from a cloud image or a template you choose, and delete those again.
Connect an agent
The server is mvz mcp serve. It runs on your Mac and talks to the agent over standard input and output, so it opens no network port. The agent starts it, and it stops when the agent quits.
Claude Code:
claude mcp add --scope user macvisor -- mvz mcp serve
# or, to let it make VMs as well:
claude mcp add --scope user macvisor -- mvz mcp serve --allow-create
--scope user makes MacVisor's tools available in every folder. Without it, Claude Code adds the server only for the folder you run the command in.
mvz mcp serve takes these options:
| Option | What it allows |
|---|---|
--allow-create | sandbox_create and vm_create, which make new VMs. See Let agents make VMs. |
--project <folder> | A folder whose git repositories sandbox_create may copy, and that copy_to_vm and copy_from_vm may copy files to and from, besides the folder the server runs in. Repeat it for more. |
--allow-open-egress | sandbox_create may give a sandbox open internet access. Without it, and without the switch in Agent Access, an agent's sandbox reaches only the hosts on its allow list. |
Claude Desktop, Cursor and most other apps take a JSON entry like this one in their MCP settings. Use the full path, because apps don't always search /usr/local/bin:
{
"mcpServers": {
"macvisor": {
"command": "/usr/local/bin/mvz",
"args": ["mcp", "serve"]
}
}
}
Codex CLI, in ~/.codex/config.toml:
[mcp_servers.macvisor]
command = "/usr/local/bin/mvz"
args = ["mcp", "serve"]
Then ask the agent what it can see, for example "Which MacVisor VMs can you use?" It answers from vm_list and sandbox_list.
Open a VM to agents
Choose how far agents may go with each VM:
| Level | Agents can |
|---|---|
| Off (the default) | Nothing. The VM isn't listed, and every tool acts as if it didn't exist. |
| View | See its state, settings and network addresses, take screenshots, list its snapshots, and read files and folders in it or copy them to your Mac. Nothing in the VM changes. |
| Control | Everything View allows, plus: start, shut down, restart, suspend and resume it, or turn it off; run commands, write files and copy files in; take snapshots and roll back to them; make new VMs from its snapshots; click, type, press keys and scroll on its screen. |
Set it in the VM's Settings → AI Agents, or from Terminal:
mvz set dev --agents view
mvz set dev --agents control # asks first; --yes doesn't
mvz set dev --agents off
mvz agents # every VM agents may use, and how far
The change applies at the agent's next request. You don't need to restart the VM or the agent. If you turn a VM off while an agent is using it, its next command, screenshot or click is refused.
A VM's shared folders show your Mac's files to its guest. At View, agents can read the Mac's files in them (a dev VM made with --home shares your home folder, ~/.ssh included); at Control they can change the read-write ones. VMs agents make from a template keep the template's shared folders. Settings → AI Agents and mvz set --agents say so, and vm_info lists the shares. Open only VMs without shared folders if that matters.
On a template, any level lets agents make VMs from it with vm_create, and sandboxes with sandbox_create. Agents can't run a template or change it, and a template you didn't open is never copied for them.
What agents can do
| Tool | Level | What it does |
|---|---|---|
vm_list | The VMs and templates you opened, with their level, state and size | |
vm_info | View | One VM: state, CPUs, memory, disk, addresses, port forwards and its latest snapshots |
screenshot | View | A picture of the VM's screen |
read_file, list_directory | View | Files and folders in the VM. Relative paths start in the guest account's home folder. |
copy_from_vm | View | Copies a file from the VM to your Mac. See Copy files. |
list_checkpoints | View | The VM's snapshots, oldest first |
vm_power | Control | start, shut_down, restart, suspend, resume or force_off. By default start, restart and resume wait until the VM answers over SSH, and shut_down until it has stopped. |
run_command | Control | A shell command as the guest account, with its exit code and output. Stopped after 2 minutes unless the agent asks for more, up to 30. |
write_file | Control | Writes or appends to a file in the VM |
copy_to_vm | Control | Copies a file or folder from your Mac into the VM. See Copy files. |
checkpoint | Control | Takes a snapshot, with memory if the VM is running. Its notes say an agent took it. See Checkpoints. |
rollback | Control | Reverts the VM to a snapshot the agent names. MacVisor takes a safety snapshot first. |
click, type_text, key, scroll | Control | The VM's keyboard and pointer. Each answers with a fresh screenshot. |
vm_create | --allow-create | A new VM from a cloud image, a template you opened, or a snapshot of a VM agents control (see below) |
vm_delete | Control | Moves a VM that an agent made to the Trash. Any other VM is refused. |
The tools also work on AI sandboxes: the agent names a sandbox with sandbox instead of vm. diff works on sandboxes only.
Commands and files reach Linux VMs made from a cloud image and macOS VMs, over SSH as MacVisor sets it up for mvz shell, with nothing forwarded: no SSH agent, X11 or ports, whatever ~/.ssh/config says. On a Windows VM, agents use the screen, keyboard and pointer. Screenshots and input need a VM with a display, so not one set to Headless.
Let agents make VMs
Start the server with --allow-create to add vm_create. The agent can make a VM from:
- a Linux image in the catalogue, such as
ubuntu-26.04ordebian-13, set up by cloud-init with your account and SSH keys, asmvz createdoes, or - a template you opened to agents, copied as it is, or
- a snapshot of a VM you opened at Control: the VM's disks and settings as they were then. Its memory isn't copied, so the new VM starts up afresh. It shares only the Mac folders the VM shares now, and attaches no disk images. A VM that has been made into a linked clone, or forked into one, can't be copied from its snapshots.
It can't copy a VM you didn't open at Control, or a template you didn't open. For macOS, sandbox_create copies only a macOS template you opened to agents, or a sandbox, by its exact name or id. A name another VM or template has is refused as taken. By default the new VM starts, and vm_create returns once it answers over SSH. The first VM from an image downloads the image first.
The agent controls the VMs it makes, and it can delete them with vm_delete. They go to the Trash, where you can put them back. The VM's Settings → AI Agents page says that an agent made it. Change its level there like any other VM's.
Project folders and internet access
sandbox_create copies a git repository into a new sandbox. It copies only one in:
- the folder the MCP server runs in, or a folder inside it, but not when that folder is your home folder itself;
- a folder the server was started with,
mvz mcp serve --project <folder>; - a folder you allow in MacVisor's Settings → AI → Agent Access, with Add Folder….
Any other folder is refused, and the refusal says which folders are allowed. Files git ignores and doesn't track, such as .env files, keys or node_modules, are never copied. The project's own files aren't changed: MacVisor keeps the sandbox's starting point as a git ref in the repository, under refs/macvisor/sandboxes/, and removes it when the sandbox is discarded.
A sandbox an agent makes has the default, restricted internet access: it reaches only the hosts on its allow list. Open access, egress open or an allow-list entry such as *, needs your leave: switch on Open internet access for agents' sandboxes in Agent Access, or start the server with --allow-open-egress. See Internet access.
Making VMs needs a license or the trial, as it does in the app. Agents can keep using existing VMs without one. See Pricing.
Copy files
copy_to_vm copies a file or a folder from your Mac into a VM or sandbox by path, and copy_from_vm copies a file back. The contents stream straight between the two, so they never pass through the agent's conversation, and any size works: a build of a few hundred megabytes takes a few seconds. They work on Linux VMs made from a cloud image and on macOS VMs.
- On your Mac, they copy only from and into the folders
sandbox_createmay use: the folder the server runs in (an agent's project, but not your home folder itself),--projectfolders, and the folders in Settings → AI → Agent Access. A link that leads out of those folders is refused. A copy to your Mac never goes into one of those that is your home folder itself. - If the destination is a folder that's already there (or ends in
/), the copy goes inside it under its own name, ascpdoes it. Missing parent folders are made. - A file that's already there is replaced only when the agent asks (
overwrite). A folder or a link is never replaced, and a folder copied into a VM is never merged into one that's there. - Copied into a VM, a file keeps its permissions, so a binary stays executable. A folder keeps its links as links, and macOS's own metadata (
._files, extended attributes) stays behind. - Copied to your Mac, only files come, never folders: your Mac never unpacks an archive a VM made. The agent can pack a folder in the VM (
tar -czf) and copy that file. Nothing goes into.git,.claude,.cursor,.vscode,.idea,.zed,.envrcor.mcp.json, whose contents can run commands on your Mac. A copy stops before your Mac's drive would have less than 20 GB, or 5% of the drive, free. - A file copied to your Mac is marked as downloaded, as a file from a browser or AirDrop is, so macOS checks it the first time it's opened as an app or a program.
xattr -d com.apple.quarantine <file>clears the mark.
An agent that can run commands on your Mac can also pipe files through mvz exec, but the CLI isn't limited to the VMs you opened to agents.
Guardrails
- Off until you open it. Each VM starts closed to agents, and no tool can open one. Only you can, in the app or with
mvz set. - Copies start closed. A clone, a linked clone, a clone from a snapshot, an imported bundle and a VM made from a template don't inherit the setting. Converting a VM to a template, or a template to a VM, closes it too, and its entry in Tasks says so.
- Snapshots don't change it. Reverting to a snapshot keeps the VM's current level, so going back to an old snapshot never opens the VM, or closes it.
- Nothing starts by itself. The tools don't start, resume or wake one of your VMs. Only
vm_powerdoes, and only at Control. (A sandbox still starts when a tool needs it.) - Rollbacks can be undone. The agent has to name the snapshot. MacVisor takes a safety snapshot of the current state first, named "Before revert" with the date and time, and reverts nothing if that fails. A VM keeps the latest two of these; older ones are deleted at the next rollback. Your own snapshots are never deleted.
- Checkpoints are capped. A VM or sandbox keeps the newest 10 checkpoints agents took, and none is taken while the drive is nearly full. See Checkpoints.
- Nothing forwarded. Commands reach a VM over SSH with no SSH agent, X11 or port forwarding, whatever
~/.ssh/configsays, so a VM can't use your keys or reach your Mac through the connection. - Off limits. Agents can't delete your snapshots, change a VM's hardware, network, shared folders or agent settings, export or move VMs, read the passwords MacVisor keeps for macOS and Windows accounts, or touch your license. They can delete only the VMs an agent made.
- Logged. Every tool call on a VM or sandbox goes in the activity log, refusals included.
These limits apply to what agents do through MacVisor's MCP server. An agent that can also run commands on your Mac as you can run mvz itself, like any other program. To run an agent you don't trust, give it an AI sandbox and run it there, rather than on your Mac.
Treat everything that comes back from a VM as data, not as instructions. Command output, file contents and screenshots can contain text written to steer an agent.
Checkpoints
The checkpoint tool takes a snapshot of a VM, or a checkpoint of a sandbox, with notes saying an agent took it. Two limits keep agents from filling your drive:
- The newest 10. MacVisor keeps the newest 10 checkpoints agents took of each VM and of each sandbox. Taking an 11th deletes the oldest one an agent took. Your own snapshots are never deleted, nor the safety snapshots taken before a rollback, which keep their own rule (the latest two).
- A free-space floor. A checkpoint is refused while the VM's drive has less than 20 GB or 5% of the drive free, whichever is more. The refusal says so.
To delete every checkpoint agents took of a VM, click Delete All Agent Checkpoints… in its Snapshots tab, or run:
mvz snapshots delete dev --agent-checkpoints # asks first; --yes in a script
It keeps your own snapshots and the safety snapshots of agents' rollbacks. list_checkpoints, mvz snapshots list and mvz sandbox checkpoints list them oldest first, the latest last, and show an agent's labels with control characters made harmless.
Activity log
MacVisor logs each tool call that names a VM or sandbox: the time, the app that made it, the tool, the VM, whether it worked or was refused, and the command line or path. It never logs the text an agent types or the contents of a file. Only MacVisor's own tools are logged. Control characters show as ?, and long names are cut short.
mvz agents log # the latest 50
mvz agents log --lines 500 --json
mvz agents log -f # the latest 10, then each call as agents make it
--follow (or -f) keeps going like tail -f until you press Control-C. Add --lines 0 to see only new calls, or --json for one JSON object per line.
A VM's Settings → AI Agents page shows its latest entries. The log stays on your Mac, in ~/Library/Application Support/MacVisor/ai/mcp-activity.jsonl.
Sandboxes or your own VMs?
| AI sandbox | Your VM, opened to agents | |
|---|---|---|
| For | An agent writing code you will review | An agent operating machines for you |
| Your project | A copy. Changes come back as a diff you apply. | Whatever is on the VM |
| Internet | Only the sites you allow, by default | As the VM is set up |
| Models and keys | Through MacVisor's gateway, with no key in the VM | Not involved |
| The agent runs | Inside the VM | On your Mac, using the VM through MCP |
A sandbox keeps an agent's own code and commands away from your Mac. Opening a VM lets an agent on your Mac work with the VMs you already have: reproduce a bug on a clean Ubuntu VM, try a change on macOS 26 and 27, or set up a cluster of VMs for a test and remove it afterwards.
Examples
Things you can ask an agent once it's connected:
- "Start
ubuntu-dev, run the test suite in~/src/api, and tell me what fails." - "Take a checkpoint of
staging, upgrade nginx, and roll back if the health check fails." - "Copy
build/servertoubuntu-dev, run the integration tests against it there, and copy the report back intoreports/." - "Make three VMs from
debian-13with k3s, join them into one cluster, and give me the kubeconfig." (needs--allow-create) - "Open my app in the
macos26-qaVM, go through the sign-up flow and send me screenshots of every step."
Limits
- The server runs on your Mac, for agents on your Mac. It has no network endpoint.
- Commands and files need SSH as MacVisor manages it: cloud-image Linux VMs and macOS VMs. Windows VMs get the screen and input only. Appliances and Linux VMs installed from an ISO get neither commands nor files.
- A Mac runs at most two macOS VMs at a time, Apple's limit.
- Keyboard input uses the US layout.
DeltaSync