Antibanana MCP logo

Antibanana MCP

Community
awei84

MCP server for Google Antigravity image generation

Publisherawei84
Repositoryantibanana-mcp
LanguageTypeScript
Forks
4
Stars
41
Available tools
0
Transport typestdio
Categories
LicenseISC
Links
  • Connect tools to AI workflows

    Antibanana MCP exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    41 stars and 4 forks from the linked repository.

antibanana-mcp

npm version Node.js License: ISC LINUX DO

English | 中文

把 Google Antigravity 的 Nano Banana 生图能力封装成 MCP Server,让任何支持 MCP 的 AI 客户端都能画图。

AI 客户端(Claude Code / Cursor / ...)
  → MCP Tool 调用
    → antibanana-mcp
      → Google Antigravity API
        → Nano Banana 生图

特性

  • 零配置启动 — 自动读取本机已登录的 Antigravity 凭证,npx -y antibanana-mcp 即可运行;也支持通过凭证文件显式指定
  • 完全模拟 AG IDE — 相同的请求体结构和 imageConfig 参数;默认会从 Antigravity releases 接口获取最新 UA 版本并拼接当前平台信息,尽量保持与当前 AG IDE 一致,不额外传输 AG IDE 未使用的字段
  • 分辨率可选 — 支持 512 / 1K / 2K / 4K 输出(默认 1K)。imageSize 仅在用户显式指定时才传给后端,保持请求指纹一致
  • 输入图编辑 — 支持通过 imagePaths 传入最多 3 张本地图片做编辑或合成,服务端会校验绝对路径和 PNG/JPEG/WebP 文件头,并兼容 WSL 下的 Windows 绝对路径
  • 智能去缩略图 — 后端可能在同一 response 中返回缩略图和高清图,默认自动过滤,只保留每个 candidate 中最大的图
  • 本地保存 — 通过 outputPath 参数可将生成的图片直接保存到本地磁盘(支持 ~/、~\ 和 Windows 绝对路径),无需额外脚本
  • 代理支持 — 支持 HTTPS 代理,国内访问 Google 服务可用

快速开始

bash
npx -y antibanana-mcp

环境要求

  • Node.js 20+
  • 本机已登录 Antigravity,或一份可用的凭证 JSON

Claude Desktop

~/Library/Application Support/Claude/claude_desktop_config.json:

json
{
  "mcpServers": {
    "antibanana": {
      "command": "npx",
      "args": ["-y", "antibanana-mcp"]
    }
  }
}

需要代理(国内访问 Google 服务)

json
{
  "mcpServers": {
    "antibanana": {
      "command": "npx",
      "args": ["-y", "antibanana-mcp"],
      "env": {
        "HTTPS_PROXY": "http://127.0.0.1:7890",
        "ANTIBANANA_PROXY_URL": "http://127.0.0.1:7890"
      }
    }
  }
}

工具

工具说明
list_models列出当前账号可用的生图模型与配额信息
check_quota查询指定模型的剩余配额和重置时间
generate_image根据提示词生成图片或编辑本地图片,支持指定宽高比、分辨率(512 / 1K / 2K / 4K,默认 1K)、输入图路径和本地保存路径

generate_image 参数说明:

参数类型必填说明
promptstring✅生图提示词,建议用英文
aspectRatiostring—宽高比,如 1:1、16:9、4:3 等
modelstring—模型 ID,默认 gemini-3.1-flash-image
imageSizestring—分辨率:512 / 1K / 2K / 4K,默认 1K(非标参数,AI 会在使用前预警)
imagePathsstring[]—最多 3 个本地输入图绝对路径,用于编辑或合成。MCP server 会读取本地文件,校验 PNG/JPEG/WebP 文件头后再上传到后端;单张最大 20MB
outputPathstring—本地保存路径,如 ~/Desktop/cat.jpg 或 C:\Users\Alice\Desktop\cat.jpg。支持 ~/、~\ 和 Windows 绝对路径。强烈建议默认传入;指定后图片会写入磁盘,并且工具只返回文本确认和元数据,不再回传 base64 图片数据,从而避免严重占用上下文

generate_image 可能返回多张图。默认 largest 模式会对每个 candidate 只保留 base64 最大的一张;设置 ANTIBANANA_IMAGE_FILTER=all 可返回后端给出的全部图片。

如果传了 imagePaths,请求体会按 [images..., text] 顺序发送给 Antigravity,用法与 AG IDE 的本地图片编辑模式一致。imagePaths 只接受绝对路径,最多 3 张,单张最大 20MB,仅支持 PNG/JPEG/WebP。

如果不传 outputPath,工具会内联返回完整 base64 图片,适合需要直接显示图片的客户端,但会显著增加上下文占用。除非明确需要内联查看图片,否则建议始终传入 outputPath,例如 ~/Desktop/antibanana-image.png 或 C:\Users\<用户名>\Desktop\antibanana-image.png。

注意:imagePaths 和 outputPath 都按 MCP server 自身的运行环境解析。在 WSL 下,C:\... 会自动转换成 /mnt/<drive>/...;在普通 Linux/macOS 下,直接传 Windows 绝对路径会报真实错误,不会静默降级到其他目录。

固化凭证(可选,更稳定)

默认每次启动都会读取本机 Antigravity 数据库,首次 generate_image 时还会自动获取 project_id。

如果想固定下来,可以创建一个凭证文件(例如 ~/antigravity-creds.json):

json
{
  "refresh_token": "1//你的refresh_token",
  "project_id": "你的project-id"
}
bash
chmod 600 ~/antigravity-creds.json

然后在 MCP 配置里指定:

json
{
  "env": {
    "ANTIBANANA_CREDENTIALS_PATH": "/Users/你的用户名/antigravity-creds.json"
  }
}

refresh_token 和 project_id 的值在首次 generate_image 成功后可从 MCP 启动日志里获取。

环境变量

变量说明
HTTPS_PROXY代理地址(影响 token 刷新)
ANTIBANANA_PROXY_URL代理地址(影响 API 请求)
ANTIBANANA_CREDENTIALS_PATH凭证 JSON 路径(不设则自动读本机 Antigravity)
ANTIBANANA_PROJECT_ID显式指定 project_id(不设则首次生图时自动获取)
ANTIBANANA_USER_AGENT显式覆盖默认 User-Agent(不设则自动同步 Antigravity 最新 releases 版本)
ANTIBANANA_TIMEOUT_MS请求超时毫秒数(默认 120000)
ANTIBANANA_MAX_RETRIES请求失败最大重试次数(默认 2)
ANTIBANANA_IMAGE_FILTER图片筛选模式:largest(默认)单次响应含多个 candidate 时只保留最大图,all 返回全部图片

FAQ

为什么只支持 1:1 正方形? 不是的。Antigravity IDE 自身只生成 1:1 图片,但本项目通过 API 参数 aspectRatio 支持任意宽高比(如 4:3、16:9、3:4 等)。

为什么返回 base64 而不是直接保存文件? 两种方式都支持,但行为不同:

  • 不传 outputPath:返回 base64 图片,客户端可直接内联显示,但会占用大量上下文。
  • 传 outputPath:MCP server 会把图片写入磁盘,只返回文本确认、保存路径和元数据,不再回传 base64 图片数据。

如果你的客户端会把工具结果带回后续上下文,默认应始终传 outputPath;只有在明确需要内联展示图片时才省略。

如何更新到最新版本? 配置中使用 antibanana-mcp@latest 可自动获取最新版;也可手动执行 npx clear-npx-cache 清除缓存后重启。

本地开发

bash
npm install
npm run build
npm test

致谢

感谢 LINUX DO 社区的支持与推广。

License

ISC

Installation

TypingMind
{
  "mcpServers": {
    "antibanana-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "antibanana-mcp"
      ]
    }
  }
}

Use Antibanana MCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Antibanana MCP is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Antibanana MCP as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Antibanana MCP MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "antibanana-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "antibanana-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Antibanana MCP MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Antibanana MCP MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Antibanana MCP to help me with this task?
Antibanana MCP
Sure. I read it.
Here is what I found using Antibanana MCP.

Frequently asked questions

What is the Antibanana MCP MCP server used for?

Antibanana MCP is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Antibanana MCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Antibanana MCP with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Antibanana MCP MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Antibanana MCP connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Antibanana MCP MCP to TypingMind?

Antibanana MCP runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Antibanana MCP MCP provide in TypingMind?

Antibanana MCP exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Antibanana MCP MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Antibanana MCP requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇