Skip to main content

mcp Command

The mcp command starts a server that speaks the Model Context Protocol (MCP). An AI assistant (Claude Code, Claude Desktop, Cursor, or any other MCP client) starts the command and calls its tools. For the other direction, a workflow action that calls a tool of an MCP server, see MCP Servers. With these tools, the assistant can validate, run, retry and check a workflow, and read the result.

bash
BASH
agac mcp [options]

You do not start the command by hand. The assistant starts it and speaks to it on standard input and standard output.

When to Use It​

The skills teach an assistant how Agent Actions works. The MCP server gives an assistant tools to act on one project. Use the server in these situations:

SituationWhat to use
The assistant has no shell, for example Claude Desktop or a chat clientThe MCP server. It is the only way for the assistant to run agac.
The assistant must test workflows but never spend moneyThe MCP server, without --allow-real-runs. The server refuses a real run, so the limit does not depend on the prompt.
A person who does not know agac asks about a run, for example "why did these records fail?"The MCP server. The read tools return JSON that the assistant can explain.
A coding assistant with a shell (Claude Code, Codex) builds or changes a workflowThe skills, and agac in the shell. Add the MCP server if you want the sandbox-only limit.
You write or change workflow filesA coding assistant with the skills. The server has no tool that writes a file.
You run a script of a skill, for example run_health.pyA shell. The server runs agac commands only. Through the server, use dispositions and records to check the output counts.

The skills and the server work well together. The skills tell the assistant what to build and what to check. The server runs the checks safely. A client that has no installed skills can read the skill guides as resources.

Safety​

The server is safe by default:

  • Each run and each retry is a sandbox run. A sandbox run calls no model, needs no API key, and keeps its output apart from real output.
  • The server refuses a real run, a real retry and an export. To permit them, start the server with --allow-real-runs.
  • The assistant can always read the output of real runs. A read changes nothing.
  • The resources never include .env or stored data.
  • A scenario file or an expectations file must be a sandbox*.yml file of the project, outside agent_io. The server refuses other paths, because the command shows the line where a YAML file fails. user_code must be a folder of the project.
  • A real run does not wait for a batch by default. It returns exit code 4 while a batch is open, and the assistant calls run_workflow again. A sandbox run waits.
  • A resource is never a symbolic link.

Options​

OptionDescription
--project DIRECTORYThe project to serve. The default is the project that holds the current directory.
--allow-real-runsLet the assistant make real runs, real retries and exports. A real run calls models and costs money.
--timeout SECONDSThe longest time that one tool call can take. The default is 1800.

If the directory is not in a project, the command stops and prints No Agent Actions project at or above <directory>.

Connect an Assistant​

Claude Code, from the project root:

bash
BASH
claude mcp add agac -- agac mcp

Claude Desktop, Cursor and other clients read a JSON configuration file. Add this entry:

json
JSON
{
"mcpServers": {
"agac": {
"command": "agac",
"args": ["mcp", "--project", "/path/to/your/project"]
}
}
}

If agac is installed in a virtual environment, give the full path of the command, for example /path/to/your/project/.venv/bin/agac.

To permit real runs, add --allow-real-runs to the arguments.

Tools​

Each tool runs one agac command in the project. The assistant gets the output of the command and its exit code.

ToolCommandWhat it does
list_workflows—List the workflows of the project
inspect_workflowinspectValidate a workflow and list its actions. With action, show one action as the run sees it: guard, retry, the fields it reads and writes, its prompt and schema. With view: "context", show the variables that its prompt can use. It runs nothing.
run_workflowrunRun or resume a workflow. rerun with where or records answers some records again. dry_run shows the count first.
retry_workflowretryRetry the failed or exhausted records
sandbox_checksandbox checkRun the workflow in the sandbox and compare the result with the expected outcomes
workflow_statusstatusThe status of each action and of the last run
dispositionsdispositionsWhat happened to each record at each action. With record, follow one record through the workflow and see the guard that stopped it
recordsrecordsThe records that an action stored, or the input of each failed record. offset pages through them
tracestracesThe prompt, the context and the response of each record of an action
usageusageThe model calls and the tokens that each action used
expect_reportexpect reportThe verdicts that the expect: rules stored
workflow_schemaschemaThe input and output fields of each action
export_outputsexportWrite the declared outputs: to their database tables again. It needs --allow-real-runs.

Each tool tells the client what it can do, with the MCP hints readOnlyHint, destructiveHint, idempotentHint and openWorldHint. The read tools are read-only, so a client can approve them without a prompt. run_workflow, sandbox_check and export_outputs can replace output that is stored.

The tools that take sandbox have it set to true by default. To read the output of real runs, the assistant sets sandbox to false.

records returns the first 20 records, and traces returns the last 20 (the newest). The limit argument changes the number. The server cuts an output that is longer than 60,000 characters, and tells the assistant that it did so.

Tool calls run at the same time as other requests: while a long run continues, the server still answers a ping or a read. At most 4 tool calls run at the same time. If the client cancels a call (notifications/cancelled), the server stops the agac command of the call, as Ctrl-C would, and sends no reply for it. A stopped run keeps what it stored, so the next run_workflow continues it. When the client closes the connection, the server stops each call that still runs.

A run that ends with exit code 3 (some records failed) or 4 (paused for a batch) is a result, not an error. The assistant reads the code and continues: retry_workflow after 3, run_workflow again after 4. See Exit Codes.

Resources​

The assistant can also read two groups of files:

URIFiles
agac://project/...The files that define the workflows: agent_actions.yml, the workflow configurations, prompts, schemas, tools, branches, templates and sandbox scenarios
agac://skills/...The bundled guides that the skills command installs: how to write a workflow, context scope, guards, expectations, operations and sandbox tests

Example Session​

A usual session of an assistant:

  1. list_workflows, then inspect_workflow to validate.
  2. run_workflow in the sandbox.
  3. dispositions and records to read the result.
  4. run_workflow with scenario: "chaos" to test the failure paths, then retry_workflow.
  5. sandbox_check to assert the full result.

See Also​