Google Flow MCP Server
Automates Google Flow (flow.google.com) via a signed-in Chrome session to generate images and videos with Google's Imagen, Nano Banana and Veo models, including character consistency, video continuation and editing.
Exposes OpenAI-compatible endpoints (/v1/images/generations and /v1/chat/completions) so OpenAI SDK-based clients can request image and video generation through the gateway.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Google Flow MCP Server generate a 16:9 image of a cozy cabin at sunset"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🎨 Google Flow MCP Server & API Gateway | سرور MCP گوگل فلو
تولید تصویر و ویدیوی هوش مصنوعی (Veo / Imagen / Nano Banana) با Google Flow از طریق پروتکل MCP و REST API
An open-source Model Context Protocol (MCP) server & FastAPI REST/OpenAI-compatible gateway for automating Google Flow image generation, video creation, character consistency, narration, and video assembly.
📖 معرفی (Overview)
Google Flow MCP Server یک راهکار کامل برای اتصال Google Flow (flow.google.com) به ایجنتهای هوش مصنوعی (Claude، Cursor، Antigravity، n8n و سرویسهای بکاند) است. این پروژه شامل دو بخش مکمل است:
هسته MCP Daemon (
src/— TypeScript/Node.js): کنترل مرورگر Chrome واقعی از طریق CDP، مدیریت صف کارها (Queue)، نگهداری پروفایل لاگینشده گوگل، تولید تصویر/ویدیو، حفظ ثبات شخصیتها (Character Consistency)، ویرایش تصویر و ویدیو، و مونتاژ خروجی.درگاه FastAPI REST & OpenAI-Compatible (
bridge/flow_api_bridge.py— Python): لایه امنیتی و API با پشتیبانی ازX-API-Key، اندپوینتهای استاندارد REST، سازگاری با فرمت OpenAI (/v1/images/generationsو/v1/chat/completions) و پنل وضعیت ورود گوگل (noVNC).
Related MCP server: io.github.ethanhamilthon/yenflow
✨ ویژگیهای کلیدی (Features)
🖼️ تولید تصویر و ویدیو با مدلهای گوگل: پشتیبانی از Imagen / Nano Banana / Veo در Google Flow با نسبتهای تصویر مختلف (
16:9,9:16,1:1,4:5).🧬 حفظ ثبات شخصیت (Character Consistency): تعریف و فراخوانی شخصیتهای ثابت در تمام صحنهها (
flow_character,flow_character_edit).🎬 تداوم و ویرایش ویدیو: ادامه دادن ویدیو از فریم آخر (
flow_continue) و ویرایش بخشهای تصویر/ویدیو (flow_edit).🎙️ نریشن، صداگذاری و زیرنویس: تولید صدا و زیرنویس و مونتاژ نهایی کلیپها (
flow_narrate,flow_captions,flow_assemble).🔌 درگاه REST و سازگار با OpenAI API: امکان فراخوانی مستقیم از n8n، وردپرس، ربات تلگرام یا هر کلاینت سازگار با OpenAI.
🔐 امنیت با
X-API-Key: محافظت کامل از API و لینکهای دانلود خروجی.🖥️ پشتیبانی از لاگین روی سرور بیمانیتور (noVNC): ورود امن به حساب گوگل از طریق مرورگر تحت وب بدون نیاز به ذخیره رمز عبور در کد.
🎯 کاربردها (Use Cases)
تولید خودکار ریلز، شورتس و ویدیوهای اینستاگرام/یوتیوب/آپارات: ساخت سناریو، تصویرسازی شخصیتمحور، تبدیل به ویدیو و مونتاژ خودکار با ایجنتهای هوش مصنوعی.
اتصال به n8n و رباتهای تلگرام/وب: ارائه یک API اختصاصی روی سرور شخصی برای تولید تصویر و ویدیو بدون محدودیت کلاینتهای محلی.
تولید محتوای انبوه برای فروشگاهها و انتشارات: ساخت کاور، تیزر معرفی کتاب/محصول و بنرهای تبلیغاتی با برندینگ یکپارچه.
🏗️ معماری پروژه (Architecture)
MCP Client / n8n / AI Agent
│ (HTTPS + X-API-Key)
▼
Nginx Reverse Proxy (/flow/ -> 127.0.0.1:8796)
│
▼
FastAPI Gateway (bridge/flow_api_bridge.py :8796)
│ (HTTP / Internal Queue)
▼
Flow MCP Daemon (src/daemon.ts :8795)
│ (Chrome DevTools Protocol :9333)
▼
Google Chrome (Signed-in Google Flow Session)🛠️ ابزارهای MCP و اندپوینتها
ابزارهای اصلی MCP
flow_status— بررسی وضعیت سرویس، صف و لاگین حساب گوگلflow_generate— تولید تصویر یا ویدیو از پرامپت (با انتخاب مدل، نسبت تصویر و تصویر مرجع)flow_wait/flow_cancel/flow_retry— مدیریت صف و انتظار تکمیل رندرflow_assets/flow_download/flow_trash— مدیریت فایلها و دانلود خروجیهاflow_edit/flow_continue— ویرایش خروجی یا ادامه ویدیوflow_character/flow_character_edit/flow_characters— مدیریت شخصیتهای ثابتflow_new_project/flow_techniques— مدیریت پروژه و تکنیکهای پرامپتنویسیflow_narrate/flow_voices/flow_assemble/flow_transcribe/flow_captions/flow_presenter— ابزارهای صداگذاری، زیرنویس و مونتاژ
اندپوینتهای REST API Gateway (bridge/flow_api_bridge.py)
GET /health— بررسی سلامت سرویسGET /status— وضعیت کامل دیمن و لاگین گوگل (نیازمندX-API-Key)POST /generate|POST /generate/image|POST /generate/video— ثبت درخواست تولیدGET /jobs/{job_id}— پیگیری وضعیت کارGET /outputs— لیست خروجیهای تولیدشدهPOST /v1/images/generations&POST /v1/chat/completions— اندپوینتهای سازگار با OpenAI SDK
⚙️ آموزش نصب و راهاندازی کامل (Installation & Setup)
پیشنیازها
Ubuntu 22.04 / 24.04 (یا لینوکس با قابلیت اجرای Google Chrome)
Node.js 20+ و npm
Python 3.10+
Google Chrome نصبشده روی سرور (بههمراه Xvfb و اختیاری x11vnc + noVNC برای لاگین اولیه)
۱. دریافت سورس و بیلد هسته TypeScript
git clone https://github.com/mromidkamangar-lab/google-flow-mcp-server.git
cd google-flow-mcp-server
npm install
npm run build۲. راهاندازی درگاه FastAPI (Python Bridge)
python3 -m venv .venv
source .venv/bin/activate
pip install -r bridge/requirements.txt۳. تنظیم متغیرهای محیطی (.env)
cp .env.example .env
chmod 600 .envیک کلید تصادفی قوی بسازید:
openssl rand -hex 24و مقدار FLOW_API_KEY، FLOW_PUBLIC_URL و FLOW_VNC_URL را داخل .env قرار دهید.
۴. اجرای سرویسها
ترمینال ۱ — اجرای دیمن MCP (با DISPLAY=:99 روی Xvfb):
FLOW_MCP_PORT=8795 FLOW_MCP_CDP_PORT=9333 DISPLAY=:99 node dist/daemon.jsترمینال ۲ — اجرای درگاه FastAPI:
cd bridge
FLOW_MCP_URL=http://127.0.0.1:8795 FLOW_API_KEY="YOUR_SECRET_KEY" \
../.venv/bin/uvicorn flow_api_bridge:app --host 127.0.0.1 --port 8796۵. لاگین حساب گوگل (یکبار برای همیشه)
اگر روی سرور بدون گرافیک هستید، سرویس
Xvfb+x11vnc+noVNCرا روی پورت6080اجرا کنید.از طریق آدرس
https://your-domain.com/flow-login/vnc.html?autoconnect=trueوارد محیط مرورگر شوید و درhttps://flow.google.comبا حساب گوگل خود لاگین کنید.نشست در پروفایل کروم (
~/.flow-mcp/chrome-profile) ذخیره میشود و از این به بعد تمام درخواستها بهصورت خودکار انجام خواهند شد.
۶. انتشار پشت Nginx + Cloudflare
نمونه تنظیمات در deploy/nginx.conf.example قرار دارد.
🔌 نمونه تست و فراخوانی API
curl -X POST "https://your-domain.com/flow/generate/image" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_SECRET_KEY" \
-d '{
"prompt": "Minimalist studio photography of an open language textbook on a warm wooden desk, soft morning sunlight",
"aspect_ratio": "9:16"
}'🔒 نکات امنیتی (Security Best Practices)
هرگز فایل
.env، توکنها و پوشه پروفایل کروم (.flow-mcp/chrome-profile/) را در گیت یا محیط عمومی آپلود نکنید.پس از اتمام لاگین گوگل، دسترسی مسیر
/flow-login/(noVNC) را در Nginx ببندید یا با Basic Auth / IP Whitelist محافظت کنید.همیشه برای
FLOW_API_KEYاز یک رشته تصادفی بلند استفاده کنید.
📄 مجوز (License)
این پروژه تحت مجوز MIT License منتشر شده است.
Google Flow MCP Server & API Gateway combines a TypeScript/Node.js Model Context Protocol (MCP) daemon automating Google Flow via Chrome DevTools Protocol (CDP) with a Python FastAPI REST & OpenAI-compatible gateway (X-API-Key protected). Supports Imagen/Veo generation, character consistency, video continuation, narration, captions, and FFmpeg assembly.
Keywords: google-flow-mcp, google-flow-api, veo-automation, imagen-mcp, model-context-protocol, mcp-server, fastapi-gateway, openai-compatible, cdp-automation, ai-video-pipeline.
Available Tools
22 toolsflow_agent_imagesFast image batch via Flow's agentA
Hand up to 50 image scenes to Flow's own Agent mode, which renders them all in parallel (minutes for a whole batch instead of one paced job per scene) and enriches each prompt itself. Images only, 0 credits. Pass references (characters, places, objects, each with a short name) to attach them once in the agent's composer, the way its + button does, and scene_references to say which scenes use which, so a whole story stays on-model. Scenes the agent drops are asked for again, then made one by one with their references. The finished images are moved into one Flow collection (-) and downloaded as ONE ZIP of originals, not one by one; if that download stops, the job fails without making anything again and flow_download with collection fetches them. Less exact than flow_generate: the agent picks the wording, no techniques, and each image is matched back to its scene by its stored prompt. Returns a job id; use flow_wait.
Inputs: scenes (required), project (required), references, aspect_ratio, +2 more.
flow_assembleAssemble clips into one videoAIdempotent
Join a project's downloaded scene clips in order into one MP4 (local ffmpeg, no credits). Keeps each clip's own sound and can lay a music track and a voiceover on top.
Inputs: project (required), size, clips, music, +15 more.
flow_assetsList project mediaBRead-only
List the images and videos in the open Flow project (title and kind). Titles can be used as 'asset:' in flow_generate or with flow_download.
Inputs: kind.
flow_cancelCancel a queued Flow jobAIdempotent
Cancel a job that has not started yet. A running generation cannot be cancelled.
Inputs: job_id (required).
flow_captionsAdd captions to a videoA
Burn spoken-word captions into a video, in the style short-form apps use, for landscape or vertical footage (local and free: whisper.cpp hears the words on this computer, nothing is uploaded). Styles: bold (big capitals, the spoken word lights up), highlight, reveal, clean, boxed. Works in about 100 languages, including ones written without spaces (Japanese, Chinese, Thai) and right to left (Arabic, Hebrew); pass language (en, es, tr, ja...) whenever you know it. The first call downloads a speech model once: 148 MB for English, 574 MB for other languages. Saves -captions.mp4 plus an .srt. Before calling this, call flow_transcribe, show the user the words with any likely mishearings fixed, and get their OK: then pass the agreed words as text (matching words keep their timing), so the video is made once, right.
Inputs: video (required), lead, size, text, +8 more.
flow_characterCreate a reusable characterA
Create a reusable Flow character (person, mascot, product) so it looks the same in every scene. Free. Give describe and Flow draws the portrait first, or image to use a picture you already have; optionally a personality and a stock voice. Afterwards pass 'asset:' in a scene's reference_images.
Inputs: name (required), look, image, voice, +3 more.
flow_character_editRestyle an existing characterA
Change how an existing character looks without creating a new one (Flow redraws the portrait in place, free), and save the new portrait to /_cast. The character keeps its name, personality and voice, so every scene that references it picks up the new look. Pass look with the full updated description so scene prompts stop quoting the old one. With no change it only saves the current portrait.
Inputs: name (required), look, change.
flow_charactersList charactersARead-only
List the reusable characters in the open Flow project. Each can be used in a scene as 'asset:'.
Inputs: no named parameters.
flow_continueContinue a clip, keeping a character attachedA
Start a new clip from the last frame of one already in the project, for a continuous take across a cut. It saves the source clip's real final frame, animates it through Flow's agent mode, and downloads the result. mode 'exact' (default) gives an invisible join - the clip opens on the actual last frame - but attached characters are ignored, so the likeness must come from that frame; mode 'likeness' keeps a character or your avatar locked at the cost of an only-approximate opening frame. Flow cannot do both at once. Agent mode shows no credit quote beforehand, so ask the user before calling. Queued like a generation; use flow_wait for the file.
Inputs: prompt (required), project (required), from_asset (required), acknowledge_cost (required), +5 more.
flow_downloadDownload existing project mediaAIdempotent
Download media that already exists in the Flow project, without regenerating it (no credits, including 1080p/2K upscales). Matches by the start of the title. collection fetches a whole Flow collection as ONE ZIP (originals, each under its own title): agent image batches put their images in a collection named - and download it that way.
Inputs: project (required), assets, quality, collection.
flow_editEdit an existing videoA
Video-to-video edit of a clip already in the Flow project (relight, change weather/background, remove or restyle objects) using Flow's edit view. Queued like a generation; use flow_wait for the file. Spends credits without a prior quote (about 20 for a 4 s clip), so ask the user before calling.
Inputs: asset (required), prompt (required), project (required), acknowledge_cost (required), +1 more.
flow_generateQueue Flow generationsA
Queue one clip or image per scene in the open Flow project. Runs one at a time with human-like pauses and spends the user's Google AI credits (per video, at 720p: Omni 1.2 Flash 3 a second up to 10 s and 6 a second after, so 30 for 10 s and 60 for 15 s; at 360p a third of that; Veo 3.1 Lite 10; images 0). Each scene is checked against max_credits using Flow's own quote before anything is spent. Returns job ids immediately; use flow_wait for results.
Inputs: scenes (required), project (required).
flow_narrateRecord narrationA
Record narration as an .m4a, free. The default engine: "kokoro" is Kokoro, a voice that runs on this computer: no key, no daily limit, any length, 28 English voices (flow_voices lists them; default am_michael) and a speed. The first Kokoro take downloads its model once (326 MB, about a minute). engine: "gemini" uses Google AI Studio's text-to-speech (the same voices Flow has, a free key in ~/.flow-mcp/gemini-key, a daily limit, takes a short style note); if that limit is used up the line is recorded with Kokoro and the result says so. Neither costs credits. Record a whole narration in one take; flow_assemble can lay it over a film.
Inputs: text (required), project (required), speed, style, +2 more.
flow_new_projectStart a new Flow projectA
Create a new, empty Google Flow project and open it in the Flow window, optionally with a name - for starting a film or ad from scratch. Free. Characters belong to a project, so make them again in the new one.
Inputs: title.
flow_presenterTalking presenter over footageA
Build an explainer from one recording of a talking presenter (an avatar video, say): each stretch shows them full frame, with an optional slow zoom, or in a circle in a corner over another clip. Their sound plays throughout. Local and free. Add music, loudness and watermark removal afterwards with flow_assemble.
Inputs: project (required), segments (required), presenter (required), size, +2 more.
flow_retryRetry failed Flow jobsA
Put failed jobs back in the queue with the same settings and file names (default: all failed jobs). Scenes already retry once on their own when Flow reports a failure. An image batch that finished with some images still failed (its job lists failed_scenes) is not run again whole: only those images are made again, saved under their own scene numbers.
Inputs: job_ids.
flow_statusFlow statusARead-only
Check the Flow Chrome session (signed in, project open, plan, credits left) and the generation queue. Call this first; it says what the user must fix before generating, and returns the prompt playbook.
Inputs: detailed.
flow_techniquesFilm technique presetsARead-onlyIdempotent
List ready-made prompt phrases for camera moves, product shots, first→last-frame transitions and image commands. Pass an id as a scene's technique in flow_generate.
Inputs: category.
flow_transcribeHear the words in a video or audio fileARead-only
Transcribe a video or audio file on this computer with every word's start and end time (whisper.cpp, local and free, about 100 languages; pass language when you know it. The first call in English downloads a 148 MB speech model once, in any other language a 574 MB one). Use the times to check a take said the right words and to cut lines out of it for flow_assemble's voice_lines.
Inputs: video (required), words, language.
flow_trashMove an item to Flow's TrashADestructive
Move one image, video or scene in the open Flow project to Flow's Trash, by its exact title from flow_assets. Recoverable: Flow keeps it in Trash with a Restore button. Never deletes permanently. Flow asks no confirmation of its own, so confirm with the user before calling. Refuses if two items share the title.
Inputs: name (required).
flow_voicesList Flow voicesARead-onlyIdempotent
Narrator voices available for flow_narrate: Kokoro's (free, on this computer, with whether its model is downloaded yet) and Google AI Studio's (with whether a key is set up).
Inputs: no named parameters.
flow_waitWait for Flow jobsARead-only
Wait for queued jobs (default: all), or for the task_id of a call that answered still_working, then return their status, results and file paths. Comes back within about 40 s even when they are still running: 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
Scored across 22 tools
Most tools target clearly different stages of the video workflow: generation, waiting, downloading, assembly, narration, transcription, captions, and character management. A few close pairs could still be confused at a glance, especially flow_characters vs flow_character vs flow_character_edit and flow_generate vs flow_agent_images, though their descriptions clarify the boundaries.
All tools use a consistent flow_ prefix and snake_case, making the namespace predictable. The pattern is mostly verb-based, but several list-style tools use plural nouns (flow_assets, flow_characters, flow_voices, flow_techniques) and flow_character is a create action, which are minor deviations.
At 22 tools, the surface is heavy for a single MCP server, though the breadth of the video-production domain justifies many of them. Each tool maps to a distinct capability, but the set is large enough that discoverability and selection burden are real concerns.
The server covers a strong end-to-end pipeline: project creation, generation, job control, asset listing/download/trash, characters, narration, transcription, captions, assembly, and presenter videos. Minor gaps remain around managing or opening existing projects, editing scene prompts/settings, and importing arbitrary local media outside the character/presenter flows.
Maintenance
Related MCP Connectors
AI video, image and audio generation with 140+ AI models from any MCP agent
AI image, video, voice and music generation over MCP, routed to Veo 3.1, Seedance 2.5 and more.
Build, run, schedule, and publish AI video pipelines to YouTube and TikTok from any MCP client.
Create images & video from any MCP agent — 17 models, spend limits, one URL.
Related MCP Servers
- AlicenseBqualityDmaintenanceMCP server that lets AI agents control Google Flow for generating images and videos using the user's own Google account. It provides tools for image generation, video creation, character and scene management, and UI discovery.171MIT
- AlicenseCqualityBmaintenanceEnables AI agents to orchestrate Google Flow video and image generation, including multi-scene planning, silent background generation, credit tracking, and video stitching via MCP.25MIT
- AlicenseAqualityBmaintenanceEnables AI agents to offload production-grade image and video generation to Google Flow, with deterministic outputs, character consistency, and batch processing via MCP.3MIT
- AlicenseCqualityCmaintenanceEnables Claude, Cursor, or any MCP client to create consistent AI characters, generate Veo 3.1 and Omni videos, edit clips, build scenes, export MP4s, and chat with Google Flow's creative agent. Automates AI video production workflows such as reels, storyboards, and multi-shot stories through natural language, with credit guardrails and dry-run pricing.2320MIT