Skip to main content
Glama

fast-flow-mcp

A lean, high-speed local Model Context Protocol (MCP) server and CLI for Google Flow (flow.google.com) over Chrome DevTools Protocol (CDP).

Designed to use your existing Google AI / Flow credits directly from Claude, Cursor, Codex, Antigravity, or the terminal — without slow character-by-character typing, arbitrary inter-job sleeps, or redundant re-uploads.

Benchmarks (measured live)

Operation

Time

Notes

Prompt input (515 chars)

~7–10 ms

CDP Input.insertText + execCommand (vs 10–15 s char-by-char)

Settings popover + <mat-slider> duration + credit quote

~75–128 ms

Direct DOM radio clicks + native range value setter

Full video submission (settings + cached Start/End frames + prompt)

1.84 s

Verified on 4 s 360p video (4 credits)

2 concurrent reference-guided images (end-to-end)

34.7 s wall

Both rendered in parallel, SHA-256 upload cache hit on scene 2

status --detailed (cold start + credits balance)

~515 ms

Attaches over CDP to running Flow Chrome

Related MCP server: google-flow

Why it's fast

  • Instant prompt & rename entry: Clears .ProseMirror via execCommand and injects the entire prompt via page.keyboard.insertText().

  • In-page JS settings & slider control: Clicks only unchecked role="radio" toggles and updates Angular Material <mat-slider> duration directly via HTMLInputElement.prototype.value setter + input/change events with state-driven waitForFunction checks (zero blind 500–2500 ms sleeps).

  • Concurrent render pipeline (FLOW_CONCURRENCY=3, FLOW_PAUSE_MS=0): Serializes only brief UI interactions (~1.5–2 s) with an async mutex while up to 3 renders run simultaneously on Google's servers. New tiles are tagged in the DOM (data-ffm-job) for reliable concurrent attribution.

  • SHA-256 upload deduplication: Caches local file hashes per Flow project (~/.fast-flow-mcp/uploads-cache.json) so identical start/end frames or references are uploaded once instead of every run.

  • CDP event-driven downloads: Subscribes directly to Browser.downloadWillBegin and Browser.downloadProgress instead of polling download folders, releasing the UI lock as soon as Chrome starts streaming the file.

  • Hard credit cap (max_credits): Reads Flow's live credit quote before clicking Start generation and aborts without spending anything if the quote exceeds max_credits.


Quick Start (1 command)

Prerequisites: Node.js 20+ and Google Chrome. (Optional: ffmpeg in PATH if you want to pass .mp4 files as first_frame/last_frame.)

Option 1: One-command setup via npx

npx -y github:maximhar/fast-flow-mcp setup

The interactive setup wizard will:

  1. Check Node, Chrome, and optional ffmpeg.

  2. Launch a dedicated Chrome profile (~/.fast-flow-mcp/chrome-profile, keeping your everyday browser untouched; automatically reuses ~/.flow-mcp/chrome-profile if you already signed in there).

  3. Wait automatically while you sign in to Google Flow, and create a starter Flow project if none is open.

  4. Detect installed MCP clients (Claude Desktop, Cursor, Antigravity/Gemini) and offer to register fast-flow automatically, plus print the Claude Code one-liner.

Option 2: Clone & install locally

git clone https://github.com/maximhar/fast-flow-mcp.git
cd fast-flow-mcp
npm install
npm run build
npm run setup

You can also run non-interactive diagnostics or auto-install into a specific client:

fast-flow-mcp setup --check
fast-flow-mcp setup --install claude-desktop   # or: cursor | antigravity

MCP Client Configuration

Claude Code

claude mcp add fast-flow -- npx -y github:maximhar/fast-flow-mcp

Or with a local clone:

claude mcp add fast-flow -- node /absolute/path/to/fast-flow-mcp/dist/index.js

Claude Desktop / Cursor / Antigravity / Gemini

Add to your MCP config JSON (claude_desktop_config.json, ~/.cursor/mcp.json, or ~/.gemini/config/mcp_config.json):

{
  "mcpServers": {
    "fast-flow": {
      "command": "npx",
      "args": ["-y", "github:maximhar/fast-flow-mcp"]
    }
  }
}

For faster cold starts with a local clone, point directly to node + dist/index.js:

{
  "mcpServers": {
    "fast-flow": {
      "command": "node",
      "args": ["/absolute/path/to/fast-flow-mcp/dist/index.js"]
    }
  }
}

MCP Tools

Tool

Description

flow_status

Check Chrome session, active project, composer settings, optional credits_remaining, and queue state.

flow_generate

Queue 1–100 image or video scenes. Supports first_frame, last_frame, reference_images, chain_previous, reference_previous, model, resolution, duration, aspect_ratio, variants, download_quality, rename, and max_credits.

flow_wait

Wait up to 40 s for queued/active jobs and return files + per-stage timings (uiWaitMs, submitMs, renderMs, downloadMs, totalMs).

flow_cancel

Cancel a queued job before submission.

flow_retry

Re-queue failed or cancelled jobs.

flow_assets

Fast-scan the active Flow project grid (image / video / scene).

flow_download

Download existing project assets by title prefix (0 credits, original or upscaled).

flow_new_project

Create and open a new Google Flow project.


CLI Usage

# Check status and credit balance
fast-flow-mcp status --detailed

# Generate 2 images concurrently (0 credits)
fast-flow-mcp generate Demo '[
  {"type":"image","max_credits":0,"aspect_ratio":"16:9","prompt":"Misty alpine lake at sunrise"},
  {"type":"image","max_credits":0,"aspect_ratio":"16:9","prompt":"Neon rain-soaked Tokyo alley at midnight"}
]'

# Generate a 720p video with start & end frames
fast-flow-mcp generate Demo '[
  {
    "type": "video",
    "max_credits": 20,
    "resolution": "720p",
    "duration": 6,
    "aspect_ratio": "16:9",
    "first_frame": "/abs/path/start.png",
    "last_frame": "/abs/path/end.png",
    "prompt": "Slow cinematic camera push with drifting clouds"
  }
]'

# List or re-download existing project media (0 credits)
fast-flow-mcp assets
fast-flow-mcp download Demo "Demo-scene-01"

Configuration (Environment Variables)

Variable

Default

Description

FLOW_CONCURRENCY

3

Maximum simultaneous renders in Flow (1–6).

FLOW_PAUSE_MS

0

Optional delay (ms) between consecutive submissions.

FLOW_CDP_PORT

9333

Chrome remote debugging port.

FLOW_PROFILE_DIR

~/.fast-flow-mcp/chrome-profile

Dedicated Chrome user-data directory (auto-reuses ~/.flow-mcp/chrome-profile if present).

FLOW_OUTPUT_DIR

~/fast-flow-out

Root output directory for downloaded media (auto-reuses ~/flow-mcp-out if present).

FLOW_CHROME_PATH

auto-detected

Explicit path to Chrome/Chromium executable.


Security & Privacy

  • Runs 100% locally on your machine — no relay server, no external API keys, no telemetry.

  • Never reads or types your Google credentials; you sign in manually once in the isolated Chrome profile.

  • Drives Flow's real UI cleanly without bypassing reCAPTCHA or forging backend RPCs.

License

MIT

Available Tools

8 tools
flow_assetsList Flow project mediaB
Read-only

Fast-scan the active Flow project grid and list images, videos, and scenes.

Inputs: kind.

flow_cancelCancel a queued Flow jobB
Idempotent

Cancel a job that has not been submitted yet.

Inputs: job_id (required).

flow_downloadDownload existing Flow project mediaA
Idempotent

Download existing project assets by title prefix (0 credits) using CDP event-driven downloads.

Inputs: assets (required), project (required), quality.

flow_generateQueue fast concurrent Flow generationsA

Queue 1-100 image or video generations. Runs up to FLOW_CONCURRENCY (default 3) concurrently in Flow with instant JS/CDP input, SHA-256 upload deduplication, zero artificial sleeps, and live max_credits protection. Returns job IDs immediately; poll with flow_wait.

Inputs: scenes (required), project (required).

flow_new_projectCreate a new Flow projectB

Create and open a new Google Flow project with an optional title.

Inputs: title.

flow_retryRetry failed or cancelled jobsB

Re-queue failed or cancelled jobs with their original settings.

Inputs: job_ids.

flow_statusFlow session & queue statusA
Read-only

Check the Flow Chrome session (signed in, active project, composer settings, optional credit balance) and concurrent job queue.

Inputs: detailed.

flow_waitWait for Flow jobsA
Read-only

Wait up to 40s for queued/active jobs to finish, returning status, file paths, and per-stage timings. Call again until finished is true.

Inputs: job_ids, timeout_seconds.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 8 tools

    Disambiguation4/5

    Each tool targets a distinct step in the generation workflow: status check, queueing, polling, cancel, retry, asset listing, download, and project creation. The only mild overlap is between flow_status (which reports queue state) and flow_wait (which polls job state), but the descriptions make the boundary reasonably clear.

    Naming Consistency4/5

    All eight tools share a uniform snake_case 'flow_' prefix, which makes the family instantly recognizable. However, the suffix pattern mixes verbs (generate, wait, cancel, retry, download) with nouns/adjectives (status, assets, new_project), so it isn't a pure verb_noun convention.

    Tool Count5/5

    Eight tools map cleanly onto the async job lifecycle plus project/asset management, with no redundant entries. Every tool earns its place and the count sits squarely in the well-scoped range.

    Completeness4/5

    The core lifecycle (create project, generate, wait, cancel, retry, list assets, download) is fully covered with no dead ends for the primary workflow. Minor gaps exist: there is no way to list/switch existing projects, no delete/cleanup operation, and no single-job status lookup outside the blocking flow_wait.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers