Labnana
БесплатноНе проверенMCP server for generating and editing images via Labnana's API, supporting models like Gemini image models, GPT-Image-2, Wan2.7, and Seedream.
Описание
MCP server for generating and editing images via Labnana's API, supporting models like Gemini image models, GPT-Image-2, Wan2.7, and Seedream.
README
npm version npm downloads CI node License
An MCP server for the Labnana OpenAPI. It enables Claude, Claude Code, and other MCP clients to generate and edit images with Labnana.
Current OpenAPI models (product names mapped to the model parameter):
| Product name | model |
Provider | Resolutions | Best for |
|---|---|---|---|---|
| Nano Banana Pro | gemini-3-pro-image |
1K / 2K / 4K | In-image text, character consistency, high-fidelity output | |
| Nano Banana 2 | gemini-3.1-flash-image |
1K / 2K / 4K | Fast iteration and extreme aspect ratios | |
| GPT-Image-2 | gpt-image-2 |
OpenAI | 1K / 2K / 4K | Spec-driven generation, layout control, illustration |
| Wan2.7 Image Pro | wan2.7-image-pro |
Alibaba | 1K / 2K / 4K¹ | Photoreal and poster-style images |
| Wan2.7 Image | wan2.7-image |
Alibaba | 1K / 2K | Lower-cost everyday generation |
| Seedream 5.0 Pro | seedream-5-0-pro |
ByteDance | 1K / 2K | Coordinate-driven region editing and Chinese instructions |
¹ wan2.7-image-pro supports 4K only for text-to-image; generations with reference images are limited to 2K. Treat the Labnana OpenAPI guide as authoritative for model IDs.
Installation
Requires Node.js 20.9 or later.
Claude Code
- Create an API key in the Labnana API Keys console.
- Make
LABNANA_API_KEYavailable in the environment used by Claude Code. - Add the server:
claude mcp add labnana -- npx -y @exoticknight/labnana-mcp
The package can also be started directly with:
npx -y @exoticknight/labnana-mcp
DeepSeek Harness (DSH)
Add the server through DSH's official MCP client plugin. Pin 2.1.0 when you want the version shown by initialize to identify this MCP Apps-capable build:
- id: mcp-labnana
name: '@deepseek-ai/dsh-mcp-client'
config:
serverName: labnana
transport: stdio
command: npx
args: ['-y', '@exoticknight/[email protected]']
env:
LABNANA_API_KEY: !!js process.env.LABNANA_API_KEY
DSH's MCP bridge can project supported ImageContent into the calling vision model. Version 2.1 also publishes a standard MCP Apps single-file View for generate_image and get_generation_task. An MCP Apps-capable DSH Web host renders the preview inline; a stock generic DSH tool card may still show the JSON fallback even though the model received the image. This is a client presentation limitation, not a lost generation result.
For a local source checkout, use the same row with command: node, an absolute args path to dist/index.js, and cwd set to this repository. Current stock DSH builds bridge MCP tools but do not consume MCP resources in the generic tool card. Without an MCP Apps host, model vision still works and the card falls back to JSON.
Cursor and VS Code
One-click install (replace the placeholder API key after installing):
Install in Cursor Install in VS Code
Claude Desktop and other MCP clients
Use an equivalent mcpServers configuration:
{
"mcpServers": {
"labnana": {
"command": "npx",
"args": ["-y", "@exoticknight/labnana-mcp"],
"env": {
"LABNANA_API_KEY": "lh_xxxxxxxxx"
}
}
}
}
Local source checkout
npm install
npm run build
Then configure the server with the generated dist/index.js:
claude mcp add labnana -- node <path-to-repo>/dist/index.js
On Windows, use an absolute path such as:
claude mcp add labnana -- node C:/path/to/labnana-mcp/dist/index.js
Configuration
The server reads the following environment variable:
| Variable | Required | Description |
|---|---|---|
LABNANA_API_KEY |
Yes | Labnana API key. |
LABNANA_OUTPUT_DIR |
No | Default directory for saved images. Falls back to labnana-images/ under the working directory. |
The command-line options below are also supported:
| Option | Description |
|---|---|
--api-key <key> |
Provide the API key for a local process. |
--base-url <url> |
Override the default API endpoint, https://api.labnana.com. |
--output-dir <dir> |
Default directory for saved images. |
Environment variables are recommended because command-line arguments may be visible in the local process list.
Tools
| Tool | Description |
|---|---|
generate_image |
One-stop text-to-image / image-to-image / editing. Saves the original and returns a bounded MCP image preview, structured metadata, and JSON fallback by default; 4K requests poll internally. |
estimate_credits |
Estimate the credits required for a generation without generating an image. |
get_subscription |
Get subscription status, credit balances, and free usage information. |
list_generation_tasks |
List generation task history with pagination and optional status filtering. |
get_generation_task |
Get task details and public image URLs (useful after a generate_image timeout). |
Usage
Generate an image
{
"name": "generate_image",
"arguments": {
"model": "gemini-3-pro-image",
"prompt": "Change the background of the image to the grasslands of Inner Mongolia",
"referenceImages": [
{
"fileData": {
"fileUri": "https://cdn.labnana.com/xxx.png",
"mimeType": "image/png"
}
}
],
"imageConfig": {
"imageSize": "2K",
"aspectRatio": "16:9"
}
}
}
The default is outputMode=hybrid: the full original is saved to disk while a bounded MCP image preview, structuredContent, and equivalent JSON text are returned together. This provides progressive compatibility across Codex, Claude Code, Claude Desktop, and other MCP clients. Use saveDir to choose the target directory.
All 1K, 2K, 4K, and get_generation_task results use the same envelope:
{
"schemaVersion": 1,
"status": "succeeded",
"taskId": "task-123",
"images": [
{
"index": 0,
"mimeType": "image/png",
"width": 4096,
"height": 4096,
"byteLength": 18442231,
"sha256": "...",
"url": "https://.../original.png",
"filePath": "C:\\...\\labnana.png",
"preview": { "included": true, "mimeType": "image/jpeg", "width": 1600, "height": 1600 }
}
]
}
Image base64 appears only in standard MCP ImageContent, never duplicated into text or structured metadata. Full 4K originals are not inlined; previews have a maximum 1600-pixel edge and target a 2 MiB byte ceiling, while filePath/url locate the original.
Use referenceImages for image-to-image generation and editing. fileData.fileUri supports gs:// and https://; small images can be passed as base64 through inlineData.data.
4K requests automatically run as asynchronous tasks: the server creates the task, polls with rate-limit backoff, downloads and saves originals, and creates previews. If the wait exceeds timeoutSeconds (default 300), the result has status=pending and a taskId; this is not treated as generation failure. Fetch the final preview and original URL later with get_generation_task.
Credit estimation
{
"name": "estimate_credits",
"arguments": {
"prompt": "A Shiba Inu running through a snowy landscape",
"imageConfig": {
"imageSize": "4K"
}
}
}
Parameters
model(default:gemini-3-pro-image):gemini-3-pro-image,gemini-3.1-flash-image,gpt-image-2,wan2.7-image-pro,wan2.7-image, orseedream-5-0-pro. The provider is derived from the model automatically.imageConfig.imageSize:1K,2K, or4K.wan2.7-imageandseedream-5-0-prodo not support 4K;wan2.7-image-proalso disallows 4K when reference images are present.imageConfig.aspectRatio:1:1,2:3,3:2,3:4,4:3,9:16,16:9,21:9,1:4,4:1,1:8, or8:1. GPT-Image-2 may omit this field and let the service choose; Wan2.7 supports only1:1,16:9,9:16,4:3, and3:4.referenceImages: OpenAPI allows up to 14 for Gemini, 4 for GPT-Image-2, 9 for Wan2.7, and 10 for Seedream. These are API limits, not the separate upload limits of the web generator.- Seedream precise editing: put the source image in
referenceImagesand describe the target region and change inpromptusing absolute coordinates from the top-left origin. OpenAPI has no separatemaskorregionparameter. outputMode(generate_imageonly):hybrid(default, save originals and inline bounded previews),file(save originals and return metadata only), orinline(do not save tosaveDir; return a bounded preview, and persist the original to the default recovery directory only when the upstream response has no original URL).saveDir/timeoutSeconds(generate_imageonly): target directory forhybrid/filemode, and the maximum wait for async (4K) generations.
Credit summary
| Model | 1K | 2K | 4K |
|---|---|---|---|
gemini-3-pro-image |
15 | 15 | 30 |
gemini-3.1-flash-image |
10 | 10 | 20 |
gpt-image-2 |
4 | 6 | 10 |
wan2.7-image-pro |
6 | 8 | 12 (text-to-image only) |
wan2.7-image |
4 | 6 | Not supported |
seedream-5-0-pro |
6 | 15 | Not supported |
Errors
API errors are returned as { code, message } and exposed as MCP results with isError: true.
| Code | Meaning | Recommendation |
|---|---|---|
| 21007 | Invalid API key | Check LABNANA_API_KEY. |
| 26004 | Insufficient credits | Check the subscription or upgrade the plan. |
| 29003 | Invalid parameters | Check required fields and model-specific limits. |
| 29998 | Too many requests | Retry with a 20–30 second backoff. |
Development
npm install
npm run typecheck
npm test
To inspect the real single-file MCP App without calling Labnana or spending credits, run npm run test:ui and open http://127.0.0.1:4173/test/mcp-app-host.html. The local host sends a generated 640×360 PNG fixture through the official AppBridge so the image, status, and metadata can be checked visually.
Links
- Labnana integration guide
- Labnana OpenAPI reference
- Credit guide
- GitHub repository
- Technical support: [email protected]
License
Установка Labnana
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/exoticknight/labnana-mcpFAQ
Labnana MCP бесплатный?
Да, Labnana MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Labnana?
Да, требуются переменные окружения: LABNANA_API_KEY. Unyly подставит их в конфиг при установке.
Labnana — hosted или self-hosted?
Доступен hosted-вариант: Unyly запускает сервер в облаке, локальная установка не обязательна.
Как установить Labnana в Claude Desktop, Claude Code или Cursor?
Открой Labnana на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
ARA
Generate images, video and audio from any AI agent — one connector.
автор: ARAOmni Video
An MCP server that transforms LLM-enabled IDEs into professional video editors by pre-processing footage into text proxies, generating motion graphics via HTML/
автор: buildwithtazaYouTube
Transcripts, channel stats, search
автор: YouTubeEverArt
AI image generation using various models.
автор: modelcontextprotocolgpu-bridge/mcp-server
Unified GPU inference API with 30 AI services (LLM, image gen, video, TTS, whisper, embeddings, reranking, OCR) as MCP tools. Pay-per-use via x402 USDC or API k
автор: gpu-bridgehamflx/imagen3-mcp
A powerful image generation tool using Google's Imagen 3.0 API through MCP. Generate high-quality images from text prompts with advanced photography, artistic,
автор: hamflxmerterbak/Grok-MCP
MCP server for xAI's [Grok API](https://docs.x.ai/docs/overview) with agentic tool calling, image generation, vision, and file support.
автор: merterbakSureScaleAI/openai-gpt-image-mcp
OpenAI GPT image generation/editing MCP server.
автор: SureScaleAIYangLiangwei/PersonalizationMCP
Comprehensive personal data aggregation MCP server with Steam, YouTube, Bilibili, Spotify, Reddit and other platforms integrations. Features OAuth2 authenticati
автор: YangLiangweiAceDataCloud/MCPFlux
Flux AI image generation and editing (Black Forest Labs) via Ace Data Cloud API.
автор: AceDataCloudCompare Labnana with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории media
