labnana-mcp
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
labnana-mcp
An MCP server for the Labnana OpenAPI. It enables Claude, Claude Code, and other MCP clients to generate and edit images with Labnana.
Supported model families include:
- Gemini image models (Nano Banana Pro / 2)
- GPT-Image-2
- Wan2.7 Image / Pro
- Seedream 5.0 Pro, including precise editing
Installation
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@1.0.0
The package can also be started directly with:
npx -y @exoticknight/labnana-mcp@1.0.0
Claude Desktop and other MCP clients
Use an equivalent mcpServers configuration:
{
"mcpServers": {
"labnana": {
"command": "npx",
"args": ["-y", "@exoticknight/labnana-mcp@1.0.0"],
"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. |
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. |
Environment variables are recommended because command-line arguments may be visible in the local process list.
Tools
| Tool | Description |
|---|---|
get_subscription |
Get subscription status, credit balances, and free usage information. |
estimate_credits |
Estimate the credits required for a generation without generating an image. |
generate_image |
Generate an image synchronously and return it as MCP image content with metadata. |
generate_image_async |
Create an asynchronous generation task and return its taskId. |
list_generation_tasks |
List generation tasks with pagination and optional status filtering. |
get_generation_task |
Get task details and public image URLs after completion. |
wait_for_generation_task |
Poll until a task succeeds or fails. |
Usage
Synchronous generation
{
"name": "generate_image",
"arguments": {
"provider": "google",
"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"
}
}
}
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.
Asynchronous generation
For large images or batch jobs, use:
generate_image_async -> wait_for_generation_task
The completed task returns a public image URL.
Credit estimation
{
"name": "estimate_credits",
"arguments": {
"provider": "google",
"prompt": "A Shiba Inu running through a snowy landscape",
"imageConfig": {
"imageSize": "4K"
}
}
}
Parameters
provider:google,openai,alibaba, orbytedance; routing followsmodel.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.imageConfig.imageSize:1K,2K, or4K.wan2.7-imagedoes not support 4K;seedream-5-0-prosupports only 1K and 2K.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: up to 14 for Gemini, 4 for GPT-Image-2, 9 for Wan2.7, and 10 for Seedream.
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
Links
- Labnana integration guide
- Labnana OpenAPI reference
- Credit guide
- GitHub repository
- Technical support: support@marswave.ai
License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。