Ai Image Gen MCP logo

Ai Image Gen MCP

Community
mikeyny

An MCP (Model Context Protocol) server implementation for generating images using Replicate's black-forest-labs/flux-schnell model.

Publishermikeyny
Repositoryai-image-gen-mcp
LanguageTypeScript
Forks
14
Stars
123
Available tools
0
Transport typestdio
Links
  • Connect tools to AI workflows

    Ai Image Gen MCP exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    123 stars and 14 forks from the linked repository.

Image Generation MCP Server

An MCP (Model Context Protocol) server implementation for generating images using Replicate's black-forest-labs/flux-schnell model.

Ideally to be used with Cursor's MCP feature, but can be used with any MCP client.

Features

  • Generate images from text prompts
  • Configurable image parameters (resolution, aspect ratio, quality)
  • Save generated images to specified directory
  • Full MCP protocol compliance
  • Error handling and validation

Prerequisites

  • Node.js 16+
  • Replicate API token
  • TypeScript SDK for MCP

Setup

  1. Clone the repository

  2. Install dependencies:

    bash
    npm install
  3. Add your Replicate API token directly in the code at src/imageService.ts by updating the apiToken constant:

    bash
    // No environment variables are used since they can't be easily set in cursor
    const apiToken = "your-replicate-api-token-here";

    Note: If using with Claude, you can create a .env file in the root directory and set your API token there:

    bash
    REPLICATE_API_TOKEN=your-replicate-api-token-here

    Then build the project:

    bash
    npm run build

Usage

To use with cursor:

  1. Go to Settings
  2. Select Features
  3. Scroll down to "MCP Servers"
  4. Click "Add new MCP Server"
  5. Set Type to "Command"
  6. Set Command to: node ./path/to/dist/server.js

API Parameters

ParameterTypeRequiredDefaultDescription
promptstringYes-Text prompt for image generation
output_dirstringYes-Server directory path to save generated images
go_fastbooleanNofalseEnable faster generation mode
megapixelsstringNo"1"Resolution quality ("1", "2", "4")
num_outputsnumberNo1Number of images to generate (1-4)
aspect_ratiostringNo"1:1"Aspect ratio ("1:1", "4:3", "16:9")
output_formatstringNo"webp"Image format ("webp", "png", "jpeg")
output_qualitynumberNo80Compression quality (1-100)
num_inference_stepsnumberNo4Number of denoising steps (4-20)

Example Request

json
{
  "prompt": "black forest gateau cake spelling out 'FLUX SCHNELL'",
  "output_dir": "/var/output/images",
  "filename": "black_forest_cake",
  "output_format": "webp"
  "go_fast": true,
  "megapixels": "1",
  "num_outputs": 2,
  "aspect_ratio": "1:1"
}

Example Response

json
{
  "image_paths": [
    "/var/output/images/output_0.webp",
    "/var/output/images/output_1.webp"
  ],
  "metadata": {
    "model": "black-forest-labs/flux-schnell",
    "inference_time_ms": 2847
  }
}

Error Handling

The server handles the following error types:

  • Validation errors (invalid parameters)
  • API errors (Replicate API issues)
  • Server errors (filesystem, permissions)
  • Unknown errors (unexpected issues)

Each error response includes:

  • Error code
  • Human-readable message
  • Detailed error information

License

ISC

Use Ai Image Gen MCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Ai Image Gen MCP is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Ai Image Gen MCP as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Ai Image Gen MCP MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "ai-image-gen-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Ai Image Gen MCP MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Ai Image Gen MCP MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Ai Image Gen MCP to help me with this task?
Ai Image Gen MCP
Sure. I read it.
Here is what I found using Ai Image Gen MCP.

Frequently asked questions

What is the Ai Image Gen MCP MCP server used for?

Ai Image Gen MCP is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Ai Image Gen MCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Ai Image Gen MCP with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Ai Image Gen MCP MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Ai Image Gen MCP connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Ai Image Gen MCP MCP to TypingMind?

Ai Image Gen MCP runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Ai Image Gen MCP MCP provide in TypingMind?

Ai Image Gen MCP exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Ai Image Gen MCP MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Ai Image Gen MCP requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇