agentleFS
roshanarnav25-slothroshanarnav25-sloth/google-flow-mcp/CLAUDE.md

google-flow-mcp

CLAUDE.md15 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
  1. Distinctive:

    The cost gate is the point: Never move a budget check to after Approve.

    line 21
  2. Distinctive:

    Every refusal must happen while rejection is still free.

    line 22
  3. Distinctive:

    Fail toward a refusal: When wrong about Flow's UI, cost nothing and say which control could not be found.

    line 32

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

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. checkApprove versus the "Approve, do not ask again" row — see references/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 build

Then confirm the tool surface still loads — a server whose tools fail to register is broken regardless of what compiles:

npm run inspect

Browser-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 only
  • src/services/transport.ts — the tiered transport ladder
  • src/services/generate.ts — the cost gate and generation lifecycle
  • src/services/ledger.ts — budget enforcement and the spend audit trail
  • src/services/compose.ts — settings, frame attachment, upload, upscale
  • references/ — 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.