Google Flow MCP
Provides Gmail integration as part of Google Workspace, enabling agents to interact with Gmail through dedicated tools.
Integrates with Google Flow (Veo / Gemini) to generate and manage video and image generation jobs through a user's Google account, including automatic finishing and local delivery. Also provides tools for Google Workspace services such as Gmail, Drive, Sheets, Docs, and Calendar.
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 Generate a 10s 16:9 video of a red fox in a misty forest."
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
A production-grade Model Context Protocol server that turns Google Flow (Veo / Gemini) into a durable, IDE-native media engine: video and image generation jobs through your own Google account, automatic finishing, and clean local delivery — with a job system built for agents (idempotency, progress timelines, crash recovery, self-healing retries).
Point Codex, Claude Code, Cursor, ZCode, or any MCP client at this repo and generating media becomes a tool call.
You: "Generate a 10s 16:9 video of a red fox in a misty forest."
Agent: generate_video(...) → job id → get_video_job(...) until COMPLETED
→ C:\...\outputs\<job-id>\final\video.mp4 (finished, delivery-ready)Why this exists
Agentic by design — every generation is a durable job with a state machine (
CREATED → … → COMPLETED), an event timeline, idempotency keys, cancellation, crash recovery, and a self-healingrecover_video_job. Agents can poll, resume, and reason about failures instead of babysitting a browser.Everything Flow offers — Video mode (4/6/8/10 s, 16:9 / 9:16 / 1:1 / 3:4 / 4:3, model selection) and Image mode (all five ratios, x1–x4 variations). Ask the agent to call
flow_capabilitiesfor the live capability sheet.Automatic finishing pipeline — every finished render goes through technical QC and a finishing stage before delivery. The delivered file in
outputs/<job-id>/final/is the finished asset; the raw provider download stays archived underoutputs/<job-id>/source/.Your account, your credits — drives a real, manually-authenticated Chrome profile. No API keys to Google, no credentials in configs or logs, no passwords ever handled by the server.
Local-first — outputs land on your disk with absolute paths returned to the agent; optional loopback HTTP API +
/connectsetup page for browser-based clients.
Related MCP server: flow-studio
Quick start (humans)
Requirements: Node ≥ 20, Python 3.10+ with pip install -r requirements.txt, FFmpeg on PATH (or set FFMPEG_PATH), and Google Chrome.
git clone https://github.com/Souvik988/google-flow-mcp.git
cd google-flow-mcp
npm install
npm run build
cp .env.example .env # optional: adjust to tasteSign in once (opens a visible Chrome window on your automation profile):
npm run host # starts the local API host (port 4318)
# then open http://127.0.0.1:4318/connect and follow the sign-in step,
# or simply call the flow_browser_login tool from your agentQuick start (IDE agents)
Tell your agent:
Set up https://github.com/Souvik988/google-flow-mcp as an MCP server. Clone it, run
npm install && npm run build, then register it perAGENT_GUIDE.mdin the repo root.
Or add it yourself — the stdio entry is dist/asset-mcp-main.js:
Codex (~/.codex/config.toml):
[mcp_servers.google-flow]
command = "node"
args = ['C:\path\to\google-flow-mcp\dist\asset-mcp-main.js']Claude Desktop / Cursor / ZCode (JSON form):
{
"mcpServers": {
"google-flow": { "command": "node", "args": ["C:/path/to/google-flow-mcp/dist/asset-mcp-main.js"] }
}
}More snippets in examples/. Restart the IDE after adding.
The tools (45)
Area | Tools |
Video generation |
|
Image generation |
|
Capability discovery |
|
Browser session |
|
Google Workspace | Gmail (4), Drive (5), Sheets (4), Docs (3), Calendar (4) |
Legacy bridge |
|
Key parameters: prompt (director-style), duration (4s|6s|8s|10s), aspectRatio (16:9|9:16|1:1|3:4|4:3), model, referenceImagePaths (up to 5 local images, uploaded through Flow's Ingredients drawer), idempotencyKey, waitForCompletion.
Architecture
src/
├─ asset-mcp-main.ts # stdio entry (what IDEs launch)
├─ asset-host-main.ts # HTTP host entry (asset API + /mcp + /connect)
├─ mcp-server.ts # tool registry (45 tools, 3 resources)
├─ http-api.ts # loopback REST + streamable-HTTP MCP endpoint
├─ connect-page.ts # /connect setup page (URLs + copy-paste configs)
├─ browser-controller.ts # persistent Chrome profile, clean sign-in dance
├─ manual-chrome.ts # spawns Chrome (automation + clean-sign-in modes)
└─ video/
├─ orchestrator.ts # job worker: submit → retrieve → QC → finish → deliver
├─ job-store.ts # durable JSON job store (atomic writes)
├─ state-machine.ts # explicit transition table (contract-tested)
├─ google-flow-provider.ts # the only module that knows Flow's DOM
├─ quality-control.ts # ffprobe-backed technical QC (+ image QC)
├─ watermark-remover.ts # finishing engines + orchestration
├─ job-recovery.ts # staged-clip-first salvage, no double credit spend
├─ asset-manager.ts # job directories, trusted-host downloads
└─ creative-brief.ts, prompt-compiler.ts, priority-queue.ts, …
scripts/
├─ remove_watermark_v2.py # finishing engine v3 (registered reconstruction)
└─ remove_watermark.py # finishing engine v1 (regional, fallback)Job lifecycle: CREATED → PREPARING → SUBMITTING → QUEUED → GENERATING → GENERATED → RETRIEVING → VALIDATING → QUALITY_CHECKING → POST_PROCESSING → QUALITY_CHECKING → COMPLETED — with explicit failure classes (AUTH_REQUIRED, UI_CHANGED, DOWNLOAD_FAILED, TIMEOUT, …) instead of mystery hangs. The full choreography is contract-locked by a walk test.
Finishing pipeline (every job, on by default): after technical QC, each render passes through the finishing stage before it lands in final/. Engine order (FLOW_WATERMARK_METHOD=auto): registered reconstruction → OpenCV inpainting → FFmpeg patch. The stage records its outcome on the job (output.watermark) and is best-effort by design: a failed pass never throws away a paid generation. There is deliberately no standalone finishing tool — it is part of the pipeline, not a decision the calling agent makes.
Recovery: a job that finished generating but failed during download can always be salvaged — recover_video_job (or npm run recover <jobId>) reuses the already-staged asset when present and otherwise reattaches to the open Flow tab. It never submits a new generation, so credits are never spent twice.
Security model
Authentication is a one-time manual sign-in in a visible Chrome window. The server never accepts, types, stores, or logs Google passwords, TOTP secrets, cookies, or OTP codes.
Downloads are restricted to Google-owned hosts (
google.com,googleusercontent.com,googlevideo.com,flow-content.google); redirects are validated per hop.The HTTP surface binds loopback only and requires a ≥24-char bearer token. Put remote access behind your own authenticated proxy if you need it.
Paths are confined to the workspace; state and outputs live under the repo.
Configuration
See .env.example for every variable. The important ones:
Variable | Default | Purpose |
|
|
|
|
| Local API + |
|
|
|
|
| Finishing stage toggle |
|
|
|
| PATH | Explicit binaries for the finishing engines |
Troubleshooting
Symptom | Fix |
"This browser or app may not be secure" at Google sign-in | Already handled: |
Job stuck non-terminal / | Call |
| Session expired → |
| Flow's DOM moved → run |
Port 4318 busy | Another host is running; |
Development
npm run typecheck && npm test && npm run buildTests cover the state machine (full-choreography walk), the finishing engines (with a synthetic process seam), the capability/allowlist surface, the connect page, and the job store.
License
MIT — see LICENSE.
Available Tools
45 toolscalendar_create_eventC
Create a new Google Calendar event with optional attendees
Inputs: endTime (required), summary (required), startTime (required), location, +3 more.
calendar_delete_eventC
Delete a Google Calendar event
Inputs: eventId (required).
calendar_list_eventsC
List upcoming events from Google Calendar
Inputs: timeMax, timeMin, calendarId, maxResults.
calendar_update_eventC
Update an existing Google Calendar event
Inputs: eventId (required), endTime, summary, location, +2 more.
cancel_video_jobA
Request cancellation for a queued or active video job. It never starts another regeneration after cancellation.
Inputs: jobId (required).
create_flowB
Create a legacy bridge workflow record with defined steps; this does not create a Google Flow UI workflow.
Inputs: name (required), steps, description.
delete_flowB
Mark a legacy bridge workflow record deleted by ID.
Inputs: workflowId (required).
docs_appendB
Append text to an existing Google Docs document
Inputs: content (required), documentId (required).
docs_createC
Create a new Google Docs document with optional initial content
Inputs: title (required), content.
docs_readB
Read the text content of a Google Docs document
Inputs: documentId (required).
download_flow_videoA
Legacy manual download from an authorized Google asset URL or Drive ID. Completed orchestration jobs already download and validate their own asset.
Inputs: videoUrl (required), outputPath (required), filename.
drive_create_folderC
Create a new folder in Google Drive
Inputs: name (required), parentId.
drive_downloadC
Download a file from Google Drive to a local path
Inputs: fileId (required), localPath (required).
drive_listB
List files in Google Drive with optional folder, name, and type filters
Inputs: query, fileType, folderId.
drive_trashB
Move a file to trash in Google Drive
Inputs: fileId (required).
drive_uploadC
Upload a local file to Google Drive
Inputs: localPath (required), name, driveFolderId.
flow_browser_actionC
Execute a Google Flow action through browser automation (create, edit, run, export)
Inputs: action (required), flowName (required), parameters.
flow_browser_autopilotC
Compatibility alias for a bounded, persistent Flow video job. It requires a manually authenticated persistent browser session and never automates password or MFA handling.
Inputs: prompt (required), model, duration, priority, +4 more.
flow_browser_check_sessionA
Check if the Google browser session is still valid and active. Returns the session state without navigating away from the current page.
Inputs: no named parameters.
flow_browser_closeA
Close the browser automation session. Session data is preserved for next launch.
Inputs: no named parameters.
flow_browser_generate_videoB
Compatibility alias for generate_video using the persistent job orchestrator. Requires a manually authenticated Google browser session.
Inputs: prompt (required), model, duration, priority, +4 more.
flow_browser_loginA
Open the persistent browser profile at Google sign-in. Complete login manually; this MCP server never accepts, types, stores, or logs passwords, TOTP secrets, cookies, or one-time codes.
Inputs: no named parameters.
flow_capabilitiesA
Read-only capability sheet for Google Flow as driven by this server: modes, aspect ratios, durations, models, output counts, the watermark-removal engine, and where finished files are delivered. Consult it whenever a caller asks what Flow can do or which sizes/ratios are available.
Inputs: no named parameters.
flow_screenshotB
Take a screenshot of the current browser page (useful for debugging)
Inputs: outputPath.
generate_imageA
Create a durable Google Flow IMAGE job: still renders in any Flow aspect ratio (16:9, 4:3, 1:1, 3:4, 9:16) with 1-4 variations, then watermark removal and local delivery. The prompt is passed to Flow verbatim as the visual instruction.
Inputs: prompt (required), style, priority, aspectRatio, +4 more.
generate_videoA
Create a durable Google Flow video job. The instruction is interpreted as a director brief, compiled into a Flow prompt, and processed asynchronously by default.
Inputs: prompt (required), model, style, duration, +8 more.
get_flow_statusB
Get the status of a legacy bridge workflow record.
Inputs: executionId (required).
get_video_jobB
Get a durable video job, including state, progress timeline, prompt compilation, output, and QC result.
Inputs: jobId (required).
get_video_statusC
Compatibility alias for get_video_job. Checks durable local jobs first, then a legacy authenticated bridge request ID.
Inputs: requestId (required).
gmail_readA
Read the full content of an email by its message ID
Inputs: messageId (required).
gmail_replyC
Reply to an existing email thread
Inputs: body (required), messageId (required).
gmail_searchC
Search Gmail using advanced query syntax (same as Gmail search bar)
Inputs: query (required), maxResults.
gmail_sendB
Send an email via Gmail with optional CC and BCC
Inputs: to (required), body (required), subject (required), cc, +1 more.
list_flowsB
List legacy bridge workflow records. These are not Google Flow/Veo projects.
Inputs: no named parameters.
list_video_jobsB
List recent durable video jobs. This is local job history, not a remote Drive search.
Inputs: limit.
list_videosC
List all generated videos from Google Drive
Inputs: folderId.
recover_video_jobA
Self-healing recovery for a job whose Flow generation finished but whose download failed or was interrupted. Reattaches to the open Flow tab, retrieves the already-paid clip, removes the watermark, and completes the job. Never submits a new generation, so no additional credits are spent.
Inputs: jobId (required).
refine_videoC
Create a new version from a prior job using a targeted creative directive while preserving unrelated approved details.
Inputs: jobId (required), directive (required), priority.
regenerate_videoC
Create a new version of a prior job from its approved creative brief.
Inputs: jobId (required), priority.
sheets_appendB
Append rows to the end of a Google Sheets spreadsheet
Inputs: range (required), values (required), spreadsheetId (required).
sheets_createC
Create a new Google Sheets spreadsheet
Inputs: title (required), sheetNames.
sheets_readC
Read data from a Google Sheets spreadsheet
Inputs: range (required), spreadsheetId (required).
sheets_writeA
Write data to a Google Sheets spreadsheet (overwrites existing data in range)
Inputs: range (required), values (required), spreadsheetId (required).
trigger_flowB
Trigger a legacy bridge workflow record by name with optional input parameters. This is not a Google Flow/Veo generation.
Inputs: workflowName (required), inputs, waitForCompletion.
video_system_healthB
Check local video-job persistence, queue availability, and browser-session availability without exposing credentials.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 45 tools
The set is dominated by near-duplicate generations: get_video_status is explicitly an alias for get_video_job, flow_browser_generate_video and flow_browser_autopilot are aliases for generate_video, and generate_video/regenerate_video/refine_video plus list_flows/create_flow/trigger_flow form clusters an agent can easily confuse. The 'legacy bridge workflow' vs 'Google Flow' distinction is only stated in descriptions and is easy to miss when selecting a tool, and flow_browser_action (create/edit/run/export) overlaps with nearly every generation tool.
All names are snake_case, but the ordering convention is split between noun_verb (calendar_delete_event, drive_create_folder, sheets_read) and verb_noun (list_flows, generate_video, download_flow_video). Worse, the 'flow_' prefix is overloaded to mean both legacy bridge workflows (create_flow, trigger_flow) and browser automation (flow_screenshot), so names actively mislead about what family a tool belongs to.
At 45 tools this is far past a comfortable surface, and a meaningful fraction are compatibility aliases (get_video_status, flow_browser_generate_video, flow_browser_autopilot) or legacy bridge tools that could be a separate server. The Google Workspace tools (Gmail, Drive, Sheets, Docs, Calendar) also inflate the set well beyond the server's stated Flow purpose.
The Flow video lifecycle is genuinely deep — generate, status, list, cancel, refine, regenerate, recover, health, plus capability discovery — so the core domain is well covered. However the Workspace half is partial (no Gmail delete/labels/thread listing, no Drive move/rename, no Docs update/delete), leaving scattered gaps that force workarounds.
Related MCP Connectors
OCR, transcription, file extraction, and image generation for AI agents via MCP.
214 tools for AI agents over one MCP endpoint: image, video, audio, 3D, data, storage, mail, GPUs.
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.
Related MCP Servers
- 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
- AlicenseNot gradedqualityCmaintenanceEnables AI agents from an MCP client to control Google Flow through a signed-in Chrome session, generating videos and images with Veo, Nano Banana, and Omni while managing projects, assets, scenes, characters, and shot lists with spending-approval guards and a sandboxed file vault.5MIT
- AlicenseBqualityCmaintenanceEnables any MCP-compatible AI agent to generate videos and images from text or reference frames, chain scenes into seamless multi-scene films with sound and speech, and download finished media with manifests and previews. It also exposes account status, plan limits, history and library management through confirm-gated, safe-by-default operations.2634MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to generate and edit images, create Veo and Omni videos, upscale media, and interact with Google Flow's creative agent by driving a Chrome window signed in to the user's own Google account, using their existing plan and credits with no API key and with credit-spend safeguards.18300 npm7MIT