Skip to content

MCP Integration ​

Quickest setup: gobananasai.com/connect has copy-ready steps for Claude, ChatGPT, Cursor, VS Code, Claude Code, Codex and Gemini CLI. Claude Code and Codex users can install the go-bananas plugin (server + skill). The MCP address is https://mcp.gobananasai.com; https://gobananasai.com/mcp still works. Go Bananas is listed on the official MCP Registry as com.gobananasai/go-bananas.

Go Bananas! is built as a native Model Context Protocol (MCP) server, enabling seamless integration with AI assistants like Claude. Subscription entries describe an experimental capability available to signed-in users in the public deployment and disabled by default for self-hosting. Tool visibility is not proof of runner availability; see subscription readiness.

What is MCP? ​

The Model Context Protocol (MCP) is an open standard that allows AI assistants to interact with external tools and data sources. Think of it as a universal adapter that lets AI systems:

  • Execute tools - Perform actions like generating images
  • Access resources - Read data from external systems
  • Maintain context - Keep track of conversation state

Why MCP for Image Generation? ​

Traditional image generation APIs require:

  • Manual prompt construction
  • Explicit image ID tracking
  • Session management code
  • Complex error handling

With MCP, you get:

  • Natural language - "Add clouds to the image"
  • Context awareness - AI knows which image you mean
  • Conversational flow - Multi-turn editing workflows
  • Built-in state - Session handled automatically

Available Tools ​

Go Bananas! provides 53 MCP tools organized into categories. The local STDIO proxy (gobananas-mcp) adds a 54th, go_bananas_diagnose, which checks the proxy's own connection and sign-in.

ChatGPT Subscription (2 tools) ​

ToolDescription
get_subscription_statusCheck the current OAuth user’s connected subscription
generate_with_subscriptionGenerate and save one image without provider API fallback

Image Generation, Editing & Video Handoff (13 tools) ​

ToolDescription
generate_imageGenerate images from text prompts
generate_posterGenerate structured posters, flyers, covers, and campaign assets
list_poster_stylesBrowse curated poster style IDs
request_higgsfield_videoSubmit async Higgsfield image-to-video jobs
get_higgsfield_video_statusPoll Higgsfield request status and video URL
edit_imageEdit image by database ID
upload_image_for_editingUpload a public image URL for editing
edit_uploaded_imageEdit user-uploaded images
upload_mediaUpload image, video, or audio to durable storage
continue_editingEdit last image conversationally
get_image_infoGet image metadata
get_session_historyList session images
search_imagesSearch across all images

Style Presets (5 tools) ​

ToolDescription
create_style_presetCreate reusable style template
list_style_presetsBrowse saved presets
get_style_presetGet preset details
update_style_presetUpdate preset settings
delete_style_presetRemove a preset

Characters (11 tools) ​

ToolDescription
create_characterSave character design
update_characterModify character
delete_characterRemove character
list_charactersBrowse character library
get_characterGet character details
get_character_videoRetrieve a character reference video
refresh_character_identityStart a character identity refresh
get_character_identity_refresh_statusPoll identity refresh progress
revert_character_identityRestore previous identity references
generate_with_characterGenerate with character
generate_with_multiple_charactersMulti-character scenes

Products (6 tools) ​

ToolDescription
create_product_referenceSave product from URL
list_product_referencesBrowse products
get_product_referenceGet product details
update_product_referenceUpdate product name, description or tags
delete_product_referenceRemove product
generate_with_productGenerate marketing images

Reference Groups (5 tools) ​

Save and reuse sets of reference images for style transfer or composition:

ToolDescription
create_reference_groupCreate a named group of reference images
list_reference_groupsBrowse saved reference groups
get_reference_groupGet group details and images
update_reference_groupRename or change group contents
delete_reference_groupRemove a reference group

Scenes (5 tools) ​

Save and reuse scene presets with prompts and reference images:

ToolDescription
create_sceneCreate a scene preset
list_scenesBrowse saved scene presets
get_sceneGet scene details
update_sceneModify a scene preset
delete_sceneRemove a scene preset

Models & Analytics (5 tools) ​

ToolDescription
get_usage_statsUsage statistics
get_account_summaryAccount overview
list_modelsTenant model capability discovery
check_quotaPre-flight quota, service health, and cost estimate
get_helpTool documentation

Batch Operations (1 tool) ​

ToolDescription
batch_generateGenerate 1–8 images in parallel

MCP Transports ​

Go Bananas! supports two MCP transport methods:

POST /mcp

Modern, efficient transport with streaming support:

  • Stateless MCP 2026-07-28 via server/discover
  • Automatic legacy Streamable HTTP fallback for negotiating clients
  • Request/response via HTTP POST
  • Server-to-client streaming for real-time updates
  • Better for production deployments

Server-Sent Events (Legacy) ​

GET /sse

Legacy transport

/sse is still served for older MCP clients, but it is legacy. Use /mcp (or https://mcp.gobananasai.com) for every new connection.

Original SSE-based transport:

  • Persistent connection
  • Only for older clients that cannot use Streamable HTTP

Connecting MCP Clients ​

Auth Modes ​

Go Bananas supports both remote HTTP OAuth and a local STDIO proxy:

ModeUse WhenAuth Location
Remote HTTP OAuthYour client can connect directly to https://mcp.gobananasai.com and run MCP OAuthThe client stores OAuth tokens for the remote URL
Local STDIO proxyYour client needs a command-based MCP server or you want API-key/headless authgobananas-mcp reads gobananas-cli OAuth tokens or GO_BANANAS_API_KEY

Do not configure both modes with the same go-bananas name in the same client scope. Authenticate the entry your MCP status screen says it is using.

Claude Code (Remote HTTP OAuth) ​

bash
claude mcp add --transport http -s user go-bananas https://mcp.gobananasai.com

Then run /mcp and click Authenticate.

Equivalent project .mcp.json:

Add to .mcp.json or ~/.claude.json:

json
{
  "mcpServers": {
    "go-bananas": {
      "type": "http",
      "url": "https://mcp.gobananasai.com"
    }
  }
}

Codex (Remote HTTP OAuth) ​

bash
codex mcp add go-bananas --url https://mcp.gobananasai.com
codex mcp login go-bananas

Verify with codex mcp get go-bananas.

Claude Desktop / Claude.ai Remote Connector ​

Use Settings > Connectors > Add custom connector and enter:

text
https://mcp.gobananasai.com

Local STDIO Proxy ​

Run browser login once:

bash
npx -y gobananas-cli auth login

Then add the proxy to clients that need a command-based MCP server:

json
{
  "mcpServers": {
    "go-bananas": {
      "command": "npx",
      "args": ["-y", "gobananas-mcp"],
      "env": {
        "GO_BANANAS_SERVER_URL": "https://gobananasai.com",
        "GO_BANANAS_MCP_TRANSPORT": "streamable-http"
      }
    }
  }
}

For headless/API-key auth, add:

json
"GO_BANANAS_API_KEY": "sk_live_your_key_here"

inside the same env object.

Claude Code STDIO:

bash
claude mcp add -s user go-bananas \
  -e GO_BANANAS_SERVER_URL=https://gobananasai.com \
  -e GO_BANANAS_MCP_TRANSPORT=streamable-http \
  -- npx -y gobananas-mcp

Codex STDIO:

bash
codex mcp add go-bananas \
  --env GO_BANANAS_SERVER_URL=https://gobananasai.com \
  --env GO_BANANAS_MCP_TRANSPORT=streamable-http \
  -- npx -y gobananas-mcp

Cursor .cursor/mcp.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"
      }
    }
  }
}

Custom Integration ​

Use any MCP-compatible client library:

typescript
import {
  Client,
  StreamableHTTPClientTransport,
} from '@modelcontextprotocol/client';

const client = new Client(
  {
    name: 'my-app',
    version: '1.0.0',
  },
  {
    capabilities: {},
    versionNegotiation: { mode: 'auto' },
  }
);

// Connect via Streamable HTTP (recommended)
await client.connect(
  new StreamableHTTPClientTransport(new URL('https://mcp.gobananasai.com'), {
    requestInit: {
      headers: { 'X-API-Key': 'sk_live_xxx' },
    },
  })
);

// List available tools
const tools = await client.listTools();

// Call a tool
const result = await client.callTool({
  name: 'generate_image',
  arguments: {
    prompt: 'a sunset over mountains',
    session_id: 'my-editing-workflow',
  },
});

OAuth 2.1 Authorization (MCP Authorization) ​

MCP also supports OAuth 2.1 + PKCE:

  • Register a client with POST /oauth/register.
  • Send users to /oauth/authorize; browsers are redirected to the console login at /?return_to=....
  • Exchange the code at /oauth/token.
  • Call /mcp with Authorization: Bearer <access_token> (the legacy /sse endpoint accepts the same header).

Example call:

bash
curl -X POST https://mcp.gobananasai.com \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{"method":"tools/list","params":{}}'

Tool Response Format ​

All tools return structured responses:

json
{
  "content": [
    {
      "type": "text",
      "text": "Generated image successfully!\n\nImage ID: 342\nURL: https://pub-xxx.r2.dev/tenant/image.png\nDimensions: 1024x768"
    }
  ]
}

For image generation, responses include:

  • Public URL for the generated image
  • Thumbnail URL
  • Database ID for reference
  • Dimensions and metadata

Error Handling ​

MCP tools return errors in a standard format:

json
{
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Rate limit exceeded. Try again in 30 seconds.",
    "details": {
      "limit": 60,
      "window": "1 minute",
      "retry_after": 30
    }
  }
}

Common error codes:

CodeDescription
AUTHENTICATION_ERRORInvalid API key
RATE_LIMIT_EXCEEDEDToo many requests
QUOTA_EXCEEDEDStorage quota reached
INVALID_INPUTBad parameters
RESOURCE_NOT_FOUNDImage/character not found
GEMINI_API_ERRORUpstream API failure

Session Management ​

MCP 2026 transport requests are stateless. Go Bananas maintains editing continuity through an explicit application session_id on session-aware tools. The Go Bananas CLI and stdio proxy add their persisted application session ID automatically; custom clients should reuse one value for a related editing workflow.

Session Management Flow

Generate image, save state, continue editing with automatic context

Best Practices ​

1. Use Natural Language ​

Let the AI interpret your intent:

✅ "Generate a sunset with dramatic clouds"
✅ "Make the colors more vibrant"
✅ "Add Luna to this scene"

❌ "Call generate_image with prompt='sunset'"

2. Leverage Context ​

Reuse the same application session_id so the session tracks your current image:

Generate a mountain landscape
→ Image #1 created

Add a lake in the foreground
→ Edits image #1 automatically

Make the water more blue
→ Edits the latest version

3. Use Characters for Consistency ​

Create a character named "Max" - friendly robot
→ Character saved

Show Max in a kitchen
→ Consistent character

Show Max at a beach
→ Same character, new scene

Generate multiple variations:

Generate 4 images of sunset landscapes
→ Creates 4 images in one call

Rate Limits ​

MCP operations count against your rate limit:

LimitDefault
Requests per minute60
Concurrent requests10
Images per request4

Next Steps ​

Released under the MIT License.