Skip to main content
Glama

Yenflow

Stateless Model Context Protocol (MCP) server and automation engine for Google Flow (Veo video and Imagen generation).

Designed for AI agents (Claude, Cursor, Pi, Zed, Windsurf) to orchestrate professional video and image generation with zero local database requirements and zero window disruptions.


Key Highlights

  • Stateless MCP Core: The MCP client maintains the entire workflow state machine (prompts, scene sequence, hashes, approvals, and media IDs). The server requires no local database, migrations, or persistent disk lock-in.

  • Silent Background Execution: Driven entirely through headless Playwright (headless=True, background=True). Zero visible Chrome windows, zero user focus stealing on macOS/Linux.

  • Two-Phase Credit Lock: Paid video generation requires generating a deterministic plan hash (plan_sha256) and explicit client approval confirmation before spending credits.

  • Project Defaults:

    • Model: omni_flash (Omni 1.1 Flash)

    • Resolution: 360p (native Flow resolution)

    • Aspect Ratio: 16:9 (landscape)

    • Duration: 4s per scene

  • Multi-Scene I2V Batch & Stitch: Full toolset to plan scenes, generate clips, poll completion, and stitch into a final MP4 via ffmpeg.


Related MCP server: google-flow

MCP Server Configuration

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "yenflow": {
      "command": "uvx",
      "args": ["yenflow", "mcp", "run"]
    }
  }
}

Pi Coding Agent (~/.pi/agent/mcp.json)

{
  "mcpServers": {
    "yenflow": {
      "command": "yenflow-mcp"
    }
  }
}

Direct Python / Stdio

python -m yenflow.mcp
# or
yenflow mcp run

Streamable HTTP (Spec Transport)

yenflow serve --transport http --port 8000

MCP Tools Reference

Tool

Description

State Handling

flow_plan_batch

Validates scenes, estimates credit cost, and computes deterministic plan_sha256.

Pure/Stateless: returns plan structure and hash directly to client.

flow_generate_scene

Generates a single scene end-to-end in silent headless background mode. Returns local MP4 path.

Gated by approved=True. Output saved to requested path.

flow_submit_scene

Submits scene to Flow and returns media_id immediately for client-driven tracking.

Gated by approved=True. Client tracks media_id.

flow_poll_scene

Checks status of a generation by media_id and project_id.

Stateless: queries Flow directly, returns status to client.

flow_stitch_video

Stitches multiple clip paths into a final video with optional audio via ffmpeg.

Concatenates files and validates resolution/duration.

gflow_generate_video

Full Veo video generation (t2v, i2v, r2v) with optional character references.

Standalone video generation.

gflow_generate_image

Google Imagen text-to-image and image-to-image generation.

Standalone image generation.

gflow_get_credits

Query current Google Flow credit balance.

Read-only check.

gflow_auth_status

Verify Google Flow session status.

Read-only probe.


Stateless Batch Workflow Example

An AI agent orchestrating an Image-to-Video story follows a clean 4-step sequence:

[Agent / MCP Client]                                   [Yenflow MCP Server]
       |                                                        |
       |  1. flow_plan_batch(scenes=[...])                      |
       |------------------------------------------------------->|
       |<-------------------------------------------------------|
       |     Returns { plan_sha256, estimated_credits, scenes } |
       |                                                        |
       |  2. Review plan_sha256 & confirm approval              |
       |                                                        |
       |  3. flow_generate_scene(..., approved=True)           |
       |------------------------------------------------------->|
       |<-------------------------------------------------------|
       |     Returns { status: "completed", local_path: ... }   |
       |                                                        |
       |  4. flow_stitch_video(clip_paths=[...])                |
       |------------------------------------------------------->|
       |<-------------------------------------------------------|
       |     Returns { status: "completed", output_path: ... }  |

CLI Commands

Yenflow also includes a complete Click CLI:

# Check Google Flow authentication
yenflow auth status

# Check available credits
yenflow credits

# Run health diagnostics
yenflow doctor

# Start MCP stdio server
yenflow mcp run

# Start MCP HTTP server
yenflow serve --port 8000

Quality & Verification Gates

# Lint & Format
ruff check src tests
ruff format --check src tests

# Static Type Verification
pyright src

# Test Suite
pytest -q tests/auth/test_verification.py tests/test_flow_batch.py tests/mcp

License

MIT License.

Available Tools

25 tools
flow_generate_sceneC

Generate a single video scene end-to-end in silent headless background mode. Returns the local path to the generated MP4 file upon completion.

Inputs: prompt (required), start_frame (required), model, aspect, +9 more. Returns: object

flow_plan_batchA

Plan an I2V video batch statelessly. Validates scenes and parameters, computes credit cost and deterministic SHA-256 plan hash, and returns the plan state to the MCP client. Zero server-side persistence.

Inputs: scenes (required), count, model, aspect, +4 more. Returns: object

flow_poll_sceneA

Statelessly check Google Flow for the completion status of a video generation by media ID and project ID.

Inputs: media_id (required), project_id (required), profile. Returns: object

flow_stitch_videoB

Stitch multiple MP4 video clip files together into a single unified video with optional audio track using ffmpeg.

Inputs: clip_paths (required), output_path (required), audio_path. Returns: object

flow_submit_sceneB

Submit a single video scene to Google Flow in silent background headless mode (zero window popups, no stolen focus). Returns media_id immediately to the client for tracking.

Inputs: prompt (required), start_frame (required), model, aspect, +7 more. Returns: object

gflow_auth_statusA

Non-interactive, credit-free Flow session probe (#497). Call this BEFORE a generation tool to fail fast on expired auth — the queue is async, so an auth failure otherwise surfaces only later from the daemon. Never starts an interactive login flow; may boot a short-lived headless browser only if cookie decryption requires the Playwright fallback. May take up to ~45s on a slow network.

Inputs: profile. Returns: object

gflow_character_listA

List the saved Flow CHARACTER entities in a project, with their entity ids. Read-only and spends no credits. Call this to discover what you can attach: an id goes to reference_entities on the generate tools, and a display_name can be used as an @Name mention in a prompt (same wire, they dedupe). Drives a browser session, so it is slower than the catalog tools.

Inputs: project (required), profile. Returns: object

gflow_character_showA

Show one saved Flow CHARACTER entity by id or by exact display name. Read-only and spends no credits. Exactly one of entity_id or name is required; an ambiguous name is an error rather than a guess, which is the reason to prefer the id. Drives a browser session.

Inputs: project (required), name, profile, entity_id. Returns: object

gflow_character_voicesA

List the preset voices available for a Flow Character's TTS. Static lookup — no network, no browser, no cost. Call it before creating a character to choose a valid voice name.

Inputs: no named parameters. Returns: object

gflow_generate_imageA

Generate an image using Google Flow's Imagen model. Produces 1-4 images from a text prompt. Models: nano2 (fast), nano-pro (balanced), image4 (highest quality). Aspects: 1:1, 9:16, 16:9, 4:3, 3:4. The prompt supports @AssetName mentions to tag saved project characters/assets by name (resolves to referenceEntities/referenceImages). Reference a SAVED named asset via @Name; reference an arbitrary one-off image via reference_images. See docs/REFERENCE_STRATEGIES.md. On accounts served from flow.google.com, use an existing project and local reference files; UUID/entity references and image4 are not ported to that composer yet and fail before submit; retrying will not clear it. Returns local file paths to the generated images.

Inputs: prompt (required), seed, wait, count, +12 more. Returns: object

gflow_generate_videoA

Generate a video using Google Flow's Veo model. Modes: t2v (text-to-video), i2v (image-to-video), r2v (reference-to-video). Aspects: 9:16, 16:9. Optional model (veo_lite/veo_fast/veo_quality/omni_flash), duration (seconds), and count select the Veo model, clip length, and batch size (CLI parity). The prompt supports @CharacterName mentions to tag saved project characters by name (resolves to referenceEntities). Reference a SAVED character via @Name; pass one-off ingredient images via reference_images. See docs/REFERENCE_STRATEGIES.md. Optional ui_mode ('classic'/'auto') verifies the classic editor pre-submit and aborts before spending credits if unreachable; 'agentic' is not supported for video. Returns the local file path to the generated video.

Inputs: prompt (required), mode, wait, count, +14 more. Returns: object

gflow_get_creditsA

Read the current Google Flow credit balance for one saved profile or all profiles. This is read-only and spends no credits. Set all_profiles=true when choosing an account for generation; partial profile failures remain visible in the result.

Inputs: profile, all_profiles. Returns: object

gflow_instructions_addA

Add a persistent instruction card to a Flow project's Agent-Mode brief (credits-free). Each ref is classified automatically: local image path → uploaded as an image reference; asset UUID → image reference; anything else → character id/name.

Inputs: text (required), title (required), project (required), refs, +2 more. Returns: object

gflow_instructions_applyA

Declaratively FULL-SYNC a Flow project's brief: REPLACES all existing instruction cards with the given set (destructive — cards not listed are removed). Each card is {'title', 'text', 'ref': [...], 'enabled'}. Credits-free.

Inputs: cards (required), project (required), profile. Returns: object

gflow_instructions_listB

List a Flow project's persistent Agent-Mode instruction cards (reads the live server brief). Credits-free.

Inputs: project (required), profile. Returns: object

gflow_instructions_rmB

Remove one instruction card from a Flow project's brief, selected by title or card id (exactly one). Credits-free.

Inputs: project (required), title, card_id, profile. Returns: object

gflow_instructions_set_enabledB

Enable or disable one instruction card on a Flow project's brief, selected by title or card id (exactly one). Credits-free.

Inputs: enabled (required), project (required), title, card_id, +1 more. Returns: object

gflow_instructions_toggle_modeA

Turn a Flow project's brief master switch on or off. When off, NO cards apply even if individually enabled. Cards are left untouched. Credits-free.

Inputs: enabled (required), project (required), profile. Returns: object

gflow_list_projectsA

List all projects in the local gflow catalog. Returns project IDs, names, and creation dates from the SQLite database.

Inputs: limit, offset, profile. Returns: object

gflow_list_toolsA

List available gflow prompt tools (name, title, description, category).

Inputs: no named parameters. Returns: object

yenflow_generate_sceneD

Alias for flow_generate_scene.

Inputs: prompt (required), start_frame (required), model, aspect, +9 more. Returns: object

yenflow_plan_batchD

Alias for flow_plan_batch.

Inputs: scenes (required), count, model, aspect, +4 more. Returns: object

yenflow_poll_sceneD

Alias for flow_poll_scene.

Inputs: media_id (required), project_id (required), profile. Returns: object

yenflow_stitch_videoD

Alias for flow_stitch_video.

Inputs: clip_paths (required), output_path (required), audio_path. Returns: object

yenflow_submit_sceneD

Alias for flow_submit_scene.

Inputs: prompt (required), start_frame (required), model, aspect, +7 more. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    C2.4/5.0

    Scored across 25 tools

    Disambiguation2/5

    Several tools are exact aliases (yenflow_* for flow_*), creating duplicate entries that an agent must disambiguate. More importantly, gflow_generate_video, flow_generate_scene, and flow_submit_scene all cover video generation but with unclear boundaries, making misselection likely.

    Naming Consistency2/5

    Names are mostly snake_case but mix three prefixes—gflow_, flow_, and yenflow_ aliases—without a clear rule. Verb usage is also uneven: 'rm' instead of 'remove', 'get_credits' vs 'list_*', and 'plan_batch'/'submit_scene'/'generate_scene' follow different patterns.

    Tool Count2/5

    Twenty-five tool names is too many, and five are exact aliases, inflating the count to 25 while only representing about 20 distinct operations. The surface feels heavier than needed, especially with six instruction-card tools and three scene-generation variants.

    Completeness3/5

    The set covers a broad workflow: auth, credits, projects, characters, instruction cards, image/video generation, scene planning/submission/polling, and stitching. However, character creation/update/delete is absent despite character voice and listing tools, and batch planning has no accompanying batch submission tool, creating notable workflow gaps.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      C
      maintenance
      Enables 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.
      23
      12
      MIT