google-flow-mcp
CLAUDE.md14 starsChanged 4 months agoMITView on GitHub
Guidance for Claude Code and similar agents working in this repo. Humans should read CONTRIBUTING.md instead — it covers the same ground with more context. An MCP server that drives Google Flow (labs.google's Veo / Nano Banana tool) through a real browser session. Flow has no public API, but its frontend is a tRPC client — so this speaks that undocumented API first and falls back to DOM clicking only for surfaces with no endpoint. Read ARCHITECTURE.md before changing the…
The file
We split this CLAUDE.md into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
The cost gate is the point: Never move a budget check to after Approve.
- Distinctive: line 22
Every refusal must happen while rejection is still free.
- Distinctive: line 32
Fail toward a refusal: When wrong about Flow's UI, cost nothing and say which control could not be found.
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Notes for AI coding agents
Guidance for Claude Code and similar agents working in this repo. Humans should read CONTRIBUTING.md instead — it covers the same ground with more context.
What this is
An MCP server that drives Google Flow (labs.google's Veo / Nano Banana tool) through a real browser session. Flow has no public API, but its frontend is a tRPC client — so this speaks that undocumented API first and falls back to DOM clicking only for surfaces with no endpoint.
Read ARCHITECTURE.md before changing the transport layer or the cost gate. It carries the reasoning, not just the shape.
Hard rules
This code spends real money. These are not style preferences.
- The cost gate is the point. Never move a budget check to after Approve. Every refusal must happen while rejection is still free.
- Never guess a tRPC procedure name. A wrong GET is a 404; a wrong mutation can
charge. New endpoints come from
flow_discover_api, not from constants. - Never resubmit an in-flight generation. Completion is detected by diffing the media library, precisely so the composer is never touched twice.
- Never widen a text match near Approve.
checkApproveversus the "Approve, do not ask again" row — seereferences/ui-playbook.md. A loose match disables the cost gate for the whole session. - This server handles no credentials, ever. It attaches to a browser a human signed into. Re-auth walls stop the run and hand back to the human.
- Fail toward a refusal. When wrong about Flow's UI, cost nothing and say which control could not be found.
Before you claim it works
npm run typecheck && npm run lint && npm run format:check && npm test && npm run buildThen confirm the tool surface still loads — a server whose tools fail to register is broken regardless of what compiles:
npm run inspectBrowser-driving code cannot be unit tested. Do not describe it as verified on the basis of a passing build; the README tracks verification status per surface, and it should stay honest.
Layout
src/index.ts— tool and resource registration onlysrc/services/transport.ts— the tiered transport laddersrc/services/generate.ts— the cost gate and generation lifecyclesrc/services/ledger.ts— budget enforcement and the spend audit trailsrc/services/compose.ts— settings, frame attachment, upload, upscalereferences/— credit economics, Veo prompting, and the UI playbook, also exposed as MCP resources
references/ui-playbook.md is the project's institutional memory. If you learn
something about Flow's behaviour, write it there.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

