MRTKCLAD: let your AI coding agent test your MRTK3 app in the Unity Editor
When I first saw the new Snap Lens Studio, which introduced what Snap calls “Closed Loop Application Development”, I knew something profound had changed. I had been using LLMs for quite some time as ever cleverer coding assistants, but this involved a lot of manual steps: explaining what the code did, running a test, explaining the results and how they deviated from what I wanted, rinse and repeat. Snap introduced something into XR development that allowed a coding assistant to see what the results were, act on that, correct the result and try again, until the result was what I wanted.
In 26 minutes, it converted one of my Unity apps to Lens Studio. From a single prompt.
Granted, it could borrow a lot of code from an app I had converted myself earlier, which had a similarly strict and simple architecture. And the UI was crap, but just by sending it screenshots of the Unity version, it iterated to nearly the exact same UI. That took another two afternoons of careful guidance. But still, it was clear this was a game changer.
Context
Like everything these days, Unity now has a CLI, very originally called the Unity CLI. Until fairly recently you had to install it manually; new versions of the Hub install it automatically. It includes an MCP server (unity mcp). If you install the package com.unity.pipeline, the MCP server can actually connect to the editor. This allows you to do a lot of things via the CLI that you would normally do via the Unity GUI. Except that you don’t, unless you are daft, because this is meant to be driven by a coding assistant. With this package, these assistants can, broadly speaking:
- Build the scene. Create, find, move, reparent and delete GameObjects; add components and set their fields; make prefabs and variants; work with materials, animation and Timeline.
- Manage assets and the project. Assets and folders, import settings, packages (add, remove, search), scenes, and every project-settings page (player, quality, physics, input, tags and layers, and more).
- Code. Create and attach scripts, recompile and check for errors, and run C# directly in the Editor with eval and script run (in memory, without a domain reload).
- Run and observe. Start, pause and stop Play mode; change time scale and frame rate; simulate keyboard and mouse; read the Console; take screenshots of the Game view, Scene view or any Editor window.
- Test and analyse. Run Unity Test Framework tests, record profiler sessions, take memory snapshots and run performance audits.
- Build and bake. Switch platforms, manage build profiles and run builds; bake lighting, NavMesh and occlusion.
- Extend. Packages can add their own commands.
The last one caught my eye. I had already been using the Unity CLI and Pipeline, and when I test apps for Aura, Quest, HoloLens (yes, still), MetaLense, all those Unity-driven devices, I still find myself doing the same tedious, UI-driven tests in the Editor over and over again. Couldn’t I reproduce that idea in Unity, kind of?
So my friend GitHub Copilot and I, using Claude Opus 5.5 and occasionally Fable 5.2, had a good and actually pretty long talk, and it turned out: yes, we can. And to prove it works, the project includes a script that shows it in action:

Introducing MRTKCLAD
In a nutshell: it lets an agent or a test script operate an MRTK3 app in the Unity Editor the way a person with a headset would, then check whether it worked.
What it is
- An Editor-only UPM package (com.localjoost.mrtkclad, on OpenUPM). Nothing from it ends up in a Player build.
- It adds 11
clad_*commands to Unity Pipeline. An agent reaches them as MCP tools viaunity mcp, and scripts or CI reach them viaunity command clad clad_[command]. - It works with MRTK3: the 3.x line and the 4.0 pre-releases. Without MRTK3 the package stays inactive and only logs which packages are missing.
What it can do
- Hands: show, move and rotate them, set hand shapes, pinch, poke a button, grab and drag, scale and rotate with two hands, set a slider, scroll a list, and aim with the far ray.
- Head and eyes: move the camera or headset, look at a target, aim eye gaze, and dwell-click.
- Voice: “say” a keyword that is already registered. It doesn’t test the microphone.
- Checks: wait until a condition is true, then assert it: clicks, toggled, selected, hovered, slider value, scroll position, pose and scale.
- Evidence: screenshots, plus a report per run that records which step failed and why.
What makes it different
- Real input, no tricks. Input goes in where a real device’s would, as simulated XR devices and real hand joints. It never fakes a button event or moves an object directly, so your scene’s own interaction rules decide what happens. A Poke only passes if the button fires exactly one real
OnClicked. - Reusable test sequences. Steps go into a JSON sequence that you can save and replay as a regression test, for example
Tests/Sequences/button-regression.json. Only a step that ends assucceededcounts as a pass, and every failure says why. - Safe around your project. A session temporarily takes over MRTK’s keyboard and mouse simulator and restores input and camera when it ends. It never saves scenes or changes project settings.
Getting started
clad_doctorchecks whether the project is set up correctly. Then callclad_start_sessionin Play mode, followed byclad_perform(one step) orclad_run/clad_run_file(a sequence).clad_end_sessionrestores everything.clad_inspectshows what can be interacted with.- The Interaction Demos sample includes four ready-made stations (buttons, hands, hand menu, gestures) with test sequences.
Scripting
It can be expensive (in tokens) to have a coding agent run testing sessions from scratch all by itself, especially repeated regression tests. I therefore usually tell it not to run the test itself, but to write a script that calls the Pipeline. Apart from the cost, this is also faster and, most importantly, repeatable. Unlike an LLM, a script is deterministic and always does the same thing. This project comes with a number of Python scripts that, for instance, show you the interactions (test_interactions.py) or test the whole implementation. The sample scripts are all Python, as Python runs on Windows, Linux and macOS, the platforms Unity runs on. Any other scripting language will work as well. I initially had some PowerShell scripts, but PowerShell isn’t installed by default on macOS and Linux, so it is not suitable for something that should work cross-platform.
These ship with the package (in Tools~, which Unity does not import):
mrtkclad_client.py: a small client that startsunity mcpand calls theclad_*tools from Python. The other scripts build on it. It’s a client, not a server.run_sequences.py: replays one or more JSON test sequences and prints each step as it passes, which makes it handy for regression tests and CI.test_mcp.py: checks that the MCP connection, tool discovery and a read-only call work. With--liveit also runs the button test in Play mode.test_interactions.py: 8 scenarios covering far ray, voice, dwell, one- and two-hand manipulation, tools and error cases.test_reliability.py: labels, waits, slider, scrolling, constraints, lifecycle and failure evidence.test_client_reliability.py: tests the client itself (protocol, project lookup, long jobs) and needs no Editor.clad_stage.py: the presentation layer for the live tests, with a card per test, focus on the props in use, and an optional slower pace so you can follow along.mcp.example.json(not a script): a sample MCP configuration for your agent.
Development only (scripts/ in the repo, not part of the package):
enter_play.py: recompiles, opens a scene and starts Play mode.sync_sample.py: copies the Interaction Demos sample into the package.test_all.py: runs every check on both development projects (MRTK 4 and MRTK 3.x).
In short
Pipeline lets an agent or a script operate the Editor, and MRTKCLAD lets it operate your mixed-reality app inside that Editor, so the agent (or you) can see whether a change still works, without a lot of mouse clicks or cumbersome simulated hand movements using the mouse and keyboard. It is a development and regression-testing tool. It works with the latest MRTK 3.x release and the (hopefully) upcoming MRTK 4.
Prerequisites
- Unity 6000.0 or later. Verified on 6000.0.49f1, with URP and the built-in render pipeline.
- MRTK3, installed yourself with the Mixed Reality Feature Tool or as Git/tarball packages. You need org.mixedrealitytoolkit.input, .uxcore and .spatialmanipulation, plus their dependencies (core, uxcomponents, standardassets, graphicstools). Either line works:
- 3.x (stable): input and uxcore 3.3.0+, spatialmanipulation 3.4.0+, with XR Interaction Toolkit 2.x.
- 4.0 pre-release: 4.0.0-pre.2 or later, with XR Interaction Toolkit 3.x.
- Without MRTK3, or with older versions, the package stays inactive and logs one warning.
- TextMeshPro Essential Resources imported (Window > TextMeshPro > Import TMP Essential Resources).
- An MRTK profile with the Synthetic Hands and Hands Aggregator subsystems, plus Windows keyword recognition for voice steps. MRTK’s default profile has all of these; assign it under Project Settings > MRTK3.
- The Unity CLI (
unity, 1.0.0 or later) on PATH, installed once per machine. Recent versions of Unity Hub install it; otherwise:- Windows:
irm https://unity.com/install.ps1 | iexorwinget install Unity.CLI - macOS/Linux:
curl -fsSL https://unity.com/install.sh | bashorbrew install --cask unity-cli
- Windows:
- Git on PATH, only for the Git URL install.
- openupm-cli (
npm install -g openupm-cli), only if you install from OpenUPM with theopenupm addcommand; editing manifest.json by hand doesn’t need it. - Python 3.10+ (optional), only for the included test and demo scripts. They use only the standard library.
You don’t need to install these yourself: com.unity.pipeline 1.0.1, Newtonsoft JSON and uGUI are package dependencies, so Package Manager adds them automatically.
Installing the package
From GitHub, via package manager
You can install it directly from GitHub using
Window > Package Manager > + > Install package from git URL:
https://github.com/LocalJoost/MRTKCLAD.git?path=/Packages/com.localjoost.mrtkclad
Directly editing the manifest.json
"com.localjoost.mrtkclad": "https://github.com/LocalJoost/MRTKCLAD.git?path=/Packages/com.localjoost.mrtkclad#v1.0.0"
This also lets you pin a version.
OpenUPM

The package can be added by running this in your project folder:
openupm add com.localjoost.mrtkclad
This adds both the OpenUPM scoped registry and the package to your manifest.json. No openupm-cli? Then add the following to your manifest.json yourself, merging it into what is already there rather than replacing it:
{
"scopedRegistries": [
{
"name": "package.openupm.com",
"url": "https://package.openupm.com",
"scopes": [ "com.localjoost" ]
}
],
"dependencies": {
"com.localjoost.mrtkclad": "1.0.0"
}
}
No code in the article?
Nope. This is not a simple sample; it is a complete Open Source project. It would make this a very long post explaining how it all works, and in any case, most of it was written by GitHub Copilot.
Conclusion
Although I had been using AI coding assistants for a year, it was actually Snap’s CLAD that flipped the switch for me. The assistant no longer just helps me write code as a sort of glorified search engine; it writes all of the code (or nearly all) and I review it, if necessary. And by adding these MCP capabilities, I also made a lot of cumbersome regression testing unnecessary. We developers have largely made ourselves redundant, so we might as well automate the last really tedious task, testing, and leave even less for humans to do. That is the way of the world. Instead of fighting it, I decided to embrace it. I hope it’s useful for all of you.
To show it’s practical application, I asked it to test all the functions of HoloATC.
MVP Profile
Try my app HoloATC!
HoloLens 2
Magic Leap 2
Meta Quest
Android phones
Snap Spectacles
MetaLense 2
Buy me a drink ;)
BlueSky
Mastodon
Discord: LocalJoost#3562