Skip to main content
Glama

custom-google-flow-mcp

Servidor MCP (stdio, TypeScript) que automatiza o Google Flow (flow.google.com, antigo labs.google/fx/tools/flow) no seu próprio navegador logado, via Chrome DevTools Protocol. Baseado na arquitetura de retrolyze52/google-flow-mcp, reescrito em módulos.

Instalação

Requisitos: Node.js 20+ e um navegador Chromium (Chrome, Brave, Edge ou Chromium).

Opção 1 — Plugin do Claude Code (mais fácil)

Dentro do Claude Code:

/plugin marketplace add kasseditor-oss/custom-google-flow-mcp
/plugin install google-flow@kasseditor-oss

Na primeira execução o plugin instala as dependências sozinho (~5 s). Depois faça o login uma vez (veja "Primeiro login").

Opção 2 — Um comando (Claude Code + Claude Desktop)

npx -y github:kasseditor-oss/custom-google-flow-mcp install

Instala uma cópia permanente em %LOCALAPPDATA%\custom-google-flow-mcp\app, registra o servidor google-flow no Claude Code (escopo usuário) e no claude_desktop_config.json do Claude Desktop (com backup .bak). Opções: --output-root D:/Videos, --concurrency 2, --name meu-flow, --only code|desktop.

Opção 3 — Clonar

git clone https://github.com/kasseditor-oss/custom-google-flow-mcp.git
cd custom-google-flow-mcp
npm install --omit=dev
npm run setup        # mesmo registro automático da opção 2

dist/ já vem compilado no repositório; não precisa de build.

Primeiro login

npx -y github:kasseditor-oss/custom-google-flow-mcp auth

(ou npm run auth na pasta clonada). Abre o navegador com perfil dedicado; entre na conta Google e clique em "Crie com o Google Flow". Depois, no Claude, peça flow_check_session.

Pedir para o Claude instalar

Cole no Claude Code: "Instale o MCP https://github.com/kasseditor-oss/custom-google-flow-mcp rodando npx -y github:kasseditor-oss/custom-google-flow-mcp install e depois rode o comando auth dele."

Related MCP server: google-flow-mcp

Opções de geração e custo

  • Quantidade: outputs_count 1–4. Padrão: 1. Arquivos múltiplos saem como _v1 … _v4.

  • Vídeo: aspect_ratio 9:16 (TikTok, Reels, Shorts) ou 16:9 (YouTube); duration_seconds (limite lido ao vivo do Flow, ex.: Omni 1.2 Flash = 3–15 s); resolution 360p / 720p; model (Omni 1.2 Flash, Veo 3.1 …).

  • Imagem: aspect_ratio 16:9, 4:3, 1:1, 3:4, 9:16.

  • Escolha antes de gerar: quando o pedido não diz a quantidade (e, no vídeo, formato/duração/resolução), o MCP abre um diálogo nativo do cliente (MCP elicitation) mostrando o custo que o próprio Flow anuncia ("Generating will use N credits"). Cancelar não gasta nada. Clientes sem esse recurso usam os padrões. ask_options: false ou FLOW_MCP_ASK_OPTIONS=never pulam o diálogo.

  • flow_estimate_cost: consulta o custo em créditos e as opções permitidas sem gerar.

  • O resultado e o widget mostram os créditos gastos (credits_used).

Visual no chat (MCP Apps)

As tools de geração abrem um widget dentro do chat (padrão oficial MCP Apps, o mesmo usado por conectores como o Higgsfield): logo animado com "Gerando no Google Flow…", fase e tempo; ao terminar, a imagem / capa do vídeo grande com modelo · proporção · prompt sobrepostos e botões Abrir e Mostrar na pasta. Lotes mostram uma grade com o progresso de cada take.

  • Funciona no Claude Desktop (servidor local) e em outros hosts com MCP Apps (ex.: VS Code).

  • Hosts sem MCP Apps (ex.: Claude Code no terminal) recebem a miniatura como imagem na resposta da tool.

  • O ícone oficial do Google Flow é baixado do servidor público do Google (gstatic.com) na sua máquina e guardado em cache (%LOCALAPPDATA%\custom-google-flow-mcp\brand); ele não é distribuído neste repositório. Sem internet, usa um logo genérico.

Navegador invisível

O MCP usa o perfil dedicado num navegador invisível (no Windows: navegador real com as janelas ocultadas via Win32 — sem janela e sem ícone na barra de tarefas). Ele abre só quando há trabalho e fecha sozinho após FLOW_MCP_IDLE_CLOSE_SECONDS (padrão 90 s) sem uso, e também quando o MCP encerra.

Login automático: se o Google pedir login, o MCP fecha o navegador invisível, abre uma janela normal no Flow (mesmo perfil), espera você entrar (até FLOW_MCP_LOGIN_TIMEOUT_SECONDS, padrão 600 s), fecha a janela e continua invisível. FLOW_MCP_AUTO_LOGIN=0 desliga isso (volta a retornar login_required / npm run auth).

Variáveis: FLOW_MCP_BROWSER_VISIBILITY=hidden|visible (padrão hidden; visible mostra sempre a janela, para depurar). Avançado: FLOW_MCP_HIDE_MODE=hidden|offscreen|headless|visible. Um navegador que você abriu na porta CDP nunca é fechado nem ocultado pelo MCP.

Tools

Tool

O que faz

flow_check_session

Conecta no Chrome (CDP) e diz se o Flow está logado e pronto.

flow_health_check

Login + sondagem de todos os seletores (mostra qual fallback casou) + screenshot em logs/error-debug.png se algo falhar.

flow_generate_video

Texto → vídeo. aspect_ratio, camera_motion, outputs_count, model, nomenclatura.

flow_image_to_video

start_frame, end_frame, reference_images (ingredientes) → vídeo.

flow_generate_image

Imagens (Nano Banana / Imagen dentro do Flow).

flow_generate_batch

Storyboard inteiro em background: concorrência 1–4, retry com backoff exponencial, manifesto.

flow_get_queue_status

Progresso de lote/job sem bloquear.

flow_estimate_cost

Mostra quantos créditos a geração vai gastar e as opções permitidas, sem gerar.

flow_cancel

Cancela job ou lote.

flow_preview, flow_open_file

Usadas só pelo widget do chat (ocultas do modelo).

As tools de geração aceitam wait (padrão true, até wait_timeout_seconds) — se o vídeo demorar mais, retornam job_id e o job continua em background.

Saída para edição

<output_dir>/<project_name>/
  manifest.json                    ← prompt, prompt final enviado, parâmetros, como cada um foi aplicado (ui/prompt), sha256, ffprobe, URL do projeto Flow
  Assets_Flow/
    Scene_01_Take_01.mp4
    Scene_01_Take_02_v1.mp4        ← outputs_count > 1
    Scene_01_Take_02_v2.mp4
    Scene_01_Take_02_alt2.mp4      ← nunca sobrescreve (a menos que overwrite=true)

output_dir padrão: C:/Projetos (FLOW_MCP_OUTPUT_ROOT). O Flow não expõe seed na UI; o manifesto grava seed: null explicitamente.

Autenticação (CDP híbrido)

  • npm run auth — abre (visível, só para o login) um Chrome real (não build de automação) com perfil dedicado (%LOCALAPPDATA%\custom-google-flow-mcp\chrome-profile) e --remote-debugging-port=9222. Você faz login uma vez; a sessão fica no perfil, sem 2FA repetido.

  • O MCP (FLOW_MCP_BROWSER_MODE=auto) anexa a esse Chrome via connectOverCDP. Se estiver fechado, relança com o mesmo perfil.

  • cdp = só anexa (use se você mesmo abre o navegador com --remote-debugging-port=9222 --user-data-dir=...). Chrome 136+ não aceita a porta de debug no perfil padrão — por isso o perfil dedicado.

  • Navegador detectado automaticamente: Chrome → Chromium → Brave → Edge → Chromium do Playwright. Force com FLOW_MCP_BROWSER_EXECUTABLE.

Robustez

  • src/selectors.ts: cada elemento tem estratégias em ordem (ícone Material → aria-label PT/EN → role → texto → CSS). UI mudou? Edite só esse arquivo.

  • Parâmetros sem controle visível na UI (proporção, câmera, frames) caem para diretiva no prompt; o manifesto registra applied_via.

  • Erros classificados: rate_limited/server_error/generation_timeout → retry com backoff (rate limit dobra a espera); policy_blocked/insufficient_credits → falha direta.

  • Créditos já gastos não são gastos de novo: se falhar após o envio (timeout, download), o retry retoma o mesmo resultado em vez de reenviar.

  • Concorrência > 1: cada worker usa aba e projeto Flow próprios (galerias não se misturam).

  • Falhas salvam screenshot em logs/job-<id>-attempt<n>.png.

Comandos

custom-google-flow-mcp            # servidor MCP (stdio)
custom-google-flow-mcp install    # registra no Claude Code / Desktop
custom-google-flow-mcp auth       # login inicial
custom-google-flow-mcp chrome     # só sobe o navegador com CDP

Na pasta clonada: npm run setup | auth | chrome | smoke. Desenvolvimento: npm install && npm run build (commite o dist/).

Variáveis: veja .env.example. Exemplos de config e storyboard em examples/.

Licença

MIT. Partes derivadas de retrolyze52/google-flow-mcp (MIT).

Available Tools

11 tools
flow_cancelCancel job or batchA
Destructive

Cancels a queued/running job, or every unfinished take of a batch. A generation already submitted to Flow may still finish on Flow's side (credits already spent).

Inputs: id (required).

flow_check_sessionCheck Google Flow sessionA
Read-only

Connects to Chrome (CDP on :9222, launching the dedicated profile if needed) and reports whether Google Flow is signed in and the workspace is ready. Spends no credits.

Inputs: no named parameters.

flow_estimate_costEstimate Google Flow creditsA
Read-only

Shows how many credits a generation will use BEFORE generating (Flow's own 'Generating will use N credits'), plus the live options for the current model: allowed video length range, resolutions and formats. Configures Flow's settings panel but never submits, so it spends no credits.

Inputs: model, media_type, resolution, aspect_ratio, +2 more.

flow_generate_batchBatch storyboard queueA

Queues a full storyboard (list of takes) and returns a batch_id immediately. Runs in background with configurable concurrency (1-4 workers, each in its own Flow tab/project), automatic retry with exponential backoff on rate limits / server errors, and writes every result + a batch summary to <output_dir>/<project_name>/manifest.json. Poll flow_get_queue_status. Consumes Flow credits.

Inputs: scenes (required), project_name (required), overwrite, output_dir, +8 more.

flow_generate_imageGenerate image (Nano Banana / Imagen in Flow)A

Generates still images inside Google Flow and downloads them at the full resolution Flow serves, with editor-ready naming and manifest.json. Optional reference images. Consumes Flow credits.

Inputs: prompt (required), wait, model, scene_id, +12 more.

flow_generate_videoGenerate video (text-to-video)A

Generates a video in Google Flow from text, with aspect ratio, camera motion, variation count and editor-ready naming (Scene_01_Take_02.mp4) plus manifest.json. Consumes Flow credits.

Inputs: prompt (required), wait, model, scene_id, +14 more.

flow_get_queue_statusQueue / batch / job statusA
Read-only

Non-blocking progress report. With batch_id: batch progress + each take. With job_id: one job (verbose). With neither: overview of running/queued work and recent batches.

Inputs: job_id, verbose, batch_id.

flow_health_checkHealth check (session + selectors + screenshot)A
Read-only

Verifies login, opens a Flow project, probes every key DOM selector (reporting which fallback strategy matched) and, if anything fails, saves a diagnostic screenshot to ./logs/error-debug.png and returns its path. Spends no credits.

Inputs: open_project.

flow_image_to_videoGenerate video from images (frames / ingredients)A

Uploads local images to Flow as Start Frame, End Frame and/or ingredient references (character/scenery), then generates a video. Uses Frames-to-Video when frames are given, Ingredients-to-Video for references. Consumes Flow credits.

Inputs: prompt (required), wait, model, scene_id, +17 more.

flow_open_fileViewer: open generated fileB
Read-only

Used by the inline viewer's Open / Folder buttons. Opens a file generated by this server with the default app, or reveals it in the file manager.

Inputs: path (required), reveal.

flow_previewViewer: job/batch previewA
Read-only

Used by the inline Google Flow viewer to poll progress and fetch thumbnails. Not needed by the model; use flow_get_queue_status instead.

Inputs: job_id, batch_id, thumbnails_for.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 11 tools

    Disambiguation4/5

    Most tools have a genuinely distinct role: single video, image-to-video, still image, and batch queueing are cleanly separated by input type and scope. The main soft spots are flow_check_session vs flow_health_check (both readiness probes, differing only in depth) and flow_preview vs flow_get_queue_status, though the description explicitly redirects the model to the latter. These are documented overlaps rather than true collisions.

    Naming Consistency4/5

    All names share a uniform flow_ prefix with lowercase snake_case, which reads predictably. Minor deviations: flow_health_check uses noun_verb ordering while flow_check_session uses verb_noun, and flow_preview/flow_cancel lack an explicit object. Still easy to scan and group.

    Tool Count5/5

    Eleven tools is well within a healthy range for a browser-automation generation server. Each generation variant earns its place (text-to-video, frames/ingredients, stills, batch), and the supporting set (cost estimate, session/health check, queue status, cancel, file open) maps to real operational needs.

    Completeness4/5

    The lifecycle is covered end-to-end: verify session, estimate cost, generate (single and batch), poll status, cancel, and open results. Gaps are minor — no tool to read back a manifest/batch results on disk, no listing of prior jobs or projects, and no cleanup/delete for finished work, so agents must fall back to the filesystem for those.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables AI agents to programmatically generate images and videos through the authenticated Google Flow web interface via a direct Chrome DevTools Protocol connection, exposing tools for media generation, project management, status checks, and asset downloads without requiring official API keys.
      7
      8
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables users to generate images and videos on Google Flow through browser automation of an already signed-in Chrome session, downloading the finished media to disk without any API keys. It drives Flow's agent with a range of image and video models, plus reference images, first/last frames, and ingredient-based video jobs, while reusing the user's own Google AI Pro credits.
      17
      MIT