home / mcp / ai image mcp server
Provides AI-powered image analysis and generation via MCP clients using OpenAI Vision and image models.
Configuration
View docs{
"mcpServers": {
"kareemaly-ai-image-mcp": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/ai-image-mcp",
"run",
"main.py"
],
"env": {
"OPENAI_API_KEY": "your-api-key-here"
}
}
}
}You operate an MCP server that delivers AI-powered image analysis and generation capabilities, enabling you to analyze images, compare visuals, extract metadata, and generate or edit images through a unified command protocol. This guide helps you install, run, and integrate the AI Image MCP Server with MCP clients so you can build workflows that analyze assets and produce new visuals automatically.
Connect your MCP client to the AI Image MCP Server to access its analysis and generation tools. You can perform tasks such as describe_image, analyze_image_content, compare_images, get_image_metadata, generate_image, edit_image, create_image_variations, and more. Use the clientβs MCP integration to load the server, then invoke the tool endpoints with appropriate parameters. Results can be cached for efficiency and saved to your local file system as configured by the server.
Typical usage patterns include: batch analyze a folder of images to generate descriptions and color palettes, compare two assets to spot stylistic differences, or generate new images from text prompts and then edit them using prompts. Generated assets are saved in organized directories with timestamped filenames to prevent conflicts.
Prerequisites you need before installing the server: Python 3.13 or newer, a working OpenAI API key with Vision API and Image Generation access, and the uv runtime installed.
Install the uv runtime and MCP client dependencies, then install the serverβs Python package set. Run the following commands in sequence to set up and start the server.
curl -LsSf https://astral.sh/uv/install.sh | sh
uv add mcp[cli] openai pillow requests
`After dependencies are installed, set your API key and start the server so MCP clients can connect.
export OPENAI_API_KEY="your-api-key-here"
uv run main.pyGet detailed image descriptions for a given image path with an optional prompt. Returns a rich description and can leverage caching for performance.
Perform targeted analysis on specific aspects such as general description, objects, text, colors, composition, or emotions.
Compare two images and highlight similarities and differences based on a chosen focus.
Extract technical metadata from an image, including size, dimensions, format, color mode, and aspect ratio.
Provide statistics about the analysis cache, including file counts and storage usage.
Clear all cached image analysis results to free up space and reset cached data.
Create images from text prompts using DALL-E 2, DALL-E 3, or GPT-Image-1 with configurable size, quality, and output directory.
Edit an existing image using a text prompt and optional mask, choosing between GPT-Image-1 and DALL-E 2 as the model.
Generate multiple variations of a source image using DALL-E 2 with configurable size and output.
List all generated images in a directory with metadata such as size and modification date.