Agents and MCP
Everything goofi can do is one op vocabulary, and an agent speaks it the way you do: through the CLI, or through the MCP server. An agent can also run inside goofi, in a panel beside the canvas.
The CLI, first
The best way for an agent to drive goofi is the CLI. With a server
up, goofi <op phrase> sends one op to it and prints the reply, and there
are no CLI-only verbs: the 73 ops are the whole language, the same one the editor
speaks. An agent that can run a shell command needs nothing else.
goofi op list # every op, with its arguments
goofi node add signal:Psd --json # one op, the reply as JSON
goofi node list --json | jq '.[] | .id' # the reply is a value, not a screen
goofi - < ops.txt # a batch from stdin: ONE undo stepTwo things make the CLI the better transport. It is token efficient: a
command line is a few words, and --json makes the reply a value the agent can
pipe, filter and count with the tools it already has instead of reading a screen. And a
reply is a command result, not a message: it composes with jq, grep and a loop inline, so a plan of several steps runs as one line where an
MCP round trip would take several. goofi op list answers every op with its
arguments, and goofi <op> --help explains one, so the agent discovers the
vocabulary the same way you do.
The MCP server
goofi also serves an MCP endpoint at /mcp, for a harness that cannot run a shell or that you would rather
keep to MCP. It has one tool, goofi_exec, whose input is a list of
command lines: the same lines the CLI takes, parsed by the same layer, so the two cannot
drift. Several lines in one call run as one batch and one undo step. The transport is
stateless: one JSON object per POST, with no session and no SSE.
{
"mcpServers": {
"goofi": { "url": "http://127.0.0.1:8000/mcp" }
}
}Prefer the CLI where you can. The MCP tool's reply comes back to the model in full, where the
CLI lets the agent trim it before it costs a token. The endpoint is not mounted in --demo mode.
Agents inside goofi
The Agent panel launches a coding harness in goofi itself. It comes up on a
terminal with the patch's workspace as its working directory. claude, codex and opencode are offered out of the box.
You watch the patch build itself and continue patching while the agent is busy. The agent's work lands on the same undo stack as yours.
The list is the [[agents]] table of ~/.goofi/config.toml, seeded
with the three defaults on first start. Any command line you name there becomes a choice in the
panel; the command runs through bash, so flags and environment are yours to set.
# ~/.goofi/config.toml
[[agents]]
name = "claude"
command = "claude"
[[agents]]
name = "codex"
command = "codex"
[[agents]]
name = "opencode"
command = "opencode"
[[agents]]
name = "my-agent"
command = "my-agent --some-flag"