Complete integration guide for connecting Flow Agent to AI assistants (Claude Desktop, Cursor, Antigravity, Zed, Cline) using the Model Context Protocol (MCP).
Flow Agent implements the MCP standard (protocolVersion: 2024-11-05) over JSON-RPC 2.0. It exposes five native generation, balance, and asset tools to LLM agents.
The MCP server supports two transport mechanisms:
- Stdio (Standard Input / Output): Used by local desktop clients such as Claude Desktop, Cursor, and IDE extensions.
- SSE (Server-Sent Events over HTTP): Used by web applications and distributed agent systems.
Open your Claude Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Add the flow-agent entry:
{
"mcpServers": {
"flow": {
"command": "python3",
"args": [
"/Users/akashyadav/Akash/Flow-Agent-Work/flow-agent/main.py",
"mcp"
]
}
}
}Restart Claude Desktop. You will see the Flow tools available in Claude's tool picker.
In your IDE settings or MCP configuration:
{
"name": "flow-agent",
"command": "python3",
"args": ["/Users/akashyadav/Akash/Flow-Agent-Work/flow-agent/main.py", "mcp"],
"transport": "stdio"
}To run the MCP server over HTTP Server-Sent Events (default port 8002):
python main.py mcp --sse --port 8002- SSE Stream Endpoint:
GET http://127.0.0.1:8002/sse - RPC Message Endpoint:
POST http://127.0.0.1:8002/messages
Generates an image from a prompt on Google Flow.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt |
string |
Yes | — | Description of the scene or subject to draw. |
aspect |
string |
No | "1:1" |
Aspect ratio: "1:1", "16:9", "9:16", "4:3", "3:4", "square", "landscape", "portrait". |
count |
integer |
No | 1 |
Number of variations (1 to 4). |
model |
string |
No | "narwhal" |
Engine model: "narwhal", "harbor_seal". |
all_accounts |
boolean |
No | false |
Distribute the prompt across all signed-in accounts at once. |
{
"name": "flow_generate_image",
"arguments": {
"prompt": "futuristic flying supercar over neo tokyo skyline at dusk, 8k",
"aspect": "16:9"
}
}Generates an animated video clip from text or an image.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt |
string |
Yes | — | Video action or scene description. |
aspect |
string |
No | "16:9" |
"16:9", "9:16", "landscape", "portrait". |
duration |
string |
No | "8s" |
Duration: "4s", "6s", "8s", "10s". |
quality |
string |
No | "720p" |
"720p" or "360p". |
start_image |
string |
No | null |
Local image path or uploaded media ID to animate. |
Retrieves credit balances across all registered accounts.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
refresh |
boolean |
No | false |
If true, sends live probes to Google Flow servers. If false, returns instant SQLite cached values. |
Reports total historical generations, success/failure counts, and credits spent.
No parameters required.
Uploads a local video file and registers it as a reusable media ID for video editing.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
path |
string |
Yes | — | Absolute or relative path to the local video file. |
You can test the MCP server directly using Python:
import asyncio
from flow_agent.mcp_server import handle_message
async def test():
req = '{"jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {}}'
response = await handle_message(req)
print("MCP Tools Response:", response)
asyncio.run(test())