MCP tools for agents
Claude, Codex, and other MCP clients can call structured Auto Flow tools instead of guessing shell commands.
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.
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 --versionClaude, Codex, and other MCP clients can call structured Auto Flow tools instead of guessing shell commands.
Use autoflow from a content repo, video project, or random terminal and still target the same browser lane.
Map Flow outputs back to row IDs, plan filenames, reject bad HTML/tiny files, and download verified images or MP4s.
Submits, retries, downloads, and credit confirmations require explicit targeting so agents do not hit the wrong tab.
@beta.autoflow native install-host --extension-id <extension-id> --doctor
autoflow native install-host --extension-id <extension-id>
autoflow pair
autoflow status --jsonIf the browser, extension, or native host restarts, pairing can reset. Run autoflow pair again.
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.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-agentFor 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.Agents should ask these questions before they run anything that can spend credits or submit work.
Return silent videos enabled before submit.
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.
| 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. |
Write commands must name the Flow project and Chrome tab. If ownership is ambiguous, Auto Flow should block instead of guessing.
Pairing is the local trust step between the extension and the CLI/MCP client. An unpaired client cannot submit work.
The bridge blocks simultaneous live submits into the same project/tab/lane target.
Agents should start read-only and ask before any live submit, retry, download execution, or credit confirmation.
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);
NODEExpected result: ok: true with tools such as autoflow_status, autoflow_reconcile_project, autoflow_confirm_credits, autoflow_retry_rows, and autoflow_download_outputs.
| 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. |
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.