Give agents your state

An agent that cannot see what you were trying to do will confidently redo work you already abandoned. mcue exposes the same validated read and write surface over MCP that the CLI uses — not a second, looser path into your state.

Run the local server

mcue serve --mcp

That speaks MCP over stdio, which is what most desktop clients expect. It runs entirely locally and makes no outbound request.

For clients that need HTTP instead of stdio, mcue serve also exposes an authenticated HTTP surface. Run mcue serve --help for the current flags — the address and transport options are the two you will care about.

Connect a client to the local server

Desktop clients launch the server themselves over stdio. Each one needs the same line: the command is mcue, the arguments are serve --mcp.

Claude Code.

claude mcp add mcue -- mcue serve --mcp

Claude Desktop, in claude_desktop_config.json, and Cursor, in ~/.cursor/mcp.json:

{
  "mcpServers": {
    "mcue": { "command": "mcue", "args": ["serve", "--mcp"] }
  }
}

Browser clients such as Claude.ai and ChatGPT cannot launch a process on your machine. They connect to the hosted endpoint instead; its address is the MCP: line mcue cloud status prints (https://api.mcue.ai/mcp for mcue.ai) — see Connecting a client to the hosted endpoint.

Authenticating an HTTP client

The HTTP surface is bearer-authenticated, and mcue manages those tokens for you:

mcue token issue          # issue a new bearer token
mcue token list           # ids, scopes, status — never the plaintext
mcue token rotate <id>    # revoke and reissue with the same scope
mcue token revoke <id>    # revoke by id

mcue token list deliberately never prints the plaintext token. If you lose one, rotate it rather than trying to recover it.

Teaching the agent the rules

Agents behave much better when the repository tells them how mcue is meant to be used. mcue emits that snippet for you:

mcue agents-snippet >> AGENTS.md

The same snippet works in CLAUDE.md or any equivalent instruction file. It describes the access rules — what the agent may read, when it should close out, and what it must not invent.

The snippet opens with a short procedure the agent must run before any project work: find the project, discover its lanes, select the lane by what you asked for now, read that lane's packet, and only then open the code. It also says that your current request decides the work — a recorded next action is context, not an instruction — and that local and hosted state are separate sources whose disagreement must stay visible.

Two habits make lane fit visible without a checklist. The agent says in one line which lane it is using when it selects or switches, so a wrong assumption surfaces before the work. And before proposing a closeout it compares the work with the lane's objective: it does not stretch the objective to fit, it routes the closeout to the lane the work belongs to, and a session that produced work for two streams gets two closeouts. To make that selection cheap, mcue review and mcue index --expand-lanes print each lane's objective.

Where the file goes, and how to check it loaded. Codex, Cursor, and Aider read AGENTS.md; Claude Code reads CLAUDE.md. Put the snippet in the file your client reads, at the root of the repository the agent starts in. A file at a workspace root is not loaded when the agent starts inside a child repository, so each repository that carries mcue state needs its own copy, or a one-line file that points at the root one. To verify, open a fresh chat and ask: "what is the first thing you do before project work here?" The answer should be the start-here procedure, given without a search. If the agent searches the repo to answer, the file is not being loaded.

An agent connected over MCP does not need the file. Since v0.14.0 the server sends the same contract as MCP server instructions during the handshake and serves it as the mcue://agents resource, so a client that has never seen mcue learns the vocabulary and the read-first, close-out-at-ship rules before its first tool call. The hosted endpoint carries the same instructions. Keep the repo file for agents that reach mcue through a shell rather than MCP tools, and for clients that ignore server instructions — mcue agents-snippet --mcp prints the MCP variant for those.

What the agent can do

The local server and the hosted endpoint expose the same tools:

ToolWhat it does
indexthe portfolio view across projects
reviewone project's lanes as JSON, with signals, plan and drift per lane
resumefetch a bounded resume packet for a lane
project_stateread current governed project state
checkpoint_latestread the most recent checkpoint
checkpoint_historylist checkpoint headers, newest first, without bodies
checkpoint_readread one checkpoint verbatim, superseded ones included
driftcheck whether the repository moved since the lane's checkpoints
cloud_statuswhich endpoint this installation connects to, its MCP address (mcp_url), and each project's sync state
closeoutwrite a checkpoint and advance state
initcreate a project with its state files
lane_createcreate a named lane
lane_closeretire a lane as done or abandoned
plan_createcreate the active plan for a lane
reconcileresolve a lane whose perspectives diverged
file_putstore a file on the hosted endpoint for a closeout to cite
file_readread a file a checkpoint cites

Reads are the common case. closeout is the one write that matters, and it goes through the same validation the CLI uses — an agent cannot write state the CLI would have rejected.

Full detail is in the MCP tools reference.

Hand a file to another agent

A closeout can carry a file — a prototype, a brief, a PDF — so the next agent reads the exact bytes rather than a summary of them. The file lives on the hosted endpoint and is identified by its SHA-256, so every client that can resume the lane reads the same copy. Hosted files are on Pro.

  1. Store it. file_put from a connected app, or mcue files put from a terminal. Text goes in verbatim; an image, a PDF or any other binary goes in with encoding: base64 and its real media type. The reply is the file's ref: hash, size, media type and name.
  2. Cite it. Pass the hash in the closeout's files argument, or use mcue closeout --attach <path> to store and cite in one step. A stored file that no checkpoint cites is not part of the handoff.
  3. Check the reply. A hash that is not stored, or one past the plan's per-checkpoint cap, is dropped from the checkpoint and named in the closeout reply. The closeout itself still succeeds, so read the reply rather than assuming.
  4. Read it back. The lane's resume packet lists cited files on its Files line. file_read returns the content, mcue files get writes the bytes and verifies the hash, and the lane page on mcue.ai links each one for download. Say you handed a file off only after one of these worked.

Hand off the exact file that was asked for. Notes about it go in a separately named file, not in its place.

When a file seems to be missing

Each failure points at a different step, so find which one before you report it:

What you seeWhere to look
file_put refusedThe refusal names the cause: the plan, a file over the inline limit (use mcue files put or --attach), or, on the local server, an unlinked project.
The file is stored but not on the laneIt was never cited, or the closeout reply dropped it. Close out again with its hash in files.
file_read answers not foundThe hash is cited only in lanes you cannot read, or the prefix is wrong.
file_read answers "re-publish from source"The lane was closed more than 30 days ago and the bytes were evicted.
One app shows an empty result, such as {}Read the same hash with mcue files get or from a second client before you call it a server fault. Apps differ in which part of a tool result they show.

An example: an agent in one chat app stored a prototype, cited it, and then read {} back from file_read. It concluded the file was lost, uploaded it again and opened a bug. The same hash read back with a matching checksum from the CLI, from a second client and from the lane page. Nothing was lost: one app was showing only part of the tool result. One extra readback from another client would have settled it.

Provenance

Every write records which actor and which substrate produced it. When you later read a checkpoint, you can tell whether you wrote it or an agent did, and through which client. That is what makes it safe to let an agent close out at all: the record stays attributable.

mcue audit

reads the local audit log.

Local server or hosted endpoint

The local server needs your machine to be on. If you want an agent to keep working against accepted state while your laptop is shut, that is what the persistent hosted endpoint is for — see Publish to mcue.ai.

The tools above are the same in both cases, so moving from one to the other does not change how the agent is configured beyond the endpoint and its credentials. The MCP tools reference lists the few places the two behave differently.

The CLI tells you the hosted address once it points at mcue.ai. mcue cloud status prints it on its MCP: line, under the endpoint lines (v0.29.1 and later), and the cloud_status tool returns the same value as mcp_url — so an agent already connected to the local server can find the hosted endpoint without you looking it up:

$ mcue cloud status
Cloud endpoint: https://api.mcue.ai
Web: https://mcue.ai
MCP: https://api.mcue.ai/mcp
Session: credential stored in OS credential store
payments-api: cursor 12, pending 0

The agents snippet says the same thing to agents reading the rules from a file: the hosted endpoint serves the same state over MCP, at the address mcue cloud status prints.

A release can add a tool. Clients take a server's tool list when a conversation starts and keep it for that conversation, so a tool added by a deploy of the hosted service shows up in the next conversation, not the one already open — refresh the connector if your client caches the list across conversations. To see which contract an endpoint serves, read its server version in the initialize handshake or the hubcore field of GET /readyz; both carry the mcue release it was built against.

A caution worth stating

An agent with write access can close out on your behalf. That is useful and it is also a way to fill your history with plausible, generic checkpoints that say nothing. Keep agent closeouts for genuine session boundaries, and read them occasionally to check they are worth keeping.