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 🙏

© 2026 – Pkg Stats / Ryan Hefner

generate-image-mcp

v1.3.1

Published

MCP server for AI image generation and repaint with vision analysis

Downloads

695

Readme

Generate Image MCP

Let AI generate and edit images directly in Claude Desktop, OpenCode, Cursor, and other MCP-compatible clients.

Features

  • Multi-turn Dialogue - Collect user requirements step by step
  • Smart Inference - Automatically infer missing parameters from context
  • Session Management - Maintain conversation state across multiple calls
  • No Auto-fill - Never fill in parameters without user confirmation

Quick Start

1. Install

npm install -g generate-image-mcp

2. Get an API key

Register at agnes-ai.com to get your API key (free quota available).

3. Configure

Add to your MCP config file:

OpenCode (~/.config/opencode/opencode.json):

{
  "mcp": {
    "generate-image": {
      "type": "local",
      "command": ["npx", "generate-image-mcp"],
      "enabled": true,
      "environment": {
        "AGNES_API_KEY": "your-api-key-here",
        "AGNES_API_URL": "https://apihub.agnes-ai.com/v1/images/generations"
      }
    }
  }
}

Claude Desktop (%APPDATA%\Claude\claude_desktop_config.json):

{
  "mcpServers": {
    "generate-image": {
      "command": "npx",
      "args": ["-y", "generate-image-mcp"],
      "env": {
        "AGNES_API_KEY": "your-api-key-here"
      }
    }
  }
}

Other clients:

| Client | Config file | |--------|-------------| | Claude Desktop | %APPDATA%\Claude\claude_desktop_config.json | | OpenCode | ~/.config/opencode/opencode.json | | Cursor | ~/.cursor/mcp.json | | Windsurf | ~/.windsurf/mcp.json | | Cline (VS Code) | Cline MCP settings UI |

4. Restart your client

Done! Ask your AI: "Generate an image of a sunset over mountains".

How It Works

Multi-turn Dialogue

When you ask to generate an image, the tool will:

  1. Analyze your request - Extract what it can understand
  2. Ask for missing info - Generate 4 options for you to choose
  3. Collect your choices - Remember across multiple calls
  4. Generate image - Only when all info is complete

Example:

User: Generate a garlic zombie image
AI: What type of scene? A) Character *recommended B) Abstract C) Animal D) Product
User: A
AI: What style? A) Realistic *recommended B) Anime C) Oil painting D) 3D
User: Realistic
AI: What background? A) Natural *recommended B) Indoor C) Urban D) Auto
User: A
→ Image generated!

Smart Inference

The tool can infer missing parameters from context:

  • User selects "Anime style" → style = "anime"
  • User selects "City night" → scene_type = "city" AND background = "urban"
  • User selects "Neon lights" → lighting = "special effects"

Tools

generate_image

Generate an image from a text description.

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | raw_input | string | Yes | User's original input, passed directly without modification | | session_id | string | No | Session ID for multi-turn dialogue | | size | string | No | Image size (default: 1024x1024) | | model | string | No | Model name (default: agnes-image-2.1-flash) | | n | number | No | Number of images (default: 1) |

repaint_image

Edit an existing image by describing what to change.

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | image_url | string | Yes | URL of the original image | | edit_prompt | string | Yes | Description of changes | | size | string | No | Image size (default: 1024x768) | | model | string | No | Model name (default: agnes-image-2.1-flash) | | strength | number | No | Edit strength 0-1 (default: 0.7) |

Configuration

Environment Variables

| Variable | Required | Default | Description | |----------|----------|---------|-------------| | AGNES_API_KEY | Yes | — | Your Agnes AI API key | | AGNES_API_URL | No | https://apihub.agnes-ai.com/v1/images/generations | API endpoint |

Alternative Providers

OpenAI DALL-E:

"environment": {
  "IMAGE_PROVIDER": "openai",
  "IMAGE_API_KEY": "sk-your-openai-key",
  "IMAGE_MODEL": "dall-e-3"
}

Stability AI:

"environment": {
  "IMAGE_PROVIDER": "stability",
  "IMAGE_API_KEY": "sk-your-stability-key"
}

API Key Sources

| Provider | Get a key at | |----------|-------------| | Agnes AI | agnes-ai.com | | OpenAI | platform.openai.com | | Stability AI | platform.stability.ai |

From Source (Developers)

git clone https://github.com/m1908293028-boop/generate-image-mcp.git
cd generate-image-mcp
npm install
npm run build

Then configure with the local path:

{
  "mcp": {
    "generate-image": {
      "type": "local",
      "command": ["node", "path/to/generate-image-mcp/dist/server.js"],
      "enabled": true,
      "environment": {
        "AGNES_API_KEY": "your-api-key-here"
      }
    }
  }
}

Changelog

v1.2.0

  • Added multi-turn dialogue with session management
  • Added smart inference for missing parameters
  • Removed auto-fill behavior
  • Added option letter parsing (A/B/C/D)
  • Added deduplication logic in prompt building

v1.1.x

  • Initial release with basic image generation

License

MIT