Skip to content

serve (MCP) parity: expose video extend / scene / chain, and a models-catalog tool #880

Closed as not planned

Description

@ai4U23

Context

We run Google Flow automation in production on top of gflow serve (0.79.0, migrated flow.google.com host, single ULTRA profile) — it drives our studio MCP server. Huge thanks for the migrated-host work in 0.73–0.79: the --end-frame port (#831), the picker-confirm/run-unique fixes (#793/#800), and the native daemon bearer auth made our deployment strictly simpler. omni-flash first+last-frame i2v via serve is live-verified on our side and has become our workhorse.

The project docs state CLI↔MCP parity as a contract for serve. Today several CLI video operations have no serve equivalent, so MCP clients either shell out to the CLI or lose the capability entirely:

Gaps (CLI has it, serve doesn't)

  1. gflow video extend — continue an existing clip by N seconds. This is the biggest one for pipeline work: extend rides the direct-wire batchAsyncGenerateVideoExtendVideo route and its own poller, so exposing it via serve looks mechanical (same args the CLI takes: media_id, scene_id, position, prompt, aspect, model).
  2. gflow scene (and video chain) — compose ordered/trimmed clips into a Scene, and manifest-driven I2V chaining. Multi-clip assembly from an MCP client currently requires N round-trips of media ids through a side channel.
  3. A models-catalog serve tool (gflow_list_models or similar). gflow models --json returns the live image/video catalog (names, aliases, ref caps, durations). MCP clients today hardcode catalogs — ours ships a dated snapshot because we can't read one. Note: on migrated accounts projectInitialData (labs tRPC) 401s for us (the auth: login verification never passes for accounts migrated to flow.google.com (labs NextAuth absent → GOOGLE_SESSION_ONLY forever) #791 family), so a serve-side models tool would ideally read the CLI's static catalog table rather than the tRPC listing.

What we're not asking for

Not asking for new Flow capabilities (no upscale/v2v asks — we know UNSUPPORTED_ON_BATCH_API and the post-migration API surface), only serve exposure of operations the CLI already drives today.

Offer

Happy to contribute: we already maintain an MCP-over-HTTP client against serve with typed tool schemas, tests, and a bearer-auth pattern that matches your _BearerAuthMiddleware. If the shape of gflow_extend_video / gflow_scene_* tools is up for discussion, we'd love to align on signatures that work for both sides (we filed #791-adjacent and #793 contributions before).

Environment: gflow-cli 0.79.0, serve via launchd (0.0.0.0 + GFLOW_DAEMON_TOKEN), migrated account (OSID/SSO cookies, Playwright session), macOS arm64.

Activity

  1. ffroliva commented on Sep 20, 2026

    @ffroliva
    Owner

    This is a good issue — it names the contract correctly and it names three gaps that are genuinely different from each other. Taking them in reverse order of difficulty, because your framing has the sizing inverted on two of them.

    Gap 3 — models catalog: agreed, and it is the smallest thing in this issue

    You are right, and the current exemption is wrong. It reads:

    "models": "informational; models are enumerated in the generate tools' descriptions"

    Prose in a tool description is not a catalog. It has no ref_cap, no max_duration, no alias list, and nothing machine-readable — which is exactly why you ship a dated snapshot. That exemption should never have survived an option-level look.

    The good news is it is nearly free. cli_models.build_catalog() is already pure, Click-free and does no I/O — it derives everything from the Model / VideoModel enums and the alias maps, so it cannot drift from what the generation commands accept. The tool is a wrapper over it.

    And your instinct about projectInitialData is right: a catalog tool must not touch the labs tRPC listing. Beyond the 401s you are hitting, project.createProject on that surface now answers 404 "Flow RPCs have been deprecated and disabled". A tool reading the static table stays correct on both hosts and spends nothing.

    Filed as #883. Yours if you want it — see below.

    Gap 1 — extend: agreed in principle, but it is not mechanical, and it is blocked

    Two things in front of it.

    It is not an adapter. The exemption's reasons are still live: an extend chain runs for minutes and is not wired to FlowWorker, so a direct-execution MCP tool blows the client's tool-call timeout — that is #481, and it is the reason gflow video chain sits in the same bucket. The port is "enqueue through the worker like gflow_generate_video does", not "wrap the CLI args". It also spends credits behind a confirmation prompt that has no MCP equivalent, so it needs a GFLOW_MCP_NO_SPEND decision before it ships.

    #882 is in the way. There is an open PR rewiring extend onto flow.google.com via batchexecute fZytfe (it is good work — live-verified with a boundary-frame comparison). An MCP twin written now conflicts with it. That PR has an open question about a bypassed project guard on the migrated arm; once it lands, the twin is unblocked.

    Filed as #884, blocked on #882 and #481.

    Gap 2 — split, because scene and chain are not the same ask

    gflow scene create is a fair port. It composes clips the user already paid for; it is free and server-side. That is the same reasoning that made data download non-exempt in #865 — an agent whose pipeline needs assembly is stranded exactly as a CLI user would be. Filed as #885.

    video chain and movie run stay exempt for now. Both are minutes-long, credit-spending, and not worker-enqueued — the #481 shape again. They come back the moment the worker-enqueue work lands, and #884 is the one that pulls that thread.

    On the offer — yes, please

    You have landed #793 before, so this is not a cold start.

    #883 (models catalog) is yours if you want it. Suggested shape, so we do not discover a disagreement at review time:

    gflow_list_models() -> dict
    # returns build_catalog() verbatim:
    #   {"image": {"models": [{name, aliases, ref_cap, default}], "aspects": [{ratio, wire}]},
    #    "video": {"models": [{name, aliases, ref_cap, max_duration}], "aspects": [...], "tiers": [...]}}

    No arguments, no profile, no browser, no spend. Register it beside gflow_list_tools in src/gflow_cli/mcp/tools.py, move "models" from _MCP_EXEMPT to CLI_TO_MCP in tests/mcp/test_cli_parity.py, and add the tool to docs/MCP.md.

    One thing the repo will ask of you that is easy to miss: the MCP twin is its own surface, so it needs its own run. A passing unit test is not the gate here — please exercise the tool over a live serve and paste the result. For a read-only, zero-credit tool that is a ~60s exercise, and there is precedent: the credits twin in tests/e2e/test_credits_mcp_e2e.py is 3 assertions and 58 seconds.

    Say the word and #883 is assigned to you. If you would rather I take it, that is fine too — it is small enough that I would rather it exist than wait.

    Thanks for the detail in the report, and for saying plainly what you are not asking for. That paragraph saved a round trip.

  2. ffroliva commented on Oct 19, 2026

    @ffroliva
    Owner

    Closing this as split into three tracked issues:

    video chain stays exempt until worker enqueue lands (#481 / #884). Your offer to contribute still stands on any of them, and #883 is the smallest. Thanks for the clear write-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions