# Go Bananas: full agent reference > Multi-tenant AI image generation on Cloudflare Workers, as a remote MCP server, REST API and CLI. > Site: https://gobananasai.com · MCP: https://mcp.gobananasai.com · Short index: https://gobananasai.com/llms.txt ## What is Go Bananas? Go Bananas! is a Model Context Protocol (MCP) server for AI image generation and editing. It runs on Cloudflare Workers and uses tenant-enabled Gemini, OpenAI and BytePlus image models. Key capabilities: - **60 MCP tools** for subscription generation, provider generation, durable generation jobs, posters, editing, video handoff, reusable assets, gallery projects and tags, model discovery, quota/cost checks, and analytics - **Conversational editing** with session memory (`continue_editing`) - **Persistent libraries**: characters, products, style presets, and reference groups - **REST API** that mirrors the MCP surface - **Multi‑tenant SaaS architecture** with per‑tenant isolation and quotas --- ## Quick Start: Connect MCP Clients ### Remote HTTP OAuth Use this when the client supports remote MCP OAuth. Claude Code: ```bash claude mcp add --transport http -s user go-bananas https://mcp.gobananasai.com ``` Codex: ```bash codex mcp add go-bananas --url https://mcp.gobananasai.com codex mcp login go-bananas ``` Claude.ai / Claude Desktop connector URL: ```text https://mcp.gobananasai.com ``` ### Local STDIO Proxy Use this when the client needs a command-based MCP server. First authenticate locally: ```bash npx -y gobananas-cli auth login ``` Add to `claude_desktop_config.json`: ```json { "mcpServers": { "go-bananas": { "command": "npx", "args": ["-y", "gobananas-mcp"], "env": { "GO_BANANAS_SERVER_URL": "https://gobananasai.com", "GO_BANANAS_MCP_TRANSPORT": "streamable-http", "GO_BANANAS_PROJECT": "off" } } } } ``` `GO_BANANAS_PROJECT` is `off` because Claude Desktop runs one connector for the whole app, so its folder says nothing about your project. For CI/headless clients, add `GO_BANANAS_API_KEY` to the same `env` object. Do not mix direct HTTP and STDIO configs under the same `go-bananas` server name/scope. `gobananas-cli auth login` only authenticates the STDIO proxy, not a separate direct HTTP URL. Then ask Claude: “Generate an image of a sunset over mountains.” --- ## Authentication REST `/api` requests require an API key: - Header: `X-API-Key: sk_live_xxx` or `Authorization: Bearer sk_live_xxx` - Formats: `sk_live_*` (prod) or `sk_test_*` (test) MCP requests to `/mcp` (or `https://mcp.gobananasai.com`) accept API keys or OAuth access tokens. `/sse` is a legacy transport kept for older clients; use `/mcp`: - `Authorization: Bearer ` --- ## MCP Tools (60) The local STDIO proxy (`gobananas-mcp`) adds a 61st, `go_bananas_diagnose`, which checks the proxy's connection and sign-in. Prompts (not tools): `prompts/list` offers `first_image` (optional `brief`) and `app_icon` (optional `product`); Claude Code connected over HTTP shows them as slash commands (the STDIO proxy forwards them from CLI 1.6.0). Each walks the agent from `get_account_summary`'s `gettingStarted` block to a saved image, and works with no argument. Every tool that makes images also takes `project` and `tags` (see Projects and Tags below). ### ChatGPT Subscription (2) - **get_subscription_status** — Check the signed-in user's connected ChatGPT/Codex subscription. Params: none. When `connected` is false, use `generate_image` with the workspace's own keys; `providerKeysConfigured` says whether it has one. - **generate_with_subscription** — Generate and save one image through that subscription, with no provider API fallback. If it fails because the subscription cannot run (disconnected, allowance used up, runner unavailable), call `generate_image` with `generation_lane: "provider"` and say the workspace's keys were used; never retry a prompt ChatGPT declined. ### Recraft (1) For an SVG file (a vector logo or icon), use `generate_with_recraft`: it makes raster or SVG images on the signed-in user's own Recraft account and credits. Use it only when the user wants an SVG file, a vector logo or icon, or Recraft itself. - **generate_with_recraft** — Make images on the signed-in user's own Recraft account and save them to the gallery. Use it for SVG (vector) images, logos, icons and Recraft styles. Models: `recraftv4_1_vector` (SVG), `recraftv4_1_raster`, `recraftv4_1_flash_raster` (cheapest, 1 credit), the Pro variants, and the default `recraftv4_1`, which picks raster or vector itself. External models such as `bytedance_seedreamv5_pro` and `nano_banana_2p1` work only if the user's Recraft plan includes them. It spends the user's own personal Recraft credits instead of provider keys; saved images still count toward the workspace's monthly storage quota. It needs Go Bananas user OAuth and a Connect Recraft link made once from the Dashboard (`oauth_required` for an API key, `scope_required` without `images:generate` or `recraft:generate`, `recraft_unavailable` when switched off, `recraft_not_connected` otherwise; `recraft_workspace_not_personal` when Recraft's active account is a team workspace). SVG results cannot be edited with the edit tools. Params: `prompt`, `model`, `image_size`, `input_style`, `n` (1 to 4), `client_request_id` (optional: the same ID and params within 24 hours return the first call's images without spending credits again; the same ID with other params is `idempotency_conflict`), `session_id` (optional: the application session the images are saved in; a repeat with the same `client_request_id` must name the same `session_id`). ### Image Generation, Posters, Editing & Media (15) 1. **generate_image** — Create new images (or edit an existing one via `image_to_edit_id`). Key params: `prompt` (req), `n` (1–4), `aspect_ratio` (default `square` unless a scene, style preset or character supplies one), `model_id`, `negative_prompt`, `system_instruction`, `style_preset_id|style_preset_name`, `character_id|character_ids`, `product_id|product_ids`, `reference_group_id|reference_group_ids|reference_group_name`, `reference_mode` (`style`/`add`), `session_id`, `project`, `tags`. 2. **preview_generation** — Show what `generate_image` would send without making an image: the final prompt after presets, scenes, characters, products, `reference_assets` roles, `camera_look` and `reference_sheet`, plus the model, aspect ratio, reference image counts and a quota check with estimated cost. Takes `generate_image`'s inputs (not `client_request_id`, `generation_lane`, `project`, `tags`). Calls no image model, saves nothing, does not run `enhance_prompt`. Workspace-key lane only; OAuth permission `images:read`. 3. **generate_poster** — Generate structured posters, flyers, covers, campaign assets, and editorial layouts from a brief. Key params: `brief` (req), `style`, `title`, `subtitle`, `body`, `footer`, `palette`, `template_image_id`, `hero_image_id`, `logo_image_id`, `model_id`, OpenAI image controls. 4. **list_poster_styles** — List curated poster style IDs and defaults. Params: none. 5. **edit_image** — Edit a stored image by ID. Params: `image_id` (req), `prompt` (req), `negative_prompt`, `aspect_ratio`. 6. **upload_image_for_editing** — Upload a public image URL, or a local file with `file_path` (the STDIO proxy uploads it; a direct connection gets a one-time upload link and a curl command), so it can be edited. Params: `image_url` (req), `file_name`, `mime_type`. 7. **edit_uploaded_image** — Edit an uploaded image (step 2 of upload workflow). Params: `image_id` (req), `edit_prompt` (req), `negative_prompt`, `aspect_ratio`. 8. **continue_editing** — Edit the newest image in a session. Params: `prompt` (req), `negative_prompt`, `aspect_ratio`, `session_id` (the session the earlier reply named; needed when each call starts a new session, as on Claude.ai and Cowork). 9. **batch_generate** — Generate multiple prompts in one queued batch (up to 4 at a time). Params: `items` (req, 1-8, each with `prompt` and optional `model_id`, `resolution_tier`, `aspect_ratio`, `negative_prompt`, `system_instruction`, `style_preset_name`), `defaults`, `session_id`. 10. **get_image_info** — Fetch metadata + edit lineage, and the image's project and tags. Params: `image_id` (req). 11. **get_session_history** — List images in the current session. Params: `limit`, `offset`. 12. **search_images** — Search image library with filters; each result shows its project and tags. Params: `filters{ prompt_substring, operation_type, aspect_ratio, created_after, created_before, has_synthid, style_preset_*, product_reference_*, project, tags }`, `limit`, `offset`, `sort_order`. `project` is a name or key, or `none` for images without one; an image must have every tag in `tags`. 13. **upload_media** — Upload video, audio or image to a durable public URL (extension preserved, max 200 MB). Params: `media_url` or `file_path` (the STDIO proxy uploads it; a direct connection gets a one-time upload link and a curl command), `file_name`, `mime_type`. 14. **request_higgsfield_video** — Submit async Higgsfield image-to-video jobs from stored image IDs or public URLs. 15. **get_higgsfield_video_status** — Poll Higgsfield request status and return completed MP4 URLs. Note: `reference_images` is an advanced field intended for frontend‑provided R2 keys; MCP users should prefer characters/products/reference groups. ### Durable Generation Jobs (3) Use these for long or unattended work: the job keeps running if the connection drops. - **start_generation** — Start a durable `generate_image` job (same inputs, one request per job) and get an `execution_id`. Set `sync_timeout_ms` (max 25000) to wait briefly and receive images inline; otherwise poll. Repeating a call with the same `idempotency_key` returns the same job. At most 3 unfinished jobs per workspace. - **get_generation_status** — Status, progress, log entries and, once completed, images. Params: `execution_id` (req). Only the API key, or OAuth user and client, that started the job can see it. - **cancel_generation** — Cancel a job. A job not yet dispatched never runs; a running one is stopped and nothing is stored. Params: `execution_id` (req). ### Projects and Tags (2) An image is in at most one project and carries up to 20 tags. Names match loosely ("Brand Refresh" = `brand_refresh`). Pass `project` to a tool that makes images only when the user names one, and keep passing it; otherwise the new images go to the project of the image being edited or, with the local connector (the `gobananas-mcp` STDIO proxy, 1.4.0 or later), of the folder you work in (remote HTTP connections send no folder). `project: "none"` keeps them out of every project. `tags` (up to 10) are added only when asked for. - **list_projects** — The workspace's projects (most recent first, with image counts), how many images have no project, and the most used tags. Params: none. Call it to reuse an existing project name. - **organize_images** — Move up to 100 images to a project (a new name creates it), take them out of their project with `project: "none"`, and add or remove tags. Params: `image_ids` (req, 1–100), `project`, `add_tags`, `remove_tags` (up to 10 each); give at least one action. Returns the ids updated, the ids not found, the project and the tags added. ### Style Presets (5) - **create_style_preset** — Save reusable prompt defaults. Params: `name` (req), `prompt`, `negative_prompt`, `system_instruction`, `aspect_ratio`. - **list_style_presets** — List presets. Params: none. - **get_style_preset** — Get one preset by `id` or `name`. - **update_style_preset** — Update preset. Params: `id|name` + fields to change. - **delete_style_preset** — Delete preset. Params: `id|name`. ### Characters (11) - **create_character** — Save a character with optional reference images. Params: `character_name` (req), `base_prompt` (req), `reference_image_ids`, `negative_prompt`, `system_instruction`, `tags`. - **update_character**, **delete_character**, **list_characters**, **get_character** — Manage the library. - **get_character_video** — Retrieve a character reference video as URL or base64. - **refresh_character_identity** — Regenerate a character's identity references as a background job (use `options.dry_run` first). - **get_character_identity_refresh_status** — Poll a refresh job. Params: `job_id` (req). - **revert_character_identity** — Undo the last identity refresh. Params: `character_id` (req). - **generate_with_character** — Generate a scene with one character. Params: `character_id|character_name` (req), `scene_prompt` (req), optional overrides. - **generate_with_multiple_characters** — Multi‑character scenes (2–5). ### Products (6) - **create_product_reference** — Save a product image from URL. Params: `product_name` (req), `product_url` (req), optional notes/tags. - **list_product_references**, **get_product_reference**, **update_product_reference**, **delete_product_reference** — Manage products. - **generate_with_product** — Generate marketing scenes with a product. Params: `product_id|product_name` (req), `scene_prompt` (req). ### Reference Groups (5) - **create_reference_group** — Save a named set of reference image IDs. Params: `group_name` (req), `description`, `reference_image_ids` (1–20). - **list_reference_groups** — Browse groups. Params: `search`, `limit`, `offset`, `sort_by`. - **get_reference_group**, **update_reference_group**, **delete_reference_group** — Manage groups. ### Scenes (5) - **create_scene** — Save a reusable scene preset. - **list_scenes**, **get_scene**, **update_scene**, **delete_scene** — Manage scene presets. ### Models, Analytics & Help (5) - **get_usage_stats** — Usage totals and buckets. Params: `granularity`, `lookback_days`. - **get_account_summary** — Snapshot of libraries, storage, sessions, and recent activity, plus `gettingStarted`: the lane a first image takes now (`subscription`, `provider`, `none`), "about N images left" with the reset date, `canMakeFirstImage` with a `nextStep` when false, and three ready-to-send starters (`suggestedUserPrompts`: send `tool` and `params` as given; add a fresh `client_request_id` only where `idempotencyParam` names it). Also returned as `structuredContent`. Call it first for a new user or "what can you do". - **list_models** — Show tenant-enabled models, defaults, capabilities, and caveats. Nine models exist: `gemini-flash-lite-image` (Nano Banana 2 Lite, default), `gemini-nano-banana-2.1` (Nano Banana 2.1), `gemini-pro-image` (Go Bananas! Pro), `openai-gpt-image-2`, `openai-gpt-image-2.6-flare`, `openai-gpt-image-2.6-sunburst`, `openai-gpt-image-2.5-flare`, `openai-gpt-image-2.5-sunburst`, `byteplus-seedream-5.5` (BytePlus Seedream 5.5: needs the workspace's own BytePlus key; `resolution_tier` `1k` or `2k`, up to 10 reference images, PNG; no transparent background or masked edit). `gemini-flash-image` (the retired Nano Banana 2) is still accepted as an alias of `gemini-nano-banana-2.1`. The GPT Image 2.6 models also take `complexity` (`low`, `medium` or `high`; omitted means `high`), which other OpenAI models refuse with a 400. - **check_quota** — Pre-flight storage/rate/service-health check with approximate provider-cost estimates. - **get_help** — Structured docs for tools/categories/workflows. Params: `tool_name`, `category`, or `workflow`. --- ## REST API Notes - POST bodies use the same snake_case fields as MCP tools. - List/search endpoints may use camelCase query params (see `/api/images` docs).