genmux API is now generally available. Read the docs →
genmux API

Blog

genmux MCP server: images from Claude, Cursor and OpenCode

5 min readWritten by genmux API Team


The Model Context Protocol (MCP) is the standard way to hand an AI assistant a set of tools: a small server exposes functions, resources and prompt templates, and any MCP client — Claude Desktop, Claude Code, Cursor, OpenCode, Continue, Windsurf — can call them mid-conversation. @genmux/mcp is that server for genmux: once it is connected, "make me a 16:9 hero image for the pricing page, but tell me what it costs first" is a sentence you type to your assistant, not a script you write.

Install: one command

The server is an npm package, run on demand with npx. The only required setting is your key:

bash
GENMUX_API_KEY=nb_live_... npx -y @genmux/mcp

Environment variables:

VariableDefaultPurpose
GENMUX_API_KEY— (required)Your genmux key; never leaves your machine
GENMUX_API_BASEhttps://api.genmux.tech/v1Override for a staging stack
GENMUX_OUTPUT_DIR./genmux-imagesWhere generate_image saves files when asked to

You do not run this by hand; the client starts it. What you configure is the client.

Client snippets

Claude Code and Claude Desktop

bash
claude mcp add genmux -e GENMUX_API_KEY=nb_live_... -- npx -y @genmux/mcp

Cursor — .cursor/mcp.json in the project (or the global one from Cursor's settings):

json
{
  "mcpServers": {
    "genmux": {
      "command": "npx",
      "args": ["-y", "@genmux/mcp"],
      "env": { "GENMUX_API_KEY": "nb_live_..." }
    }
  }
}

OpenCode — an mcp block next to the provider block in opencode.json:

json
{
  "mcp": {
    "genmux": {
      "type": "local",
      "command": ["npx", "-y", "@genmux/mcp"],
      "environment": { "GENMUX_API_KEY": "nb_live_..." }
    }
  }
}

Continue — in config.yaml:

yaml
mcpServers:
  - name: genmux
    command: npx
    args: ["-y", "@genmux/mcp"]
    env:
      GENMUX_API_KEY: nb_live_...

Hosted endpoint, for clients without a shell

Some clients cannot spawn a local process — a browser-based assistant, a locked-down laptop, a team that would rather not distribute keys into config files. For those, the same server runs hosted at https://mcp.genmux.tech/mcp over Streamable HTTP, authenticated with the key as a Bearer token:

json
{
  "mcpServers": {
    "genmux": {
      "url": "https://mcp.genmux.tech/mcp",
      "headers": { "Authorization": "Bearer nb_live_..." }
    }
  }
}

In Claude's web and desktop apps this is a "custom connector" with that URL. The tool list is identical; the difference is where the key lives.

What the server exposes

Tools — what the assistant can call:

ToolDoes
list_modelsCatalogue with prices; kind filters image vs text models
estimate_costCredits a request would cost, before running it
generate_imagemodel, prompt, resolution, ratio, n, negative_prompt, reference_images, save — submits the job, waits, returns URLs (and file paths if save is on)
get_generationOne job by id: status, outputs, cost
list_generationsRecent jobs on the account
account_balanceCredits left

Resources — documents the assistant can read into context: genmux://docs/llms.txt, genmux://docs/openapi.yaml, genmux://models, and code snippets at genmux://snippets/python, /node, /curl, /openai-sdk.

Prompts — two templates: integrate-genmux (walks the assistant through adding the API to your codebase, using the snippets) and pick-a-model (asks the right questions and recommends a model and resolution).

There is deliberately no chat tool. Your assistant already is a chat model; if you want DeepSeek or Qwen3 in it, that is the OpenAI-compatible endpoint, not MCP — see the OpenCode or Continue posts.

A worked example

With the server connected in Claude Code, in a project that has a public/ folder:

You: I need a hero image for the pricing page — a clean isometric illustration of stacked coins turning into pixels, dark background, 16:9. Use nanobanana. Estimate the cost first and don't generate until I say so.

The assistant calls estimate_cost with {"model": "nanobanana", "resolution": "1K", "ratio": "16:9", "n": 1} and reports:

Assistant: One 1K image on Nano Banana is 2 credits (about $0.025 at the Scale rate); a 2K version would need Nano Banana Pro at 6 credits. Your balance is 1,184 credits. Generate at 1K?

You: Yes, save it to public/hero-pricing.png.

It calls generate_image with save: true and GENMUX_OUTPUT_DIR pointing at public/, waits for the job (Nano Banana at 1K takes a few seconds), and comes back with the file path, the job id and the actual charge from the job record. If you ask for three variants (n: 3) the estimate becomes 6 credits≈ $0.073 × 1K Nano Banana and the assistant should say so before spending it.

The behaviour to expect from a good client: it estimates on its own when a request is expensive, it uses list_models when you name a model loosely ("the Pro one"), and it reads genmux://snippets/node before writing integration code instead of guessing the request shape. The integrate-genmux prompt template makes that last habit explicit.

Why this beats a shell script

You could wrap curl calls in a script and have the assistant run it. The MCP server gives three things a script does not: typed tool schemas the model understands without documentation, estimate_cost as a first-class step (so the assistant asks before spending), and resources the model can read to write correct code. Failed jobs are refunded automatically, so an assistant that gets a prompt wrong costs nothing — but an assistant that generates ten 4K images when you meant one is the case estimate_cost exists for.

Getting started

npx -y @genmux/mcp with your key, one of the client snippets above, and your assistant can list models, quote a price and generate images from the same balance that pays for DeepSeek and Qwen3. Model details and per-resolution prices are on the Nano Banana page and the pricing page; the MCP page keeps the current tool list and client snippets, and the REST API the server wraps is documented in the docs.

About the author

Written by genmux API Team — genmux API.

More about us