utm-mcp
README.md
<p align="center">
<img src="docs/icon.png" alt="utm-mcp icon: a smiling computer waving, with a second VM window behind it" width="128" height="128">
</p>
<h1 align="center">utm-mcp</h1>
<p align="center">
<strong>Let Claude Code drive your UTM virtual machines.</strong><br>
An MCP server for the Mac that drives <a href="https://mac.getutm.app">UTM</a>: make Windows and Linux VMs with no clicking, see and click their screens, run commands, move files, and try things in a sandbox you can roll back. One native binary; UTM is still the app you see.
</p>
<p align="center">
<img src="https://img.shields.io/badge/status-early%20development-C3C7F6?labelColor=232428" alt="Early development">
<img src="https://img.shields.io/badge/macOS-14%2B-F6E2A4?labelColor=232428" alt="macOS 14 or later">
<img src="https://img.shields.io/badge/Swift-6-F6C3B4?labelColor=232428" alt="Swift 6">
<img src="https://img.shields.io/badge/UTM-5.0.9%2B-C2E6D6?labelColor=232428" alt="UTM 5.0.9 or later">
<img src="https://img.shields.io/badge/MCP-stdio-DCD2F0?labelColor=232428" alt="MCP over stdio">
</p>
<p align="center">
<a href="#install">Install</a> ·
<a href="#what-you-can-ask">Examples</a> ·
<a href="#tools">Tools</a> ·
<a href="#safety">Safety</a> ·
<a href="#limits">Limits</a> ·
<a href="#privacy">Privacy</a> ·
<a href="#build-and-test">Build</a>
</p>
---
## Install
You need macOS 14 or later and [UTM](https://mac.getutm.app) 5.0.9 or later. With [Homebrew](https://brew.sh):
```bash
brew tap RossNicholson/tap
brew trust --formula rossnicholson/tap/utm-mcp
brew install rossnicholson/tap/utm-mcp
claude mcp add --scope user utm -- "$(brew --prefix)/bin/utm-mcp"
```
New Claude Code sessions pick it up. The first time, macOS asks whether your terminal may control UTM: say yes (or turn it on later in **System Settings → Privacy & Security → Automation**). Any other MCP app (Claude Desktop, Cursor, VS Code) can point at the same binary. Changes are in [CHANGELOG.md](CHANGELOG.md).
**Claude Desktop:** download `utm-mcp-<version>.mcpb` from the [latest release](https://github.com/RossNicholson/utm-mcp/releases/latest) and open it. Claude Desktop installs it, and its settings page has the main options below. It's also listed in the [MCP registry](https://registry.modelcontextprotocol.io) as `io.github.RossNicholson/utm-mcp`.
To build it yourself instead (Swift 6.1 or later): `git clone https://github.com/RossNicholson/utm-mcp.git && cd utm-mcp && make release`, then use `.build/release/utm-mcp`.
Options go after the binary (`utm-mcp --help` lists them). The first four can also be set as environment variables: `UTM_MCP_READ_ONLY=true`, `UTM_MCP_PROTECT="VM 1, VM 2"`, `UTM_MCP_HOST_DIR`, `UTM_MCP_MAX_WAIT`.
| Option | What it does |
|---|---|
| `--protect "VM"` | That VM (name or UUID) can be looked at, started, snapshotted and cloned, but gets no input, commands or changes. Repeatable. |
| `--read-only` | Only the tools that look, for every VM. |
| `--host-dir FOLDER` | Mac files are only read from and written to inside these folders. Repeatable. |
| `--max-wait 50` | Calls return within about 50 s, for apps that give up on a tool after a minute (Claude Desktop, Cursor). Long jobs then say how to carry on; ones that can't be split (big copies, full clones, diagnostics, sandboxes that restart the VM) can take longer. |
| `--vm "VM"` | Only that VM (name or UUID) can be seen or used, plus VMs this server makes. Repeatable. |
| `--allow-tools LIST`, `--deny-tools LIST` | Offer only these tools, or never these, e.g. `--deny-tools delete_vm,run_command`. |
| `--log FILE`, `--no-log` | Where the activity log goes: one JSON line per tool call, without passwords, file contents or typed text. Default `~/Library/Logs/utm-mcp/activity.jsonl`. |
## What you can ask
> *"Make a Windows 11 VM called Test Box on my external drive from ~/Downloads/Win11_arm64.iso and tell me when it's ready."*
`create_vm` builds a setup disk with an answer file and UTM's guest tools, starts the VM and presses the boot key. Windows then installs by itself in 15–30 minutes: account `dev` with no password (unless you ask for one), your Mac's language, keyboard and time zone, every setup screen skipped. The ISO is [free from Microsoft](https://www.microsoft.com/software-download/windows11arm64) (*Windows 11 multi-edition ISO for Arm64*).
> *"Make me an Ubuntu VM called Build Box with git and build-essential."*
Ubuntu, Debian and Fedora VMs come from the official Arm64 cloud images, checked against their published checksums and cached. They're set up and running in under a minute, with your Mac's SSH keys and the guest agent.
> *"In a sandbox on my Windows VM, install this build of my app, check it starts, bring me its log, then roll back."*
> *"My game crashed in the VM. Find out why."*
## Tools
38 tools, each marked read-only or destructive so your AI app knows which to ask you about. VMs and snapshots can be given by name or UUID.
| Area | Tools |
|---|---|
| **VMs** | `list_vms`, `get_vm` (everything about one VM, including its IP addresses), `create_vm` (Windows 11 hands-off, Ubuntu, Debian, Fedora, any ISO), `clone_vm` (instant APFS clones), `configure_vm` (also network mode, isolation, port forwards, clipboard sharing, or `lockdown`), `set_iso`, `install_guest_tools`, `delete_vm` |
| **Power** | `start_vm` (or `disposable`, saving nothing), `stop_vm` (clean shutdown, force, kill or suspend), `wait_for_vm` (until started, stopped, the guest agent answers, or someone signs in) |
| **Snapshots** | `list_snapshots`, `create_snapshot`, `restore_snapshot`, `rename_snapshot`, `overwrite_snapshot`, `delete_snapshot`, and `start_sandbox` / `end_sandbox` to try anything and roll it back, copying logs out first (`lockdown` also cuts the VM off from the internet and your Mac) |
| **Screen** | `screenshot` (scaled so its pixels are the ones clicks use), `find_text` (reads the screen offline with Apple's Vision, and can wait for words to appear or go), `click` (at a point or on words), `type_text` (in the guest's keyboard layout), `press_keys`, `mouse` (hover, drag, scroll) |
| **Controls** | `find_elements` / `click_element`: find, click, press or fill Windows controls by name with UI Automation, including icons with no visible text |
| **Inside the guest** | `run_command` (PowerShell, cmd or sh; as SYSTEM or as the signed-in user; any amount of output), `check_command`, `read_guest_file`, `write_guest_file`, `launch_app` (opens a program on the user's desktop) |
| **Files** | `copy_to_guest` / `copy_from_guest` (files or whole folders), `share_folder` / `unshare_folder` (a Windows folder mounted on the Mac) |
| **Testing** | `install_app` (silent installs of .msi, .msix, Inno, NSIS and WiX installers, with what got installed and why a failure failed), `collect_diagnostics` (crashes, hangs, blue screens, dumps, event logs, dxdiag; the journal and core dumps on Linux) |
Commands and file tools need the guest agent: UTM's guest tools in Windows (`create_vm` installs them), `qemu-guest-agent` in Linux (cloud images have it).
## Safety
- **Private Mac files are never touched:** `~/.ssh`, keychains, credentials, `~/.config`, browser data, mail, messages and AI apps' settings are never read or written.
- **Nothing that runs code is written:** no hidden files in your home folder (`.zshrc`, `.gitconfig`…), nothing in `~/Library`, apps, Homebrew or system folders, and no `.git/hooks`, `.git/config`, `.claude`, `.vscode`, `.mcp.json`, `.envrc` or CI workflows anywhere.
- **Files from a guest** are checked where they finally land, so a guest's file names can't steer them, links in them are dropped, and they're quarantined like downloads.
- **Untrusted software** can run in a `lockdown` sandbox: no internet, no way to reach your Mac, no clipboard or folder sharing, all put back afterwards.
- **Everything done is logged** in `~/Library/Logs/utm-mcp/activity.jsonl`, readable only by you.
- **Claude can't change the options:** they're set where the server starts, and a mistyped one stops it starting instead of running unprotected.
These are guard rails, not a security boundary. Text on a VM's screen or in its files can try to talk an AI into things, so keep untrusted software in VMs you'd be happy to delete.
## Limits
- Tested on Apple silicon with Windows 11 ARM, Ubuntu 24.04 and 22.04, Debian 13 and Fedora 45, on UTM's QEMU backend.
- Apple Virtualization VMs (macOS guests) have no guest agent, so the tools that work inside a guest don't work there.
- Windows only: `mouse`, `find_elements`, `click_element`, `install_app`, `share_folder`, `launch_app`, `as_user`, pasting text, and the hands-off install.
- `type_text` presses keys for US and UK layouts; in Windows, other layouts and characters are pasted through the guest's clipboard.
- UTM can't snapshot a running VM with 3D graphics or an NVMe disk, so sandboxes on those VMs restart them (under a minute).
Why, and much more about how UTM behaves, is in [docs/NOTES.md](docs/NOTES.md).
## Privacy
utm-mcp has no analytics or account and makes no network requests, except for downloading Ubuntu, Debian or Fedora cloud images and their checksums when you ask for those VMs. Screen text is read on your Mac. The activity log stays on your Mac and leaves out passwords, file contents and typed text, but keeps commands and paths. Whatever a tool returns (screenshots, command output, file contents) goes to your AI app and its model provider, so don't ask for anything you wouldn't paste into the chat. Passwords you give `create_vm` sit in plain text on its setup disk until setup finishes; the default is no password.
## Build and test
```bash
make build # debug build
make test # unit tests with a fake UTM; never touches your VMs
make release # .build/release/utm-mcp
```
How it works, how to try a change on real VMs (`scripts/mcp-call.py`) and UTM's undocumented behaviour are in [docs/NOTES.md](docs/NOTES.md). MIT licence ([LICENSE](LICENSE)).
## Support
utm-mcp is made by [Ross Nicholson](https://rossnicholson.dev). For help, see the [support page](https://rossnicholson.dev/support) or email support@rossnicholson.dev.
If utm-mcp saves you time, you can [buy me a coffee](https://buymeacoffee.com/rossnicholson) ☕
[](https://buymeacoffee.com/rossnicholson)
---
## Credits
Built on the official [MCP Swift SDK](https://github.com/modelcontextprotocol/swift-sdk). Made by the developer of [BrewDock](https://github.com/RossNicholson/brewdock), [ClawdBar](https://github.com/RossNicholson/clawdbar), [Mop Up](https://github.com/RossNicholson/mop-up), [KeyBar](https://github.com/RossNicholson/keybar), [Repo Radar](https://github.com/RossNicholson/reporadar) and [MacPing](https://github.com/RossNicholson/macping).
utm-mcp isn't affiliated with or endorsed by UTM or Anthropic. Claude and Claude Code are Anthropic's trademarks.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues