# Agents

An agent works on a trumly project the way a person does: it reads the design, changes nodes, and the rules check what it wrote. It does this through an MCP server over the same folder of files, so nothing is a copy and nothing drifts.

## What an agent reads

An agent should read the design before it changes anything, and read as little as it needs to:

1. `get_index` returns a Markdown map of the whole project. It opens with the project's overview, which says what the project is for and how it is written, then lists every node.
2. `get_node` opens one node, with its links in and out and the rule results for it.
3. `check` runs the rules and returns the findings, so the agent can see what is failing before and after a change.

Because the index is short and nodes are small, a long design does not have to be loaded into every session.

## What an agent writes

`put_node` creates or changes one node, and every write returns the findings, so the agent can fix what it broke straight away. The agent should read a node before it changes it, and pass back the revision it read, so a change never overwrites someone else's edit. The server's own guide, `read_guide`, lists the rest of its tools.

We never tell agents to commit for you. Changes land in the working copy, where you review them and commit them like your own work. In trumly cloud every change by an agent is listed on the Changes tab, with undo.

## Connecting an agent

- **Locally.** In an MCP client such as Claude Code, add a server whose command is `trumly-mcp`, with the project folder as its argument. It is read-only unless you add `--write`. The [quickstart](/docs/quickstart) has the steps.
- **In trumly cloud.** Open the project's Agents tab. You can also connect your AI while you set a project up: the [guided start](/docs/cloud#start-your-first-project) gives you a message to paste, and the AI asks you the setup questions. Or connect claude.ai as a custom connector, or make a token for Claude Code, Cursor or any tool that takes an Authorization header. Read only or read and write is your choice. The [cloud guide](/docs/cloud) has the steps.

## Why rules matter here

An agent fills gaps with sensible local choices, and a design that is only prose cannot tell it when a choice contradicts an earlier one. Rules can. A requirement with no criterion, a work package with no owner and a decision with only one option are all findings, whoever wrote them.
