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.
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:
| Situation | What to use |
|---|---|
| The assistant has no shell, for example Claude Desktop or a chat client | The MCP server. It is the only way for the assistant to run agac. |
| The assistant must test workflows but never spend money | The 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 workflow | The skills, and agac in the shell. Add the MCP server if you want the sandbox-only limit. |
| You write or change workflow files | A 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.py | A 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
.envor stored data. - A scenario file or an expectations file must be a
sandbox*.ymlfile of the project, outsideagent_io. The server refuses other paths, because the command shows the line where a YAML file fails.user_codemust 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_workflowagain. A sandbox run waits. - A resource is never a symbolic link.
Options
| Option | Description |
|---|---|
--project DIRECTORY | The project to serve. The default is the project that holds the current directory. |
--allow-real-runs | Let the assistant make real runs, real retries and exports. A real run calls models and costs money. |
--timeout SECONDS | The 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:
claude mcp add agac -- agac mcp
Claude Desktop, Cursor and other clients read a JSON configuration file. Add this entry:
{
"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.
| Tool | Command | What it does |
|---|---|---|
list_workflows | — | List the workflows of the project |
inspect_workflow | inspect | Validate 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_workflow | run | Run or resume a workflow. rerun with where or records answers some records again. dry_run shows the count first. |
retry_workflow | retry | Retry the failed or exhausted records |
sandbox_check | sandbox check | Run the workflow in the sandbox and compare the result with the expected outcomes |
workflow_status | status | The status of each action and of the last run |
dispositions | dispositions | What happened to each record at each action. With record, follow one record through the workflow and see the guard that stopped it |
records | records | The records that an action stored, or the input of each failed record. offset pages through them |
traces | traces | The prompt, the context and the response of each record of an action |
usage | usage | The model calls and the tokens that each action used |
expect_report | expect report | The verdicts that the expect: rules stored |
workflow_schema | schema | The input and output fields of each action |
export_outputs | export | Write 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:
| URI | Files |
|---|---|
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:
list_workflows, theninspect_workflowto validate.run_workflowin the sandbox.dispositionsandrecordsto read the result.run_workflowwithscenario: "chaos"to test the failure paths, thenretry_workflow.sandbox_checkto assert the full result.