Google Flow MCP
# ๐ฌ Google Flow MCP Template
> **Universal, High-Performance Background MCP Server & Browser Bridge**
> Seamless, silent browser automation for **Google Flow (`flow.google.com`)** (Veo 3.1 & Imagen) and modern web applications.
> Runs 100% headlessly in the background without popups or manual port wrangling. Ready to use as a **GitHub Template**.
[](https://github.com/csmc387-cloud/google-flow-mcp/generate)
[](https://modelcontextprotocol.io)
[](https://opensource.org/licenses/MIT)
[]()
---
## ๐ Privacy, Security & 100% Local Isolation
This template is designed from the ground up for **complete individual privacy and security**:
* ๐ค **Your Own Google Account:** You authenticate exclusively with your own Google account into your own personal Google Flow creative workspace. No accounts, projects, or generations are ever shared.
* ๐ป **Your Own Local Browser:** The MCP server launches the Chromium browser installed directly on your machine (Google Chrome, Brave, Arc, Edge, or Chromium).
* ๐ **100% Local Execution (Stdio):** The server runs strictly as a local subprocess on your machine using standard input/output (`stdio`). It does NOT expose any external network ports or web servers to the internet.
* ๐ก๏ธ **Isolated Session Storage:** Your login cookies and auth tokens are saved only on your local filesystem (`~/.google-flow-mcp/profile`). Session directories are strictly ignored by `.gitignore` and can never be committed or uploaded.
* ๐ซ **Zero Telemetry:** No analytics, no third-party APIs, and no telemetry. All web communication occurs directly between your local browser and Google's official servers (`flow.google.com`).
---
## โก Why This Template Exists
Google Flow and other AI creative studios provide cutting-edge video and image models, but lack official REST APIs. Standard automation tools usually:
1. Pop up disruptive browser windows across your screen.
2. Require tedious manual Chrome terminal flags (`--remote-debugging-port=9222`) before every launch.
3. Are hardcoded to one operating system or one browser.
**Google Flow MCP Template** is a universal, ready-to-fork solution:
* ๐ฅท **Silent Background Execution:** Runs modern Chromium in headless mode (`--headless=new`). Zero windows popping up on your screen.
* ๐ **Cross-Platform & Multi-Browser:** Automatically detects **Google Chrome, Chromium, Arc, Brave, and Edge** on **macOS, Linux, and Windows**, with optional `BROWSER_PATH` override.
* ๐ **Seamless Auto-Connection:** Automatically discovers running debugging sessions or self-heals by spawning a quiet headless instance. No manual port setup needed.
* ๐ **Persistent Authentication:** Saves your Google login cookies & tokens to your local home directory. Authenticate once, and subsequent generations run automatically in the background.
* ๐งช **Built-in Universal Test Suite:** Verify browser discovery, headless lifecycle, DOM inspection, and screenshot capture in 5 seconds with `npm test`.
* ๐ฏ **Custom Target URL:** Defaults to Google Flow, but can bridge **any web application** simply by setting `FLOW_URL` or `TARGET_URL`.
---
## ๐ ๏ธ MCP Tools
| Tool | Description |
| :--- | :--- |
| `flow_status` | Checks local background browser connection, current page, and login status. |
| `flow_launch_browser` | Switches execution modes (`headed: true` for 1-time login, or `headed: false` for background headless). |
| `flow_open_tab` | Navigates or focuses `https://flow.google.com` (or your custom target URL). |
| `flow_inspect_canvas` | Returns structured, lightweight JSON of prompt inputs, action buttons, and canvas nodes. |
| `flow_execute_prompt` | Injects prompts into Google Flow's generation bar and submits them seamlessly. |
| `flow_click` | Precision click handler using CSS selectors, text matches, or aria-labels. |
| `flow_screenshot` | Captures background high-res screenshots and saves to your local disk. |
| `flow_eval_js` | Runs custom JavaScript in the active page context on your local browser. |
---
## ๐ Quickstart for Anyone
### 1. Create Your Own Repo from this Template
Click the green [**Use this template**](https://github.com/csmc387-cloud/google-flow-mcp/generate) button on GitHub, then clone your repository:
```bash
git clone https://github.com/<your-username>/<your-repo-name>.git
cd <your-repo-name>
npm install
```
### 2. Log in to YOUR Google Flow Account (One-Time Setup)
Run the guided local authentication wizard:
```bash
npm run setup
```
* This opens a browser window on your computer.
* Sign in to **your** personal Google Account on `flow.google.com`.
* The wizard automatically detects when you are logged in, saves your session locally to `~/.google-flow-mcp/profile`, and closes the window.
### 3. Test Your Local Browser Connection
Run the universal test suite to verify your local browser discovery and background connectivity:
```bash
npm test
```
Outputs:
```text
๐งช Starting Google Flow MCP Universal Connection Test
[1] Testing: Browser Executable Discovery... โ PASSED
[2] Testing: Headless Background Lifecycle... โ PASSED
[3] Testing: Target Page Navigation & Auth State... โ PASSED
[4] Testing: Workspace Inspection & Node Parsing... โ PASSED
[5] Testing: Page Context JavaScript Evaluation... โ PASSED
[6] Testing: Silent Background Screenshot Capture... โ PASSED
[7] Testing: Graceful Teardown & Resource Cleanup... โ PASSED
๐ ALL TESTS PASSED (7/7)
```
### 4. Verify Background Status Anytime
```bash
npm run status
```
---
## โ๏ธ MCP Host Configuration
Add this server to your local Antigravity, Claude Desktop, Cursor, or Windsurf MCP configuration:
```json
{
"mcpServers": {
"google-flow": {
"command": "node",
"args": [
"/absolute/path/to/your/cloned/google-flow-mcp/index.js"
]
}
}
}
```
---
## ๐ง Environment Variables
Copy `.env.example` to configure custom behavior:
| Variable | Description | Default |
| :--- | :--- | :--- |
| `BROWSER_PATH` | Explicit path to a browser binary | Auto-detected |
| `FLOW_DEBUG_PORT` | Remote debugging port | `9222` |
| `FLOW_URL` | Target web application URL | `https://flow.google.com` |
| `FLOW_PROFILE_DIR` | Session and cookie persistence directory | `~/.google-flow-mcp/profile` |
---
## ๐ Project Architecture
```
google-flow-mcp/
โโโ index.js # Root executable entry point
โโโ package.json # Scripts ("start", "setup", "status", "test"), deps
โโโ README.md # Universal template documentation
โโโ LICENSE # MIT License
โโโ .gitignore # Ignores profiles, screenshots, logs, node_modules
โโโ .env.example # Example configuration options
โโโ test/
โ โโโ test-connection.js # Automated 7-step connection test suite
โโโ src/
โโโ browser.js # Cross-platform browser discovery & headless lifecycle
โโโ flow.js # Google Flow semantic DOM actions & prompt injection
โโโ index.js # Model Context Protocol stdio server & tool dispatchers
```
---
## ๐ License
MIT ยฉ [csmc387-cloud](https://github.com/csmc387-cloud)
TDQS
Scored across 8 tools
Most tools have clearly distinct purposes: status, browser launch mode, tab navigation, canvas inspection, prompt execution, clicking, screenshot, and JS eval. The only mild overlap is flow_launch_browser vs flow_open_tab and the low-level flow_click vs flow_eval_js, but the descriptions distinguish them adequately.
All tools use a consistent flow_ prefix with snake_case, and most follow a verb_noun shape (launch_browser, open_tab, inspect_canvas, execute_prompt). flow_status is a minor noun-only deviation, but overall the convention is predictable.
Eight tools is well-scoped for a browser-automation server, covering setup, navigation, inspection, action, and debugging without redundancy. Each tool earns its place.
The surface covers the full browser-automation lifecycle: connection/status, launch mode, navigation, inspection, prompt execution, clicking, screenshots, and arbitrary JS. Minor gaps exist (no explicit text/typing, scroll, or wait tools), but flow_eval_js and flow_click let agents work around them.