Local agent control

MCP and CLI guide for Auto Flow Agent Mode

Use this when Claude, Codex, or another local agent needs to inspect an Auto Flow run, target the right Flow project, reconcile outputs, retry rows, download verified media, or continue a run that is waiting on a visible credit dialog.

Install the beta package

The NPM package gives you two local binaries: autoflow for terminal workflows and autoflow-mcp for MCP clients.

npm install -g @autoflow-mcp/autoflow@beta
autoflow --help
autoflow-mcp --version
Important Auto Flow MCP and CLI do not replace the Chrome extension or Google Flow. They connect to your local extension bridge and the Flow project already open in your browser.

What this adds

MCP tools for agents

Claude, Codex, and other MCP clients can call structured Auto Flow tools instead of guessing shell commands.

CLI for any project folder

Use autoflow from a content repo, video project, or random terminal and still target the same browser lane.

Reconcile and download

Map Flow outputs back to row IDs, plan filenames, reject bad HTML/tiny files, and download verified images or MP4s.

Guarded live actions

Submits, retries, downloads, and credit confirmations require explicit targeting so agents do not hit the wrong tab.

Setup checklist

  1. Install the Auto Flow Chrome extension and sign in.
  2. Open the Google Flow project you want to control in the same Chrome profile.
  3. Install the NPM package globally with @beta.
  4. Install the native host for the extension ID mounted in that Chrome profile.
  5. Pair the CLI or MCP client with Auto Flow.
  6. Run read-only status before any live submit, retry, download, or credit confirmation.
autoflow native install-host --extension-id <extension-id> --doctor
autoflow native install-host --extension-id <extension-id>
autoflow pair
autoflow status --json

If the browser, extension, or native host restarts, pairing can reset. Run autoflow pair again.

MCP config

Add the server to your MCP client config, then ask the agent to start read-only.

{
  "mcpServers": {
    "autoflow": {
      "command": "autoflow-mcp",
      "args": []
    }
  }
}
Use Auto Flow MCP. First call autoflow_status, then autoflow_reconcile_project.
Before live submit, ask me for image model, video model, outputs per row,
image/video aspect ratios, video length, Return silent videos on/off, and exact
credit approval. Do not submit, retry, or spend credits unless I approve it.

Claude skill

The package ships a Claude skill so user Claudes can learn the Auto Flow operating contract instead of improvising commands.

CLAUDE_SKILL_SRC="$(npm root -g)/@autoflow-mcp/autoflow/claude-skills/autoflow-agent"
mkdir -p ~/.claude/skills
rm -rf ~/.claude/skills/autoflow-agent
cp -R "$CLAUDE_SKILL_SRC" ~/.claude/skills/autoflow-agent

For project-local usage, copy the same folder into .claude/skills/autoflow-agent.

Use the autoflow-agent skill. Start read-only with status and lane inventory.
Build the prompt matrix, dry-run the Agent Mode submit, and ask me for model,
outputs, ratios, silent-video setting, and credit approval before any live submit
or credit confirmation.

Required preflight before live generation

Agents should ask these questions before they run anything that can spend credits or submit work.

Mode and model Image model, video model, target mode, and whether the run is create image, text-to-video, frame-to-video, or ingredients-to-video.
Outputs and ratios Image outputs, video outputs per row up to 4, image ratio, video ratio, and video length.
Silent video setting For video runs, confirm Flow settings have Return silent videos enabled before submit.
Credit approval Confirm the exact credit-spending action. If a credit dialog is already visible, use confirm-credits instead of re-running the row.

Reference images

For reference-driven rows, attach real image assets through the Flow Agent plus button and click Add to Prompt. Typed filenames, media IDs, or handles alone are not enough for Flow Agent to use the images.

One-to-one refs If you have 100 prompts and 100 reference images, the agent prompt should preserve the row IDs and explain that image 1 belongs to prompt 1, image 2 belongs to prompt 2, and so on. The actual images still need to be attached in the Agent prompt box.

Common commands

Command Use it for Safety expectation
autoflow status --json Check bridge connection, pairing state, active tab, project ID, and extension readiness. Read-only. Run this first.
autoflow pair Pair the local CLI with the extension using a short-lived pairing token. Requires user-visible pairing approval.
autoflow agent reconcile --project current --json Compare expected rows, images, videos, and metadata against the current Flow project. Read-only. Blocks if the current project cannot be identified.
autoflow agent run --input ./packet.txt --project-id <project-id> --tab-id <tab-id> --json Start a guarded Agent Mode run against an explicitly named Flow project and Chrome tab. Must target a project and tab. Ask for run settings and credit approval first.
autoflow agent confirm-credits --project-id <project-id> --tab-id <tab-id> --json Confirm a visible Flow Agent credit dialog for an already-submitted run. Use only after explicit approval. Add --dont-ask-again only if the user requests persistent approval.
autoflow agent artifacts download-plan --reconciled ./reconcile.json --run-name <run-id> --json Build a stable plan for image/video downloads, filenames, manifests, and QA artifacts. Read-only planning. Execute downloads only after reviewing the plan.
autoflow agent artifacts download-plan --reconciled ./reconcile.json --run-name <run-id> --execute --out ./outputs --project-id <project-id> --tab-id <tab-id> --json Download verified outputs into an organized folder. Reject HTML/tiny files. Reconcile again if media is missing or stale.

Safety model

Explicit target

Write commands must name the Flow project and Chrome tab. If ownership is ambiguous, Auto Flow should block instead of guessing.

Pairing token

Pairing is the local trust step between the extension and the CLI/MCP client. An unpaired client cannot submit work.

Same-target lock

The bridge blocks simultaneous live submits into the same project/tab/lane target.

No blind credit spends

Agents should start read-only and ask before any live submit, retry, download execution, or credit confirmation.

Prove MCP works

This smoke test verifies the published package at the MCP protocol layer and confirms tools are exposed.

tmpdir=$(mktemp -d /tmp/autoflow-npm-mcp-smoke-XXXXXX)
cd "$tmpdir"
npm init -y >/dev/null
npm install @autoflow-mcp/autoflow@beta
node - <<'NODE'
const { spawn } = require("node:child_process");
const child = spawn("./node_modules/.bin/autoflow-mcp", [], { stdio: ["pipe", "pipe", "pipe"] });
let out = "";
child.stdout.on("data", (d) => { out += d; });
function send(message) {
  child.stdin.write(JSON.stringify(message) + "\n");
}
send({ jsonrpc: "2.0", id: 1, method: "initialize", params: { protocolVersion: "2024-11-05", capabilities: {}, clientInfo: { name: "autoflow-npm-smoke", version: "0.0.0" } } });
send({ jsonrpc: "2.0", method: "notifications/initialized", params: {} });
send({ jsonrpc: "2.0", id: 2, method: "tools/list", params: {} });
setTimeout(() => {
  child.kill();
  const messages = out.trim().split(/\n+/).filter(Boolean).map((line) => JSON.parse(line));
  const tools = messages.find((message) => message.id === 2);
  const toolNames = (tools?.result?.tools || []).map((tool) => tool.name);
  console.log(JSON.stringify({
    ok: toolNames.includes("autoflow_status") && toolNames.includes("autoflow_confirm_credits"),
    toolCount: toolNames.length,
    toolNames
  }, null, 2));
}, 1200);
NODE

Expected result: ok: true with tools such as autoflow_status, autoflow_reconcile_project, autoflow_confirm_credits, autoflow_retry_rows, and autoflow_download_outputs.

Troubleshooting

Symptom Likely cause Fix
Bridge disconnected The native host is missing, points at the wrong checkout, or is not allowed for the mounted extension ID. Run autoflow native install-host --extension-id <extension-id> --doctor, install again if needed, then run status.
Not paired The CLI or MCP client has no valid pairing token. Run autoflow pair and approve pairing from the extension UI.
Wrong tab/project Several Flow projects are open or the active tab is not the intended project. Use explicit --project-id and --tab-id. Close unrelated Flow tabs if ownership is ambiguous.
Video cards fail with audio errors Return silent videos was off before the Agent video run. Turn it on in Flow settings, retry the affected row, reconcile again, then download only valid MP4 files.
Download is HTML or tiny Flow returned an error page, auth expired, or media was not ready. Treat it as a hard failure. Recheck auth, reconcile project outputs, regenerate the download plan, and retry.
Reference images are ignored The agent prompt mentioned filenames but did not attach the actual images. Use the Agent plus button, select images, click Add to Prompt, confirm visible asset chips, then submit.

Recommended agent prompt

Paste this into Claude, Codex, or another local coding agent before it touches an Auto Flow run.

You are controlling Auto Flow through its local CLI/MCP bridge.

Start read-only:
1. Run autoflow status --json.
2. Confirm the extension is connected, the client is paired, a Flow project is open, and the user is signed in.
3. Run autoflow agent reconcile --project current --json.
4. Build a download plan with autoflow agent artifacts download-plan --reconciled ./reconcile.json --run-name <run-id> --json.

Do not submit, retry, confirm credits, execute downloads, or spend credits until you have explicit project/tab targeting and user approval.
For write commands, use autoflow agent run with --project-id and --tab-id.
Before live submit, ask for image model, video model, outputs per row, image/video ratios, video length, Return silent videos on/off, and exact credit approval.
For video runs, confirm Flow settings Return silent videos is on before submit.
If Flow Agent is visibly waiting on a credit dialog after an image was generated, use autoflow agent confirm-credits with --project-id and --tab-id instead of re-running the row.
For reference-driven rows, attach the real image assets through the Agent plus button and Add to Prompt; typed filenames, handles, or media IDs alone are not enough.
If the bridge is disconnected, pairing is missing, the wrong tab is active, or project ownership is ambiguous, stop and report BLOCKED.
Never guess the Flow project. Never download HTML/tiny files as successful media. Never hide a credit-spending action inside a read-only step.