Universal Image Generator logo

Universal Image Generator

Community
ECNU3D

This project is a fork and rewrite of the original: https://github.com/qhdrl12/mcp-server-gemini-image-generator repo.

PublisherECNU3D
Repositoryuniversal-image-generator-mcp
LanguagePython
Forks
1
Stars
2
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Universal Image Generator 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

    2 stars and 1 forks from the linked repository.

Universal Image Generator MCP Server

PyPI version License Python versions

This project is a fork and rewrite of the original: https://github.com/qhdrl12/mcp-server-gemini-image-generator repo.

Multi-provider AI image generation server for MCP clients. Generate high-quality images using Google (Imagen & Gemini), ZHIPU AI CogView-4, or Alibaba Bailian through any MCP-compatible application.

Features

  • Multi-Provider Support: Choose between Google (Imagen/Gemini), ZhipuAI, or Bailian
  • Image Generation: Text-to-image for all providers
  • Image Transformation: Edit existing images (Google & Bailian only)
  • Smart Language Optimization: Automatic prompt translation and optimization
  • Local Storage: Save generated images to your specified directory

Quick Setup

1. Install via uvx

No manual installation required! The server will be automatically downloaded and run.

2. Get API Keys

Choose one provider and get an API key:

3. Configure MCP Client

Add to your MCP client configuration (e.g., claude_desktop_config.json):

json
{
    "mcpServers": {
        "universal-image-generator": {
            "command": "uvx",
            "args": [
                "universal-image-generator-mcp"
            ],
            "env": {
                "IMAGE_PROVIDER": "google",
                "GOOGLE_MODEL": "gemini",
                "ZHIPU_API_KEY": "your-api-key-here",
                "GEMINI_API_KEY": "your-api-key-here",
                "DASHSCOPE_API_KEY": "your-api-key-here",
                "OUTPUT_IMAGE_PATH": "/path/to/save/images"
            }
        }
    }
}

Environment Variables:

  • IMAGE_PROVIDER: "google", "zhipuai", or "bailian"
  • GOOGLE_MODEL: "gemini" or "imagen" (only for Google provider, defaults to "gemini")
  • Set the corresponding API key for your chosen provider
  • OUTPUT_IMAGE_PATH: Directory to save generated images (optional)

Available Tools

generate_image_from_text

Create images from text descriptions.

generate_image_from_text(prompt: str, model_type: Optional[str] = None) -> str

Parameters:

  • prompt: Text description of the image to generate
  • model_type: Optional model selection for Google provider ("gemini" or "imagen")
    • Only applies to Google provider
    • If not specified, uses GOOGLE_MODEL environment variable (defaults to "gemini")

transform_image_from_encoded (Google & Bailian only)

Transform images using base64-encoded image data.

transform_image_from_encoded(encoded_image: str, prompt: str) -> str

transform_image_from_file (Google & Bailian only)

Transform existing image files.

transform_image_from_file(image_file_path: str, prompt: str) -> str

Usage Examples

Once configured, ask your AI assistant:

  • "Generate an image of a sunset over mountains"
  • "Create a 3D rendered flying pig in a sci-fi city"
  • "Transform this image by adding snow to the scene"

Generated images are saved to your configured output directory.

Example Output

Prompt: "Create a 3D rendered image of a pig with wings and a top hat flying over a futuristic sci-fi city with lots of greenery"

Flying pig over sci-fi city

Transform: "Add a cute baby whale flying alongside the pig"

Flying pig with baby whale

Provider Capabilities

ProviderModelsGenerationTransformationLanguage Optimization
GoogleImagen, Gemini✅✅ (Gemini only)English prompts
ZhipuAICogView-4✅❌Chinese prompts
BailianWanX-2.1✅✅Chinese prompts

Note: For Google provider, image transformation is only supported with Gemini models. Imagen is for generation only.

Development

Test the server locally:

bash
git clone https://github.com/ECNU3D/universal-image-generator-mcp.git
cd universal-image-generator-mcp
fastmcp dev src/universal_image_generator_mcp/server.py

Visit http://localhost:5173/ to use the MCP Inspector for testing.

License

MIT License

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "universal-image-generator": {
      "command": "uvx",
      "args": [
        "universal-image-generator-mcp"
      ],
      "env": {
        "IMAGE_PROVIDER": "google",
        "GOOGLE_MODEL": "gemini",
        "ZHIPU_API_KEY": "your-api-key-here",
        "GEMINI_API_KEY": "your-api-key-here",
        "DASHSCOPE_API_KEY": "your-api-key-here",
        "OUTPUT_IMAGE_PATH": "/path/to/save/images"
      }
    }
  }
}

Use Universal Image Generator MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Universal Image Generator 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 Universal Image Generator 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 Universal Image Generator 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": {
    "universal-image-generator": {
      "command": "npx",
      "args": [
        "-y",
        "universal-image-generator-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Universal Image Generator 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 Universal Image Generator 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 Universal Image Generator to help me with this task?
Universal Image Generator
Sure. I read it.
Here is what I found using Universal Image Generator.

Frequently asked questions

What is the Universal Image Generator MCP server used for?

Universal Image Generator 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 Universal Image Generator MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Universal Image Generator 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 Universal Image Generator 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 Universal Image Generator connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Universal Image Generator MCP to TypingMind?

Universal Image Generator 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 Universal Image Generator MCP provide in TypingMind?

Universal Image Generator 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 Universal Image Generator MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Universal Image Generator 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 👇