@enhancor/mcp-nano-banana-2
v0.4.1
Published
MCP server for the Enhancor Nano Banana 2 text-to-image and image-editing API — for Claude and any MCP client.
Maintainers
Readme
@enhancor/mcp-nano-banana-2
Official MCP server for the Enhancor Nano Banana 2 text-to-image and image-editing API.
Plug Enhancor into Claude (or any MCP-compatible client) and let the model generate, edit, or remix images natively — no middleware, no glue code.
What's in the box
Four tools, mapping to the Nano Banana 2 API:
| Tool | What it does |
| --- | --- |
| nano_banana_2_submit_job | Submit a generation/edit job. Returns a requestId immediately. |
| nano_banana_2_check_status | One-shot status check. Returns the result image URL when COMPLETED. |
| nano_banana_2_wait_for_completion | PREFERRED — long-poll a job server-side. Pair with submit_job for clean UX without client-side sleep loops. Each call blocks up to 45s, just call again if still in progress. |
| nano_banana_2_submit_and_wait | Convenience: submit + block in one call. Default 45s cap. Use only for fast jobs. |
Each accepts the standard Nano Banana 2 parameters (prompt, input_images, aspect_ratio, resolution). The MCP does not expose webhook_url — it manages that internally (see How it works below).
Install
Requires Node.js 18+.
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"enhancor-nano-banana-2": {
"command": "npx",
"args": ["-y", "@enhancor/mcp-nano-banana-2"],
"env": {
"ENHANCOR_API_KEY": "sk_your_key_here"
}
}
}
}Restart Claude Desktop.
Claude Code
claude mcp add enhancor-nano-banana-2 \
-s user \
--env ENHANCOR_API_KEY=sk_your_key_here \
-- npx -y @enhancor/mcp-nano-banana-2Cursor, Cline, Continue, or any MCP client
Point it at npx -y @enhancor/mcp-nano-banana-2 as the command, set ENHANCOR_API_KEY in env.
Getting an API key
- Sign up at https://app.enhancor.ai/api-dashboard
- Create an API key
- Per-product pricing lives inline in each product's docs on the dashboard. The actual per-job cost also comes back in every
/statusresponse — no hardcoded pricing table needed.
Example prompts
Once installed, ask Claude things like:
Generate a 4K image with 16:9 aspect ratio of a friendly golden retriever wearing mirrored aviator sunglasses, studio lighting.
Take this photo [URL] and make the sky more dramatic — keep everything else the same.
Combine these three product shots [URL1] [URL2] [URL3] into a wide hero image, 21:9, 4K.
Claude will pick the right tool, fill the params, call Enhancor, and return the output image URL.
Configuration
| Environment variable | Required | Default | Notes |
| --- | --- | --- | --- |
| ENHANCOR_API_KEY | yes | — | Your Enhancor API key |
| NGROK_AUTHTOKEN | no | — | If set, the MCP uses ngrok (free tier is fine) for the webhook tunnel instead of localtunnel. More reliable for production. Get a token at https://dashboard.ngrok.com/get-started/your-authtoken |
| ENHANCOR_AUTO_DOWNLOAD | no | 1 (on) | When on, the MCP downloads result images to a local folder and includes a local_path in the response. Critical for sandboxed MCP clients (Claude Code, Cowork) where Cloudfront URLs are blocked. Set to 0 to disable. |
| ENHANCOR_DOWNLOAD_DIR | no | ./enhancor-downloads | Folder for auto-downloaded result files. Defaults to a subfolder of the current working directory so the file is reachable from sandboxed clients. |
| ENHANCOR_NANO_BANANA_2_BASE_URL | no | https://apireq.enhancor.ai/api/nano-banana-2-new/v1 | Override for staging / self-host |
Supported parameters
prompt(required, max 20,000 characters)input_images— single URL or array of 1–14 URLs. JPEG / PNG / WEBP, ≤30MB each.aspect_ratio— defaults toauto. Allowed:1:1,1:4,1:8,2:3,3:2,3:4,4:1,4:3,4:5,5:4,8:1,9:16,16:9,21:9,auto.resolution— defaults to2K. Allowed:1K,2K,4K.
How it works
The Nano Banana 2 API delivers results via webhook. Since an MCP server runs locally on the user's machine with no public URL, this package does the webhook setup for you:
- On the first tool call, it spins up a local HTTP listener on a random loopback port.
- It exposes that listener publicly: ngrok if
NGROK_AUTHTOKENis set, otherwiselocaltunnel(no signup needed). - Every
/queuerequest sends that public URL aswebhook_urlautomatically. wait_for_completionandsubmit_and_waitrace the webhook against a 15-second/statuspoll — whichever reports completion first wins. That means you always get your result, even if the tunnel is flaky or a webhook is delayed for a particular request.
No configuration is required. The tunnel lifecycle is transparent. For best webhook latency and reliability (e.g. in production or long-running sessions), set NGROK_AUTHTOKEN — ngrok's free tier is sufficient.
Support & community
https://www.skool.com/publicai
License
MIT
