Banana Image MCP
The Banana Image MCP server enables AI-powered image generation, processing, and CDN uploading with the following capabilities:
Generate blog cover images (
generate_blog_cover): Create a blog cover image from a text prompt using Google Gemini AI, auto-convert to WebP, and upload to CDN with a date-prefixed slug-based filename.Generate general images (
generate_image): Generate any image from a text prompt, convert to WebP, upload to CDN, and return the final CDN URL.Upload existing images (
upload_image): Upload a local file or remote image (HTTP/HTTPS URL) to CDN with automatic WebP conversion.
Additional capabilities:
Supports Qiniu Cloud (default) and Aliyun OSS as CDN providers
Configurable aspect ratios (
16:9,1:1,9:16) and resolutions (1K,2K,4K), overridable per-call or via environment variablesAutomatic WebP conversion with configurable compression quality
Network flexibility via forward proxy (
PROXY_URL) or reverse-proxy gateway (GEMINI_BASE_URL) for restricted environmentsInteractive setup wizard (
banana-image-mcp setup) for easy configurationLocal history log of all generation/upload activities, viewable via
banana-image-mcp history
Utilizes the Google Gemini AI API to generate high-quality blog cover images from text prompts.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Banana Image MCPGenerate a minimalist blog cover for a JavaScript tutorial with slug js-tips"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
banana-image-mcp
An MCP (Model Context Protocol) server for image generation, processing, and CDN upload. Powered by Google Gemini AI, Sharp, with Qiniu Cloud and Aliyun OSS support.
Features
Generate images from text prompts using Google Gemini AI
Proxy & gateway support — reach Google Gemini from restricted networks (e.g. mainland China) via a forward proxy (
PROXY_URL) or a self-hosted reverse-proxy gateway (GEMINI_BASE_URL)Configurable model — default
gemini-3.1-flash-image-preview, or switch togemini-3.1-flash-lite-imageConfigurable aspect ratio & resolution — e.g.
16:9/1:1/9:16and1K/2K/4KInteractive setup wizard — run
banana-image-mcp setupto write your config automatically, no hand-editing JSONUpload local or remote images to CDN (Qiniu Cloud or Aliyun OSS)
Automatic conversion to WebP format with compression
Date-prefixed filenames with customizable upload paths
Temporary files are cleaned up automatically
Switch upload provider via environment variable
Related MCP server: Gemini Image MCP
Quick Start
Interactive setup (setup) — recommended
After installing (or on first use), run the setup wizard to configure everything — no
hand-editing JSON:
npx -y banana-image-mcp setup
# or, if installed globally:
banana-image-mcp setupIt first asks your preferred language (中文 / English), then walks you through:
Which client(s) to write to (multi-select): Claude Code, Claude Desktop, Cursor, Codex, or a custom JSON path;
Run command:
npx(recommended) or the globalbanana-image-mcp;GEMINI_API_KEYand proxy / gateway (PROXY_URLorGEMINI_BASE_URL, see Network);Image model, aspect ratio, resolution;
Upload provider (Qiniu / Aliyun OSS) and its keys.
Made a typo? Type
b(orback) at any prompt to go back to the previous step. A review screen at the end lets you check everything (secrets masked) before writing.
It then merges the banana-image entry into each selected config file (backing up
the original first), without touching your other MCP servers (Codex's config.toml is
edited in place, preserving its other sections and comments). Restart the client(s)
afterwards to apply.
Manual configuration
Prefer editing config yourself? Add the banana-image server to your MCP client's config file.
Using npx (recommended)
No installation needed — configure directly in your MCP client:
Qiniu Cloud (default):
{
"mcpServers": {
"banana-image": {
"command": "npx",
"args": ["-y", "banana-image-mcp"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key",
"QINIU_ACCESS_KEY": "your-qiniu-access-key",
"QINIU_SECRET_KEY": "your-qiniu-secret-key",
"QINIU_BUCKET": "your-bucket-name",
"QINIU_CDN_DOMAIN": "https://your-cdn-domain.com"
}
}
}
}Aliyun OSS:
{
"mcpServers": {
"banana-image": {
"command": "npx",
"args": ["-y", "banana-image-mcp"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key",
"UPLOAD_PROVIDER": "aliyun",
"ALIYUN_OSS_ACCESS_KEY_ID": "your-access-key-id",
"ALIYUN_OSS_ACCESS_KEY_SECRET": "your-access-key-secret",
"ALIYUN_OSS_BUCKET": "your-bucket-name",
"ALIYUN_OSS_REGION": "oss-cn-hangzhou",
"ALIYUN_OSS_CDN_DOMAIN": "https://your-cdn-domain.com"
}
}
}
}Global installation
npm install -g banana-image-mcpThen configure in your MCP client:
Qiniu Cloud (default):
{
"mcpServers": {
"banana-image": {
"command": "banana-image-mcp",
"env": {
"GEMINI_API_KEY": "your-gemini-api-key",
"QINIU_ACCESS_KEY": "your-qiniu-access-key",
"QINIU_SECRET_KEY": "your-qiniu-secret-key",
"QINIU_BUCKET": "your-bucket-name",
"QINIU_CDN_DOMAIN": "https://your-cdn-domain.com"
}
}
}
}Aliyun OSS:
{
"mcpServers": {
"banana-image": {
"command": "banana-image-mcp",
"env": {
"GEMINI_API_KEY": "your-gemini-api-key",
"UPLOAD_PROVIDER": "aliyun",
"ALIYUN_OSS_ACCESS_KEY_ID": "your-access-key-id",
"ALIYUN_OSS_ACCESS_KEY_SECRET": "your-access-key-secret",
"ALIYUN_OSS_BUCKET": "your-bucket-name",
"ALIYUN_OSS_REGION": "oss-cn-hangzhou",
"ALIYUN_OSS_CDN_DOMAIN": "https://your-cdn-domain.com"
}
}
}
}With a proxy (e.g. mainland China)
Google Gemini is often not directly reachable from mainland China. Pick one of the two
approaches and add its variables to the env block. See
Network — two ways to reach Gemini for the full explanation.
A. Forward proxy — a local client (Clash / V2Ray / Shadowsocks) or a paid HTTP proxy.
Add PROXY_URL:
{
"mcpServers": {
"banana-image": {
"command": "npx",
"args": ["-y", "banana-image-mcp"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key",
"PROXY_URL": "http://127.0.0.1:7890",
"QINIU_ACCESS_KEY": "your-qiniu-access-key",
"QINIU_SECRET_KEY": "your-qiniu-secret-key",
"QINIU_BUCKET": "your-bucket-name",
"QINIU_CDN_DOMAIN": "https://your-cdn-domain.com"
}
}
}
}Clash / Clash Verge / ClashX: use the mixed/HTTP port shown under Settings → Port (default
7890) →http://127.0.0.1:7890. Alternatively, enable TUN mode to route all traffic transparently — then you don't needPROXY_URLat all.Proxy that needs a login:
http://username:password@host:port(URL-encode special characters in the password, e.g.+→%2B).⚠️ Just toggling your client's system proxy (even in "Global"/rule mode) is not enough — Node's
fetchignores OS proxy settings. UsePROXY_URL, or a transparent TUN mode.
B. Reverse-proxy gateway — a self-hosted endpoint (e.g. a Cloudflare Worker) that
forwards to the Gemini API. Set GEMINI_BASE_URL (and any header it requires) instead of
PROXY_URL. Because GEMINI_EXTRA_HEADERS is a JSON string inside JSON, the inner quotes
are escaped with \":
{
"mcpServers": {
"banana-image": {
"command": "npx",
"args": ["-y", "banana-image-mcp"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key",
"GEMINI_BASE_URL": "https://gemini.example.com",
"GEMINI_EXTRA_HEADERS": "{\"x-cf-proxy-key\":\"your-gateway-key\"}",
"QINIU_ACCESS_KEY": "your-qiniu-access-key",
"QINIU_SECRET_KEY": "your-qiniu-secret-key",
"QINIU_BUCKET": "your-bucket-name",
"QINIU_CDN_DOMAIN": "https://your-cdn-domain.com"
}
}
}
}Codex (CLI & Desktop)
Codex CLI and the Codex desktop app (Codex.app) share the same config file —
~/.codex/config.toml (TOML, not JSON) — so configuring it once covers both. The easiest
way is the wizard (banana-image-mcp setup → select Codex), which merges the entry and
backs up the file. To do it by hand, add:
[mcp_servers.banana-image]
command = "/absolute/path/to/npx"
args = ["-y", "banana-image-mcp"]
[mcp_servers.banana-image.env]
GEMINI_API_KEY = "your-gemini-api-key"
# add PROXY_URL or GEMINI_BASE_URL here if you need a proxy/gateway (see Network below)
UPLOAD_PROVIDER = "qiniu"
QINIU_ACCESS_KEY = "your-qiniu-access-key"
QINIU_SECRET_KEY = "your-qiniu-secret-key"
QINIU_BUCKET = "your-bucket-name"
QINIU_CDN_DOMAIN = "https://your-cdn-domain.com"⚠️ Use an absolute path for
command(the output ofwhich npx), not barenpx. The Codex desktop app does not inherit your shellPATH, so"npx"alone usually fails to launch there. Also point it at anode/npxversionsharpsupports (Node 18 / 20 / 22 — avoid brand-new majors like 26 that have no prebuilt binaries yet). For example, an nvm path looks like~/.nvm/versions/node/v22.16.0/bin/npx.
Restart Codex (start a new CLI session, or quit & reopen the desktop app) to load the server.
Upgrade
# npx users: just clear the cache to get the latest version
npx clear-npx-cache && npx -y banana-image-mcp
# Global installation users
npm update -g banana-image-mcpConfiguration file location
The banana-image entry lives under the mcpServers object of your client's config file:
Client | OS | Path |
Claude Code | macOS |
|
Claude Code | Windows |
|
Claude Desktop | macOS |
|
Claude Desktop | Windows |
|
Cursor | macOS / Windows |
|
Codex | macOS / Windows |
|
Tip: run
banana-image-mcp setupto have the file(s) created/updated for you — it targets any of the clients above (or a custom path) and backs up the existing file first.
For Claude Code you can also add the server from the CLI:
claude mcp add banana-image -- npx -y banana-image-mcpCLI Commands
Command | Description |
| Interactive config wizard |
| View generation history / log |
| Print the version |
| Run the MCP server over stdio (used by MCP clients) |
history — generation log
Every generate_image / generate_blog_cover / upload_image call is logged to
~/.banana-image-mcp/history.jsonl. View it as a table (latest first):
npx -y banana-image-mcp historyIt shows date/time, result (success/failure), tool type, model, image size, generation
time, and the image URL (or failure reason). The latest 10 entries are shown; in an
interactive terminal use ↑/↓ (or j/k) to page through older entries and q to quit.
# 时间 结果 类型 模型 大小 耗时 链接 / 失败原因
───────────────────────────────────────────────────────────────────────────────────────────────────
1 2026-07-09 22:15:03 ✓ 成功 封面 3.1-flash-image-preview 186.4 KB 3.4s https://cdn.example.com/…
2 2026-07-09 21:58:11 ✗ 失败 生图 3.1-flash-lite-image — 0.9s fetch failed (proxy?)Environment Variables
Upload Provider
Variable | Description |
| Upload provider: |
Image Generation
Variable | Default | Description |
| — | Google Gemini API key for image generation (required) |
|
| Image model. Also supports |
|
| Aspect ratio, e.g. |
|
| Resolution: |
|
| WebP compression quality (1–100) |
These are defaults;
generate_blog_coverandgenerate_imagealso accept per-callmodel/aspectRatio/imageSizeparameters that override the environment values.
Network — two ways to reach Gemini
Useful when Google Gemini is not directly reachable (e.g. mainland China). There are two independent mechanisms — pick whichever matches your proxy.
1. Forward proxy (PROXY_URL) — tunnels raw traffic to Google. Use this for a local
client like Clash / V2Ray / Shadowsocks, or a paid HTTP proxy service.
Variable | Description |
| HTTP/HTTPS forward proxy, e.g. |
Usually the local proxy port of your client (Clash's default mixed port is
7890→http://127.0.0.1:7890).Basic-auth proxies are supported via
http://user:pass@host:port(URL-encode special characters in the password, e.g.+→%2B).Only HTTP/HTTPS proxies are supported (not SOCKS5).
If
PROXY_URLis unset, the standardHTTPS_PROXY/HTTP_PROXY/ALL_PROXYenv vars are honored too.Applied to both Gemini API calls and remote image downloads.
⚠️ Node's built-in
fetchdoes not honor your OS "system proxy" setting. Enabling your client's system-proxy toggle alone (even in "global"/rule mode) won't route this server. Either setPROXY_URL, or use a transparent TUN / virtual-NIC mode — that captures all traffic at the network layer, so noPROXY_URLis needed.
2. Reverse-proxy gateway (GEMINI_BASE_URL [+ GEMINI_EXTRA_HEADERS]) — point the SDK
at a self-hosted endpoint that forwards to the Gemini API (e.g. a Cloudflare Worker). In
this case do not set PROXY_URL.
Variable | Description |
| Base URL of your gateway, e.g. |
| Optional custom headers the gateway requires. JSON, e.g. |
Qiniu Cloud (when UPLOAD_PROVIDER=qiniu or not set)
Variable | Description |
| Qiniu cloud access key |
| Qiniu cloud secret key |
| Qiniu storage bucket name |
| CDN domain for generated image URLs |
Aliyun OSS (when UPLOAD_PROVIDER=aliyun)
Variable | Required | Description |
| Yes | Aliyun AccessKey ID |
| Yes | Aliyun AccessKey Secret |
| Yes | OSS bucket name |
| Yes | OSS region, e.g. |
| No | Custom CDN domain (falls back to default OSS URL if not set) |
Getting API Keys
Google Gemini API Key:
Visit Google AI Studio
Create or get an API key
Qiniu Cloud:
Register at Qiniu Cloud
Create a storage bucket
Get AccessKey and SecretKey from your account settings
Configure a CDN domain
Aliyun OSS:
Register at Aliyun
Create an OSS bucket
Get AccessKey ID and AccessKey Secret from your account settings
Note your bucket's region (e.g.
oss-cn-hangzhou)
Tools
generate_blog_cover
Generate a blog cover image, convert to WebP, and upload to CDN. The image dimensions
follow the configured aspect ratio / resolution (default 16:9 at 1K).
Parameter | Type | Required | Description |
| string | Yes | Text prompt describing the image to generate |
| string | Yes | Slug identifier for the filename (prefixed with date) |
| string | No | Upload directory path (default: |
| string | No | Model override (default: |
| string | No | Aspect ratio override (default: |
| string | No | Resolution override |
Returns:
{
"url": "https://your-cdn-domain.com/blog-cover/20260321-my-post.webp"
}generate_image
Generate an image using Gemini AI, convert to WebP, and upload to CDN.
Parameter | Type | Required | Description |
| string | Yes | Text prompt describing the image to generate |
| string | Yes | Slug identifier for the filename (prefixed with date) |
| string | No | Upload directory path (default: |
| string | No | Model override (default: |
| string | No | Aspect ratio override (default: |
| string | No | Resolution override |
Returns:
{
"url": "https://your-cdn-domain.com/aigc/image/20260321-my-image.webp"
}upload_image
Upload a local file or remote URL image to CDN, with automatic WebP conversion.
Parameter | Type | Required | Description |
| string | Yes | Local file path or HTTP/HTTPS URL of the image |
| string | Yes | Slug identifier for the filename (prefixed with date) |
| string | No | Upload directory path (default: |
Returns:
{
"url": "https://your-cdn-domain.com/images/20260321-my-photo.webp"
}Architecture
prompt → Google Gemini API (PNG) → Sharp (WebP) → CDN (Qiniu / Aliyun OSS) → URL
source (local/remote) ─────────→ Sharp (WebP) → CDN (Qiniu / Aliyun OSS) → URLImage generation: Google Gemini (
gemini-3.1-flash-image-previewby default, configurable), reachable via optional forward proxy or reverse-proxy gatewayImage processing: Sharp (WebP conversion; generated aspect ratio / resolution are preserved)
Cloud storage: Qiniu Cloud or Aliyun OSS (configurable via
UPLOAD_PROVIDER)
License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/xinpengfei520/banana-image-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server