google-flow-mcp-server
This server automates the creation, generation, editing, and aspect ratio modification of sports editorial graphic posters using Google Flow.
Create Projects: Initialize a new Google Flow project with a specified aspect ratio (e.g., 16:9, 4:3, 1:1, 3:4, 9:16) and save the project URL.
Generate Posters: Upload reference images (optionally pre-uploaded to a session-isolated folder) and a custom prompt; the tool pastes them, submits, captures the image edit page URL, and downloads the 1K output poster.
Edit Posters: Refine an existing poster by providing an edit prompt; it captures the updated edit URL and downloads the new variation.
Change Aspect Ratio: Adjust the aspect ratio of a poster (e.g., from 4:3 to 16:9), submits a ratio change prompt, and downloads the resized output.
Session Isolation: Each user gets isolated project states, image uploads, and database entries for safe concurrent use.
Queueing: Concurrent image generation requests are safely queued to prevent conflicts.
Headless Mode: All operations support optional headless browser execution.
Flexible Prompting: Custom prompts are supported for generation, editing, and ratio changes with sensible defaults.
Provides automation for generating sports editorial graphic posters using Google Flow, including scraping and poster generation workflows.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@google-flow-mcp-server generate a poster for tonight's Lakers vs Celtics game"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Google Flow Editorial Poster Scraper & MCP Server
A powerful Playwright-based automation pipeline and FastMCP server for generating, editing, and converting aspect ratios of sports/editorial graphic posters using Google Flow (labs.google/fx/tools/flow).
ā” Server Status & Compatibility Notice
š¢ Local Server (Stable & Recommended)
Running the server locali (STDIO / Local HTTP) is fully tested, stable, and works properly. Local execution provides fast response times and seamless browser session control.
š” Remote Server / VPS Deployment (Beta - In Development)
Remote deployment via VPS / Ngrok streamable HTTP is currently in Beta. While operational, remote operation may experience occasional session/tunnel instability depending on network connectivity and persistent browser locks. Use with caution for production workloads.
Related MCP server: playwright-fixer-mcp
š Project Directory Structure
flow-project/
āāā .env # Environment variables (PUBLIC_BASE_URL, ports, etc.)
āāā .gitignore # Git ignore file
āāā README.md # Project documentation & guide
āāā VPS_DEPLOYMENT_GUIDE.md # Detailed VPS systemd & Ngrok deployment guide
āāā pyproject.toml # UV / Python project dependencies configuration
āāā requirements.txt # Standard pip requirements
āāā main.py # Direct Playwright automation execution script
āāā chrome_profile/ # Persistent Chrome browser profile (Logged into Google)
āāā db/ # Local JSON database storage
ā āāā projects.json # Project session state & edit page URLs mapping
āāā downloads/ # Downloaded high-resolution output posters
āāā input_images/ # Input/reference images folder (organized per session)
āāā screenshots/ # Debug screenshots captured during automation steps
āāā app/ # Core application codebase
āāā __init__.py
āāā config.py # Configuration, selectors, ports, and environment setup
āāā prompts.py # Default Google Flow prompt templates
āāā automation/ # Low-level Playwright UI automation flow
ā āāā flow.py
āāā boss_functions/ # High-level orchestration functions (create, generate, edit, ratio)
ā āāā project_creator.py
ā āāā poster_generator.py
ā āāā poster_editor.py
ā āāā poster_ratio_editor.py
āāā mcp/ # FastMCP Server definition & HTTP/STDIO endpoints
ā āāā server.py
āāā services/ # Helper utilities (browser, clipboard, db, downloads, pasting)
āāā browser_handler.py
āāā clipboard_handler.py
āāā db_handler.py
āāā image_download.py
āāā image_pasting.py
āāā prompt_submission.pyš ļø Prerequisites
Python: 3.10 or higher
Package Manager:
uv(Recommended) or standardpipBrowser: Google Chrome installed on host machine
Google Account: Google account logged in on Chrome (for access to
labs.google/fx/tools/flow)
š Local Setup & Installation Guide
Follow these step-by-step instructions to set up and run the project locally.
Step 1: Clone the Repository
git clone https://github.com/rafin0906/google-flow-mcp-server.git
cd google-flow-mcp-serverStep 2: Install Dependencies & Playwright
Using uv (Recommended):
# Create virtual environment and install dependencies
uv sync
# Install Playwright Chromium browser binaries
uv run python -m playwright install chromiumOr using standard pip:
python -m venv .venv
# On Windows PowerShell:
.venv\Scripts\Activate.ps1
# On Linux/macOS:
source .venv/bin/activate
pip install -r requirements.txt
python -m playwright install chromiumStep 3: Create Required Folders
Ensure all essential directories exist in the project root:
# Windows PowerShell:
New-Item -ItemType Directory -Force -Path "input_images", "downloads", "screenshots", "db", "chrome_profile"
# Linux / macOS:
mkdir -p input_images downloads screenshots db chrome_profileStep 4: Environment Configuration (.env)
Create a .env file in the project root directory:
PUBLIC_BASE_URL=http://localhost:8000
SERVER_HOST=0.0.0.0
SERVER_PORT=8000
MCP_PORT=8001
MCP_TRANSPORT=stdioStep 5: Initialize Chrome Authentication Profile
To enable Google Flow automation without repeating Google logins:
Launch Chrome using the persistent user data directory (
chrome_profile/).Navigate to Google Flow and log into your Google Account.
Once logged in, close the browser. The session cookies will be saved in
chrome_profile/.
š„ļø Running Locally (3 Execution Modes)
Mode A: Direct Script Execution (main.py)
Run the standard Playwright poster generation pipeline directly without MCP:
# Place your reference images inside input_images/ (or subfolder)
uv run python main.pyMode B: FastMCP Server (STDIO Mode for Claude Desktop / Cursor)
Start the MCP server locally over STDIO:
uv run python -m app.mcp.serveror via FastMCP CLI:
uv run fastmcp run app/mcp/server.pyConnecting to Claude Desktop (Local STDIO)
Add the following snippet to your %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"google-flow": {
"command": "uv",
"args": [
"run",
"--directory",
"C:\\MCP Servers\\flow-project",
"python",
"-m",
"app.mcp.server"
]
}
}
}Mode C: Interactive MCP Inspector
Test and debug MCP tools via a local web GUI:
uv run fastmcp dev inspector app/mcp/server.pyš Remote Deployment Guide (VPS & Ngrok) [BETA]
Remote server mode is currently inBeta. You may experience occasional session locks or browser disconnects depending on network conditions.
Step 1: Start MCP Server in HTTP Mode
On your VPS or remote machine:
uv run python -m app.mcp.server http(Server listens on port 8001 with endpoint /mcp)
Step 2: Expose via Ngrok Tunnel
In a separate terminal window, launch Ngrok on port 8001:
npx ngrok http 8001Ngrok will generate a secure HTTPS forwarding URL, e.g., https://xxxx-xxxx.ngrok-free.app.
Step 3: Connect Remote Client
In Claude Desktop / MCP Client:
Remote Server URL:
https://xxxx-xxxx.ngrok-free.app/mcp
Step 4: Web Image Uploader UI (Token-Free Uploads)
For remote users, uploading large image files as Base64 strings can consume substantial LLM context tokens. To solve this, the server provides a built-in Web Uploader UI:
Open
https://<your-ngrok-url>/upload?session_id=<your_session_id>in any browser.Drag & drop your input images.
Images are saved directly to
input_images/<session_id>/on the server and are automatically picked up bytool_generate_poster.
For detailed 24/7 background systemd service setup on Ubuntu VPS, refer to VPS_DEPLOYMENT_GUIDE.md.
š§° Available MCP Tools Reference
MCP Tool Name | Description | Key Parameters |
| Creates a new Google Flow canvas project and selects aspect ratio. |
|
| Generates a Web Uploader URL for token-free image uploading. |
|
| Saves base64 reference images directly into server's session folder. |
|
| Generates a poster by pasting reference images and prompt into Google Flow canvas. |
|
| Refines/edits an existing poster image with an edit prompt. |
|
| Changes aspect ratio of an existing generated poster image. |
|
āļø Key Configuration Settings (app/config.py)
HEADLESS(default:False): Set toTruefor headless execution (required on headless VPS), orFalseto see browser UI steps during local execution.PUBLIC_BASE_URL: Used to generate public image download links when operating in remote HTTP mode.USER_DATA_DIR: Path to persistent Chrome user profile directory (chrome_profile/).
š License
This project is licensed under the MIT License.
Available Tools
4 toolstool_create_projectA
Boss Function 1: Creates a new Google Flow project page, saves the project URL to DB (db/projects.json), and selects the desired aspect ratio.
Inputs: ratio, headless. Returns: object
tool_edit_posterB
Boss Function 3: Edits/refines an existing poster image using the image_edit_page_url stored in DB, submits the editing prompt, captures the updated image edit URL, and downloads the new variation.
Inputs: headless, edit_prompt, image_edit_page_url. Returns: object
tool_generate_posterA
Boss Function 2: Generates a poster in Google Flow: pastes input images and prompt onto the canvas, clicks Send, opens the generated image edit page, records the image_edit_page_url in DB, and downloads 1K output.
Inputs: prompt, headless, image_paths, project_url. Returns: object
tool_poster_ratio_editorA
Boss Function 4: Opens the latest image edit page from DB (db/projects.json), selects the target model aspect ratio, submits the ratio change prompt, captures the updated edit URL, and downloads the output image.
Inputs: ratio, prompt, edit_url, headless. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 4 tools
Each tool targets a distinct step in the poster workflow: create_project sets up a project, generate_poster creates from scratch, edit_poster refines an existing image, and poster_ratio_editor specifically adjusts aspect ratio. There is minor overlap between edit_poster and ratio_editor, but descriptions clarify the difference.
Three tools follow a verb_noun pattern (create_project, generate_poster, edit_poster), while poster_ratio_editor uses a noun_noun pattern with 'editor' at the end. The tool_ prefix is consistent, but the deviation in the last tool's pattern makes it slightly inconsistent.
With only 4 tools, the server is well-scoped for a specific poster generation and editing workflow. Each tool serves a distinct purpose in the pipeline, and the count feels appropriate without being excessive or thin.
The tool set covers the core lifecycle of creating a project, generating a poster, editing it, and adjusting its ratio. Minor gaps exist (e.g., no delete or listing tool), but the primary workflow is fully supported and agents can complete the intended tasks.
Maintenance
Related MCP Connectors
Brand-safe MCP for AI agents to create editable, on-brand graphics and automate variants.
Hosted MCP server for AI agents to post to LinkedIn profiles and X and upload to YouTube.
Automate Google Ad Manager: campaigns, line items, creatives, inventory, reporting ā 51 tools.
Turn PDFs, PPTX decks, product photos, and briefs into QA-checked commercial videos via MCP.
Related MCP Servers
- AlicenseBqualityBmaintenanceMCP server for Chrome Web Store ā upload, publish, status, metadata & Playwright-based UI automation955 npm4MIT
- AlicenseAqualityDmaintenanceAutomated Playwright E2E test repair powered by a self-improving, governed MCP server that runs failing tests, collects failure artifacts, reasons about root causes, validates and applies fixes, and re-runs to verify.12MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for robust browser automation of legacy web portals, featuring exactly-once execution via an SQLite-backed idempotency lock and resilient Playwright locators.MIT
- AlicenseAqualityCmaintenanceAn MCP server that assembles CapCut International projects by reading and writing local project files, adding captions, subtitles, overlays, and more so editors start with a mostly-done timeline. It includes tools for inspecting projects, restyling captions, importing subtitles, and rendering alpha-channel overlays via Remotion.83MIT