labnana-mcp

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.

Category
Visit Server

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

GitHub · npm · 中文文档

Installation

Claude Code

  1. Create an API key in the Labnana API Keys console.
  2. Make LABNANA_API_KEY available in the environment used by Claude Code.
  3. 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, or bytedance; routing follows model.
  • 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, or seedream-5-0-pro.
  • imageConfig.imageSize: 1K, 2K, or 4K. wan2.7-image does not support 4K; seedream-5-0-pro supports 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, or 8:1. GPT-Image-2 may omit this field and let the service choose; Wan2.7 supports only 1:1, 16:9, 9:16, 4:3, and 3: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

License

Apache-2.0

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured