universal-image-mcp

universal-image-mcp

MCP server for multi-provider AI image generation (AWS Bedrock, OpenAI, Google Gemini) enabling image generation, transformation, and editing through a unified interface.

Category
访问服务器

README

Universal Image MCP - Multi-Provider AI Image Generation Server for Claude Desktop & MCP Clients

Universal MCP server for AI image generation supporting AWS Bedrock (Nova Canvas), OpenAI (GPT Image, DALL-E), and Google Gemini (Imagen 4). Generate, transform, and edit images using multiple AI models through a single Model Context Protocol interface.

Python
License: MIT
MCP

What is Universal Image MCP?

Universal Image MCP is a Model Context Protocol (MCP) server that provides unified access to multiple AI image generation providers. Whether you're using Claude Desktop, Kiro IDE, or any MCP-compatible client, this server lets you generate and transform images using: n

  • AWS Bedrock - Amazon Nova Canvas for enterprise-grade image generation
  • OpenAI - GPT Image 1.5, ChatGPT Image, DALL-E models
  • Google Gemini - Gemini 2.5 Flash Image, Imagen 4, Imagen 4 Ultra

Perfect for developers building AI applications, content creators, and anyone needing programmatic access to multiple image generation APIs through a single interface.

Example Outputs

Comparison of architecture diagrams generated by different models using this MCP server:

<table><thead><tr><th>Style</th><th>Model</th><th>Output</th></tr></thead><tbody><tr><td><strong>Technical Diagram</strong></td><td>OpenAI <code>gpt-image-1.5</code></td><td><img src="https://raw.githubusercontent.com/manu-mishra/universal-image-mcp/main/images/universal-image-mcp-architecture.png" alt="Universal Image MCP Server Architecture Diagram - OpenAI GPT Image 1.5 - Multi-provider AI image generation with AWS Bedrock, OpenAI, Google Gemini integration"></td></tr><tr><td><strong>Technical Diagram</strong></td><td>Google <code>gemini-2.5-flash-image</code></td><td><img src="https://raw.githubusercontent.com/manu-mishra/universal-image-mcp/main/images/universal-image-mcp-architecture-gemini.png" alt="Universal Image MCP Server Architecture Diagram - Google Gemini 2.5 Flash - Model Context Protocol for AI image generation"></td></tr><tr><td><strong>Technical Diagram</strong></td><td>AWS <code>amazon.nova-canvas-v1:0</code></td><td><img src="https://raw.githubusercontent.com/manu-mishra/universal-image-mcp/main/images/universal-image-mcp-architecture-nova.png" alt="Universal Image MCP Server Architecture Diagram - AWS Bedrock Nova Canvas - Enterprise AI image generation architecture"></td></tr><tr><td><strong>3D Clay Art</strong></td><td>Google <code>gemini-2.5-flash-image</code></td><td><img src="https://raw.githubusercontent.com/manu-mishra/universal-image-mcp/main/images/universal-image-mcp-architecture-clay-gemini.png" alt="3D Clay Art Style MCP Architecture - Google Gemini 2.5 Flash - AI-generated technical diagram in cute clay aesthetic"></td></tr><tr><td><strong>3D Clay Art</strong></td><td>OpenAI <code>gpt-image-1.5</code></td><td><img src="https://raw.githubusercontent.com/manu-mishra/universal-image-mcp/main/images/universal-image-mcp-architecture-clay-openai.png" alt="3D Clay Art Style MCP Architecture - OpenAI GPT Image 1.5 - AI image generation server in 3D clay art style"></td></tr><tr><td><strong>3D Clay Art</strong></td><td>AWS <code>amazon.nova-canvas-v1:0</code></td><td><img src="https://raw.githubusercontent.com/manu-mishra/universal-image-mcp/main/images/universal-image-mcp-architecture-clay-nova.png" alt="3D Clay Art Style MCP Architecture - AWS Nova Canvas - Multi-provider image generation in pastel clay aesthetic"></td></tr></tbody></table>

View Prompt Used

Technical Diagram Prompt:

Technical architecture diagram of a Universal Image MCP Server system. The diagram shows:

Top layer: MCP Client (Claude Desktop, Kiro IDE) connecting via Model Context Protocol

Middle layer: Universal Image MCP Server (FastMCP) with three main components:
1. Server Module (server.py) - handles list_models, generate_image, transform_image, prompt_guide tools
2. Provider Module (providers.py) - manages lazy initialization and provider abstraction
3. Configuration - environment variables for ENABLE_AWS, ENABLE_OPENAI, ENABLE_GEMINI

Bottom layer: Three provider boxes side by side:
- AWS Bedrock (boto3) - Amazon Nova Canvas, with AWS credentials and region config
- OpenAI API - GPT Image 1.5, ChatGPT Image Latest, with API key
- Google Gemini API - Gemini 2.5 Flash, Imagen 4, with API key

Data flow arrows showing:
- Client sends tool requests to Server
- Server routes to appropriate Provider based on model_id
- Providers make API calls to their respective services
- Image data flows back through the chain

Clean, professional software architecture diagram style with boxes, arrows, and labels. Use blue and gray color scheme. Modern technical documentation aesthetic. Isometric or layered view showing clear separation of concerns.

3D Clay Art Prompt:

Same technical architecture content as above, but rendered in:

3D clay art style with soft rounded shapes, pastel colors, cute minimalist aesthetic, soft studio lighting, clean composition with depth and shadows.

Note: 3D Clay Art versions used s3tablearch.png as a reference image for style guidance.

Key Features

  • 🔄 Multi-Provider Support - Switch between AWS Bedrock, OpenAI, and Google Gemini seamlessly
  • 🚀 Dynamic Model Discovery - Automatically fetches latest available models from each provider API
  • Lazy Initialization - Provider clients load only when needed for optimal performance
  • 🎨 Reference Image Support - Generate new images based on existing image styles
  • 📐 Configurable Dimensions - Custom width/height for supported AI models
  • 📚 Built-in Prompt Guide - Best practices for writing effective image generation prompts
  • 🔌 MCP Protocol - Works with Claude Desktop, Kiro IDE, and all MCP-compatible clients
  • 🐍 Python 3.11+ - Modern Python with type hints and async support

Quick Start Installation

Install via pip:

pip install universal-image-mcp

Or use with uvx (recommended for MCP servers):

uvx universal-image-mcp@latest

MCP Server Configuration

For Claude Desktop

Add to your Claude Desktop MCP configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "universal-image-mcp": {
      "command": "uvx",
      "args": ["universal-image-mcp@latest"],
      "env": {
        "ENABLE_AWS": "true",
        "AWS_PROFILE": "default",
        "AWS_REGION": "us-east-1",
        
        "ENABLE_OPENAI": "true",
        "OPENAI_API_KEY": "sk-...",
        
        "ENABLE_GEMINI": "true",
        "GEMINI_API_KEY": "..."
      }
    }
  }
}

For Kiro IDE

Add to ~/.kiro/settings/mcp.json:

{
  "mcpServers": {
    "universal-image-mcp": {
      "command": "uvx",
      "args": ["universal-image-mcp@latest"],
      "env": {
        "ENABLE_AWS": "true",
        "ENABLE_OPENAI": "true",
        "OPENAI_API_KEY": "sk-...",
        "ENABLE_GEMINI": "true",
        "GEMINI_API_KEY": "..."
      }
    }
  }
}

Getting API Keys and Credentials

Before using this MCP server, you'll need to obtain credentials for the providers you want to use.

AWS Bedrock Setup

AWS Bedrock uses your local AWS credentials. You have several options:

  1. AWS CLI Configuration (Recommended)

  2. AWS Credentials File

  3. Environment Variables

Getting AWS Access Keys:

  • Sign in to the AWS Console
  • Navigate to IAM → Users → Your User → Security Credentials
  • Create a new access key under "Access keys"
  • Ensure your IAM user has permissions for Bedrock (e.g., AmazonBedrockFullAccess policy)

OpenAI API Key

  1. Create an OpenAI Account

  2. Generate API Key

    • Go to API Keys page
    • Click "Create new secret key"
    • Give it a descriptive name (optional)
    • Copy the key immediately (you won't be able to see it again)
  3. Add Billing Information

    • OpenAI requires payment information to use the API
    • Navigate to Billing to add payment details

Official Documentation: OpenAI Quickstart Guide

Google Gemini API Key

  1. Get a Gemini API Key

    • Visit Google AI Studio
    • Sign in with your Google account
    • Click "Get API Key" or "Create API Key"
    • Create a new project or select an existing one
    • Copy your API key
  2. Alternative: Google Cloud API Key

Official Documentation: Gemini API Quickstart

Environment Variables

<table><thead><tr><th>Variable</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>ENABLE_AWS</code></td><td>No</td><td>Enable AWS Bedrock provider (<code>true</code>/<code>false</code>, default: <code>false</code>)</td></tr><tr><td><code>AWS_PROFILE</code></td><td>No</td><td>AWS profile name (default, SSO, or named profile)</td></tr><tr><td><code>AWS_REGION</code></td><td>No</td><td>AWS region (default: <code>us-east-1</code>)</td></tr><tr><td><code>ENABLE_OPENAI</code></td><td>No</td><td>Enable OpenAI provider (<code>true</code>/<code>false</code>, default: <code>false</code>)</td></tr><tr><td><code>OPENAI_API_KEY</code></td><td>If OpenAI enabled</td><td>OpenAI API key from <a href="https://platform.openai.com/account/api-keys">platform.openai.com</a></td></tr><tr><td><code>ENABLE_GEMINI</code></td><td>No</td><td>Enable Google Gemini provider (<code>true</code>/<code>false</code>, default: <code>false</code>)</td></tr><tr><td><code>GEMINI_API_KEY</code></td><td>If Gemini enabled</td><td>Google Gemini API key from <a href="https://ai.google.dev/gemini-api/docs/api-key">Google AI Studio</a></td></tr></tbody></table>

API Reference - MCP Tools

list_models()

List all available AI image generation models from enabled providers. Models are fetched dynamically from each provider's API with deprecated models automatically filtered.

Returns: Formatted list of model IDs compatible with generate_image() and transform_image()

Example models:

  • AWS: amazon.nova-canvas-v1:0
  • OpenAI: gpt-image-1.5, chatgpt-image-latest
  • Gemini: models/gemini-2.5-flash-image, models/imagen-4.0-generate-001

generate_image(prompt, model_id, output_path, reference_image?, width?, height?)

Generate AI images from text prompts using any supported model.

<table><thead><tr><th>Parameter</th><th>Required</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td><code>prompt</code></td><td>Yes</td><td>-</td><td>Detailed text description of the image. Be specific about subject, style, lighting, colors, composition, and mood.</td></tr><tr><td><code>model_id</code></td><td>Yes</td><td>-</td><td>Model ID from <code>list_models()</code>. Examples: <code>amazon.nova-canvas-v1:0</code>, <code>gpt-image-1.5</code>, <code>models/gemini-2.5-flash-image</code></td></tr><tr><td><code>output_path</code></td><td>Yes</td><td>-</td><td>File path to save the generated image. Parent directories created automatically.</td></tr><tr><td><code>reference_image</code></td><td>No</td><td>None</td><td>Path to reference image for style/content guidance</td></tr><tr><td><code>width</code></td><td>No</td><td>1024</td><td>Image width in pixels. Note: Some models only support specific sizes.</td></tr><tr><td><code>height</code></td><td>No</td><td>1024</td><td>Image height in pixels. Note: Some models only support specific sizes.</td></tr></tbody></table>

transform_image(image_path, prompt, model_id, output_path)

Transform and edit existing images using AI-powered modifications based on text prompts.

<table><thead><tr><th>Parameter</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>image_path</code></td><td>Yes</td><td>Path to source image to transform (PNG, JPEG, etc.)</td></tr><tr><td><code>prompt</code></td><td>Yes</td><td>AI transformation instructions (e.g., "Make it black and white", "Add a rainbow", "Convert to watercolor style")</td></tr><tr><td><code>model_id</code></td><td>Yes</td><td>Model ID from <code>list_models()</code></td></tr><tr><td><code>output_path</code></td><td>Yes</td><td>File path to save the transformed image</td></tr></tbody></table>

Use cases: Image editing, style transfer, AI-powered photo manipulation, artistic transformations

prompt_guide()

Get AI prompt engineering best practices for image generation. Returns comprehensive guidelines covering:

  • Prompt structure (Subject + Details + Style + Lighting + Mood + Composition)
  • Specific vs generic descriptions
  • Style, lighting, and mood keywords
  • Example prompts for different use cases

Supported AI Image Models

All models are discovered dynamically. Use list_models() to see current options.

AWS Bedrock Models

  • Amazon Nova Canvas (amazon.nova-canvas-v1:0) - Enterprise-grade image generation with text and image input support

OpenAI Models

  • GPT Image 1.5 (gpt-image-1.5) - Latest OpenAI image generation model
  • ChatGPT Image Latest (chatgpt-image-latest) - ChatGPT-integrated image generation

Google Gemini Models

  • Gemini 2.5 Flash Image (models/gemini-2.5-flash-image) - Fast, efficient image generation
  • Gemini 3 Pro Image (models/gemini-3-pro-image-preview) - Advanced image generation capabilities
  • Imagen 4 (models/imagen-4.0-generate-001) - Google's state-of-the-art image model
  • Imagen 4 Ultra (models/imagen-4.0-ultra-generate-001) - Highest quality Imagen model
  • Imagen 4 Fast (models/imagen-4.0-fast-generate-001) - Optimized for speed

Use Cases

  • AI Application Development - Integrate multiple image generation providers into your apps
  • Content Creation - Generate marketing materials, social media content, illustrations
  • Prototyping & Design - Quickly visualize concepts and design ideas
  • Image Editing Automation - Batch process and transform images with AI
  • Research & Experimentation - Compare outputs across different AI models
  • Claude Desktop Workflows - Enhance Claude conversations with image generation
  • Developer Tools - Build MCP-compatible tools and extensions

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Related Projects

Keywords

mcp-server image-generation ai-images aws-bedrock openai google-gemini claude-desktop imagen nova-canvas python fastmcp model-context-protocol ai-art text-to-image image-transformation

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选