JSPM

duomi-nanobanana-zijie

1.2.3
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 6
    • Score
      100M100P100Q45355F
    • License MIT

    MCP server for AI-powered image generation and editing using Duomi Nano Banana API

    Package Exports

    • duomi-nanobanana-zijie
    • duomi-nanobanana-zijie/dist/index.js

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (duomi-nanobanana-zijie) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    duomi-nanobanana-zijie

    MCP (Model Context Protocol) server for AI-powered image generation using Duomi Nano Banana API (Google Gemini).

    Features

    • Text-to-image generation - Create images from text prompts
    • Image editing/transformation - Edit and transform images with AI (supports up to 5 reference images)
    • Support for multiple models (Gemini 2.5 Pro / Gemini 3 Pro)
    • Configurable aspect ratios and resolutions (1K/2K/4K)
    • Automatic task polling and result retrieval
    • Easy configuration via environment variables

    Installation

    Via npm

    npm install -g duomi-nanobanana-zijie

    Via npx (no installation)

    npx duomi-nanobanana-zijie

    Configuration

    Configure your Duomi API key as an environment variable in your MCP client.

    Get your API key from: https://duomiapi.com

    Usage with Claude Desktop

    Add this to your Claude Desktop configuration with your API key:

    macOS/Linux

    Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

    {
      "mcpServers": {
        "duomi-nanobanana-zijie": {
          "command": "npx",
          "args": ["-y", "duomi-nanobanana-zijie"],
          "env": {
            "DUOMI_API_KEY": "your-duomi-api-key-here"
          }
        }
      }
    }

    Windows

    Edit %APPDATA%\Claude\claude_desktop_config.json:

    {
      "mcpServers": {
        "duomi-nanobanana-zijie": {
          "command": "npx",
          "args": ["-y", "duomi-nanobanana-zijie"],
          "env": {
            "DUOMI_API_KEY": "your-duomi-api-key-here"
          }
        }
      }
    }

    Available Tools

    1. text_to_image - Text-to-Image Generation

    Generate an image from a text prompt.

    Parameters

    Parameter Type Required Description Default
    prompt string Text description of the image to generate -
    model string Model: gemini-2.5-pro-image-preview or gemini-3-pro-image-preview gemini-2.5-pro-image-preview
    aspect_ratio string Aspect ratio (e.g., 16:9, 1:1, 3:4) 16:9
    image_size string Resolution: 1K, 2K, or 4K (4K only for pro model) 2K

    Example Usage in Claude

    User: Generate an image of a lion on the grassland
    
    Claude: [Calls text_to_image tool with prompt="A lion on the grassland"]

    Response Format

    {
      "success": true,
      "taskId": "05ed364d-b392-8d18-97c2-eb6ea797541b",
      "imageUrl": "https://cdn3.dmiapi.com/attachments/gemini/.../image.jpeg",
      "fileName": "output.jpeg",
      "description": "Here is an image of a lion on the grassland",
      "prompt": "A lion on the grassland",
      "model": "gemini-2.5-pro-image-preview",
      "aspectRatio": "16:9",
      "imageSize": "2K"
    }

    2. edit_image - Image Editing/Transformation

    Edit or transform images using text prompts and reference images. Upload up to 5 reference images to guide the generation.

    Parameters

    Parameter Type Required Description Default
    prompt string Text description for the image editing/transformation -
    image_urls array Array of reference image URLs (1-5 images) -
    model string Model: gemini-2.5-pro-image-preview or gemini-3-pro-image-preview gemini-2.5-pro-image-preview
    aspect_ratio string Aspect ratio (e.g., 16:9, 1:1, 3:4). Recommended to omit for auto-adaptation "" (auto-adapt)
    image_size string Resolution: 1K, 2K, or 4K (4K only for pro model) 2K

    Example Usage in Claude

    User: Make this photo look like a watercolor painting
    [User provides image URL: https://example.com/photo.jpg]
    
    Claude: [Calls edit_image tool with:
      prompt="Convert to watercolor painting style",
      image_urls=["https://example.com/photo.jpg"]
    ]

    Response Format

    {
      "success": true,
      "taskId": "3fb45a4a-750d-39bb-04da-4337a0f450bd",
      "imageUrl": "https://cdn3.dmiapi.com/attachments/gemini/.../output.jpeg",
      "fileName": "output.jpeg",
      "description": "Watercolor painting style applied",
      "prompt": "Convert to watercolor painting style",
      "referenceImages": ["https://example.com/photo.jpg"],
      "model": "gemini-2.5-pro-image-preview",
      "aspectRatio": "auto-adapt",
      "imageSize": "2K"
    }

    Notes

    • Maximum 5 reference images allowed
    • For single reference image, aspect_ratio defaults to auto-adapt to the reference image
    • For multiple reference images, you can specify a custom aspect_ratio if needed

    Models

    Standard Model: gemini-2.5-pro-image-preview

    • Resolution: 1K, 2K
    • Cost: 0.07 yuan/image
    • Good for general use

    Pro Model: gemini-3-pro-image-preview

    • Resolution: 1K, 2K, 4K
    • Cost: 0.14 yuan/image
    • Higher quality output

    Aspect Ratios

    Supported aspect ratios:

    • 16:9 - Landscape (default, 1920x1080)
    • 1:1 - Square
    • 3:4 - Portrait
    • 4:3 - Landscape
    • 9:16 - Vertical
    • And more...

    Development

    Build from source

    git clone <your-repo-url>
    cd duomi-nanobanana-zijie
    npm install
    npm run build

    Run locally

    npm run build
    node dist/index.js

    Watch mode

    npm run watch

    Publishing to npm

    # Login to npm
    npm login
    
    # Publish
    npm publish

    Troubleshooting

    DUOMI_API_KEY environment variable not set

    Make sure you've configured the env section in your MCP client configuration with your API key:

    {
      "mcpServers": {
        "duomi-nanobanana-zijie": {
          "command": "npx",
          "args": ["-y", "duomi-nanobanana-zijie"],
          "env": {
            "DUOMI_API_KEY": "your-api-key-here"
          }
        }
      }
    }

    Task timeout

    If image generation takes too long, the server will timeout after 30 polling attempts (60 seconds). Try again with a simpler prompt.

    API errors

    Check that your API key is valid and you have sufficient credits at https://duomiapi.com.

    License

    MIT

    Credits