---
title: "6. Build with an agent"
description: "Connect Claude Code, or any MCP client, to the runtime Tato Studio runs, then build on the motion streams together, watching each of the agent's edits land in Studio."
type: "docs-page"
url: "https://tatolab.com/docs/tutorial/agents"
site: "Tatolab"
section: "Tutorial"
---

# 6. Build with an agent

> Connect Claude Code, or any MCP client, to the runtime Tato Studio runs, then build on the motion streams together, watching each of the agent's edits land in Studio.

The runtime speaks MCP, the protocol AI agents use to call tools. Connect an agent to it and the agent works on the projects you have open in Studio: it reads the graph and the log as you did in [step 4](https://tatolab.com/docs/tutorial/look-inside), and it builds the way you did, placing nodes, wiring pins, setting values and writing code. Every edit it makes lands in Studio as it happens.

## Connect Claude Code

```sh
claude mcp add tatolab -- tatolab mcp
```

Run it once, with `--scope user` to have it in every folder, and start a new Claude Code session. Claude Code starts `tatolab mcp`, which reaches the runtime Studio is running through its local socket, and the runtime's tools appear in Claude Code's tool list. If your terminal can't find `tatolab`, open **Edit › Settings… › Command line** in Studio and press **Link tatolab**.

Other MCP clients use the same command. **Settings › Command line** shows the `.mcp.json` for clients configured with JSON, such as Cursor or Claude Desktop.

## Build together

Arrange motion-watcher's window so you can see the Stream graph, the Node visualizer and History, put your agent beside it, and try:

- *"What streams are running on this machine, and what does each one do?"* The agent lists the streams and reads each graph, and the descriptions you gave your nodes.
- *"Make the detector less sensitive."* The agent finds the detector and sets its `threshold`. Watch the value change in Properties.
- *"Blur the camera before the detector, and keep the blur subtle."* The agent places a `Blur` between the camera and the detector, rewires them, and sets the blur's amount. The card appears in the graph, wired, while the stream keeps playing.
- *"Write a node that counts how many times motion started in the last minute, and put it after the detector."* The agent creates a node file, writes the code, and places and wires the node. Open the file in the Code view to read what it wrote, and select the node to see its count.
- *"Were there any errors in the last few minutes?"* The agent reads the project's log.

Your node's descriptions pay off here: the agent learns what `MotionDetector` does from `Reports how much of the picture changed since the last frame.`, and what `threshold` means from its description.

## See what it did

Open **History**. The agent's edits are listed beside yours, under its name. Each author undoes only their own: **Edit › Undo** takes back your last edit, never the agent's, and the agent can undo its own when you ask. Keep editing while it works; your edits and its edits go to the same runtime, one at a time, each applied whole or refused whole.

## What the agent can and can't do

- **It works on this machine.** `tatolab mcp` reaches the runtime through a local socket that only your user account can open.
- **Its edits last.** They're saved with the project and recorded on its history, like yours.
- **It runs real code.** A node it writes runs in its own process, like yours. Read what it writes.
- **What it reads goes to its model provider.** Logs, graphs and files it reads go into its context. Decide for each project whether that's acceptable.

## Where to go next

- [A tour of Tato Studio](https://tatolab.com/docs/studio): everything the app does.
- [Build with an agent](https://tatolab.com/docs/studio/agents): more on working with an agent beside Studio.
- [Use your model](https://tatolab.com/docs/build/models): swap the frame differencing for a real detector, running on the GPU.
- [Share between streams](https://tatolab.com/docs/share/between-streams): every setting of the MoQ nodes, and sending video.
- [Deploy to a machine](https://tatolab.com/docs/run/deploy): run the watcher on a small Linux box by the door.
