home / mcp / universal image generator mcp server

Universal Image Generator MCP Server

Multi-provider image generation and transformation via an MCP server with local image storage.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ecnu3d-universal-image-generator-mcp": {
      "command": "uvx",
      "args": [
        "universal-image-generator-mcp"
      ],
      "env": {
        "GOOGLE_MODEL": "gemini",
        "ZHIPU_API_KEY": "YOUR_API_KEY_HERE",
        "GEMINI_API_KEY": "YOUR_API_KEY_HERE",
        "IMAGE_PROVIDER": "google",
        "DASHSCOPE_API_KEY": "YOUR_API_KEY_HERE",
        "OUTPUT_IMAGE_PATH": "/path/to/save/images"
      }
    }
  }
}

You can run a multi-provider image generation MCP server that accepts text prompts and returns generated images. It supports Google Imagen/Gemini, ZhipuAI CogView-4, and Bailian, with optional image transformations and automatic prompt handling. This server is designed to plug into MCP clients so you can generate and transform images from a single, centralized service.

How to use

After you configure the MCP client with the provided settings, you can request image generation and transformation through your MCP-enabled assistant. Choose a provider by setting the IMAGE_PROVIDER environment variable and provide your API keys for the chosen provider. You can generate images from text prompts, and for Google you can apply transformations to existing images when Gemini is used.

How to install

Prerequisites: ensure the MCP client environment supports the MCP server setup described here. You will use the MCP client configuration to launch the server through the included runtime command.

1) Prepare the MCP client configuration. Copy the JSON structure shown below and save it to your MCP client configuration file (for example claude_desktop_config.json). This config tells the MCP client to run the universal image generator server and passes the required environment variables.

{
  "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"
      }
    }
  }
}

Additional notes

Environment variables control provider selection and output. The server stores generated images in the directory you specify with OUTPUT_IMAGE_PATH. Replace the placeholder API key values with your actual keys from the corresponding provider: Google for Gemini/Imagen, ZHIPU AI, or Bailian.

Configuration details

Environment Variables available to configure your MCP server include the following. You set these in the MCP client config as shown in the example above.

Usage examples

- Generate an image from a text prompt: a sunset over mountains. - Create a 3D-rendered flying pig in a sci-fi city. - Transform an existing image by adding snow to the scene (Google & Bailian only).

Provider capabilities at a glance

Google supports Imagen and Gemini with generation available for both; image transformation is Gemini-only. ZhipuAI provides CogView-4 with generation (transformation not supported). Bailian uses WanX-2.1 for generation and transformation with Chinese prompts.

Security and maintenance

Keep API keys secret. Rotate keys as recommended by each provider. Limit output paths to directories you control and monitor generated content as part of routine security practices.

Available tools

generate_image_from_text

Create images from text descriptions. Optional model_type for Google (gemini or imagen); uses GOOGLE_MODEL if model_type is not provided.

transform_image_from_encoded

Transform images using base64-encoded image data (Google & Bailian only).

transform_image_from_file

Transform existing image files (Google & Bailian only).