npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

image-brother

v1.2.1

Published

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

Readme

image-brother

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 image-brother

Via npx (no installation)

npx image-brother

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": {
    "image-brother": {
      "command": "npx",
      "args": ["-y", "image-brother"],
      "env": {
        "DUOMI_API_KEY": "your-duomi-api-key-here"
      }
    }
  }
}

Windows

Edit %APPDATA%\Claude\claude_desktop_config.json:

{
  "mcpServers": {
    "image-brother": {
      "command": "npx",
      "args": ["-y", "image-brother"],
      "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 image-brother
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": {
    "image-brother": {
      "command": "npx",
      "args": ["-y", "image-brother"],
      "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