Google Flow image generation as an MCP tool for Claude Code
Project description
Google Flow MCP ๐จ
MCP server for generating images via Google Flow โ no daily quota limits.
Claude Code (or any MCP client) can generate images using Google Flow's
batchGenerateImages API directly through a Playwright browser context
with your saved authentication, bypassing the Flow Agent chat quota (~10
images/day).
Features
- Text-to-Image โ generate images from text prompts
- Image-to-Image โ use a reference image (pass
reference_image) - No quota limits โ calls the API directly, not through the chat
- Persistent browser pool โ reuses Chrome across generations (faster)
- Auto-retry โ refreshes auth token if it expires
- Progress reporting โ shows generation progress in Claude Code
- No external CLI dependencies โ includes its own auth/login
- Cross-platform โ Windows, macOS, Linux (incl. headless)
Requirements
| Dependency | Notes |
|---|---|
| Python 3.11+ (or uv) | |
| Google Chrome or Playwright's Chromium | For authentication & generation |
| Xvfb (Linux headless only) | For auth login only (MCP server runs headless) |
Installation
Prerequisites
- Python 3.11+
- Google Chrome (for authentication)
- Playwright browsers (for generation)
Install from PyPI (recommended)
pip install flow-mcp
# Or with uv:
# uv pip install flow-mcp
# Install Playwright browsers
playwright install chromium
# Authenticate with Google Flow
flow-mcp auth login
Or install from GitHub
git clone https://github.com/alarconcesar/flow-mcp.git
cd flow-mcp
uv pip install -e .
playwright install chromium
flow-mcp auth login
Usage with Claude Code
Add to your .claude/settings.json:
{
"mcpServers": {
"flow-image-server": {
"command": "uv",
"args": ["run", "flow-mcp"]
}
}
}
Restart Claude Code. The generate_image tool will be available.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
prompt |
string | required | Text description of the image |
model |
enum | nano-pro |
nano2, nano-pro, narwhal, gem_pix_2 |
count |
integer | 1 |
Number of images (1โ4) |
aspect |
enum | 9:16 |
9:16, 16:9, 1:1, 4:3, 3:4 |
reference_image |
string | optional | Path to a local image for I2I |
Examples
Text-to-Image:
Generate an image of a cyberpunk city at night, neon lights, 16:9
Image-to-Image:
Take this photo and make it cyberpunk style,
reference_image: /Users/me/photo.jpg
CLI commands
flow-mcp # Start MCP server (stdio mode)
flow-mcp auth login # Authenticate with Google Flow
flow-mcp auth list # List saved profiles
flow-mcp help # Show help
Environment variables
| Variable | Default | Description |
|---|---|---|
GFLOW_PROFILE |
auto-detected | Profile name |
GFLOW_CLI_HOME |
platform default | gflow-cli data directory |
GFLOW_OUTPUT_DIR |
temp directory | Where to save generated images |
Troubleshooting
Auth expired
flow-mcp auth login
Content filter
Google Flow silently blocks certain prompts (returns None).
Try rephrasing โ avoid violence, NSFW, or trademarked content.
Linux headless
# Only needed for authentication (the MCP server itself runs headless)
Xvfb :99 -screen 0 1280x720x24 &
DISPLAY=:99 flow-mcp auth login --browser internal
The MCP server (flow-mcp) now runs completely headless โ no Xvfb needed for generation.
Profile not found
flow-mcp auth list # list profiles
flow-mcp auth login # create a new profile
Project structure
flow-mcp/
โโโ src/
โ โโโ flow_mcp/
โ โโโ __init__.py # Package metadata & logging config
โ โโโ __main__.py # CLI entry point (auth, server)
โ โโโ server.py # FastMCP tool definition
โ โโโ generator.py # Core generation logic
โ โโโ browser.py # Playwright context & token capture
โ โโโ browser_pool.py # Persistent browser context pool
โ โโโ auth.py # Login, profile list commands
โ โโโ profile.py # Profile resolution
โ โโโ recaptcha.py # reCAPTCHA token minting
โ โโโ chrome_helpers.py # Chrome detection
โ โโโ constants.py # Shared constants
โโโ pyproject.toml
โโโ LICENSE (MIT)
โโโ README.md
License
MIT โ see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flow_mcp-0.3.0.tar.gz.
File metadata
- Download URL: flow_mcp-0.3.0.tar.gz
- Upload date:
- Size: 22.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e46368110c3a622ccead4095b8d7668aaa3b578e8d60233d37fd2f7e89e2688c
|
|
| MD5 |
40457d522949a8d131055558d39a1d48
|
|
| BLAKE2b-256 |
c8db5a13554115d77fdfd58bda3da0425835a938cc1a2f6c9e5d4714f8d0d7a6
|
File details
Details for the file flow_mcp-0.3.0-py3-none-any.whl.
File metadata
- Download URL: flow_mcp-0.3.0-py3-none-any.whl
- Upload date:
- Size: 29.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d57287aba12dfd063c5e819b03557ffe7433364f78d340c825650b7939099431
|
|
| MD5 |
aa3c81767b6a542c5b6cbb3cc7dbe423
|
|
| BLAKE2b-256 |
f3aada8a0322aa9f4b79ab5a9cdb5ef50c93931ba86e1aeb329603c5c2f2ab32
|