Azure Image Editor MCP Server
δΈζ | English
This is an MCP (Model Context Protocol) server that supports Azure AI Foundry image generation and editing capabilities.
Features
Text-to-Image Generation - Generate high-quality images from text descriptions using Azure AI Foundry models
Image Editing - Edit and modify existing images
Configurable Models - Support for multiple Azure AI models via environment variables
Demo
Click π to go to the demo on YouTube

Project Structure
Prerequisites
β οΈ Important: Before using this MCP server, you must deploy the required model in your Azure AI Foundry environment.
Azure AI Foundry Model Deployment
Access Azure AI Foundry: Go to Azure AI Foundry
Deploy the model: Deploy
flux.1-kontext-pro(or your preferred model) in your Azure AI Foundry workspaceGet deployment details: Note down your:
Base URL (endpoint)
API key
Deployment name
Model name
Without proper model deployment, the MCP server will not function correctly.
Installation and Setup
Clone and setup environment:
Server Modes
This project supports two MCP server modes:
1. STDIO Mode (Default)
Communicates via standard input/output. Suitable for VSCode integration.
2. HTTP/JSON-RPC Mode
Communicates via HTTP with JSON-RPC 2.0 protocol. Suitable for web applications and remote access.
Configuration
Configure STDIO Mode (VSCode MCP)
Add the following to your VSCode MCP configuration:
Important: Replace /full/path/to/ with the actual absolute path to this project directory.
Configure HTTP/JSON-RPC Mode
Option 1: Run directly with environment variables
Option 2: Use .env file
Create a .env file in the project root:
Then start the server:
Server Endpoints
When the HTTP server is running, the following endpoints are available:
JSON-RPC Endpoint:
http://127.0.0.1:8000/- Main JSON-RPC 2.0 endpoint (POST)Health Check:
http://127.0.0.1:8000/health- Server health status (GET)
Connecting to HTTP Server
Important for HTTP Mode: When using HTTP mode, even if you provide an output_path parameter, the server will:
Save the image to the specified path on the server
Also return the base64-encoded image data to the client
This allows the MCP client to receive the image data and save it locally without needing additional file transfer.
Using VSCode MCP Client:
Using curl:
Available MCP Tools
1. generate_image
Generate images from text prompts
Parameters:
prompt(required): English text description for image generationsize(optional): Image size - "1024x1024", "1792x1024", "1024x1792", default: "1024x1024"output_path(optional): Output file path, returns base64 encoded image if not provided
Example:
2. edit_image
Edit existing images with intelligent dimension preservation
Parameters:
STDIO mode:
image_path(required): Path to the image file to editprompt(required): English text description of how to edit the imagesize(optional): Output image size, uses original dimensions if not specifiedoutput_path(optional): Output file path
HTTP mode:
image_data_base64(required): Base64 encoded image dataSupports raw base64 format:
iVBORw0KGgoAAAANS...Supports Data URL format:
data:image/png;base64,iVBORw0KGgoAAAANS...
prompt(required): English text description of how to edit the imagesize(optional): Output image size, uses original dimensions if not specifiedoutput_path(optional): Output file path (server-side), image data always returned to client
Example (STDIO mode):
Example (HTTP mode):
Or using Data URL format:
Technical Specifications
Python version: 3.8+
Main dependencies:
mcp: MCP protocol supporthttpx: HTTP client with timeout handlingpillow: Image processing and dimension detectionaiofiles: Async file operationspydantic: Data validationpython-dotenv: Environment variable managementstarlette: ASGI framework for HTTP server (HTTP mode only)uvicorn: ASGI server (HTTP mode only)
Azure AI Foundry:
Default model: flux.1-kontext-pro (configurable)
Default API version: 2025-04-01-preview (configurable)
Supported image sizes: 1024x1024, 1792x1024, 1024x1792
Timeout: 5 minutes per request
Troubleshooting
Timeout Errors: Image processing has 5-minute timeout, check network connectivity
API Errors: Verify Azure credentials and endpoint URL
Dependency Issues: Ensure virtual environment is activated and dependencies installed
Server Connection Issues: Verify VSCode MCP configuration path is correct
License
MIT License
This server cannot be installed
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA server that integrates Flux's advanced image generation and manipulation features into AI coding assistants, enabling seamless text-to-image and image control workflows in IDEs like Cursor and Windsurf.Last updated -421MIT License
- -securityAlicense-qualityA server that provides AI-powered image generation, modification, and processing capabilities through the Model Context Protocol, leveraging Google Gemini models and other image services.Last updated -15MIT License
- -securityAlicense-qualityProvides tools for generating and editing images using OpenAI's gpt-image-1 model via an MCP interface, enabling AI assistants to create and modify images based on text prompts.Last updated -16Apache 2.0
- AsecurityAlicenseAqualityA Model Context Protocol server that enables generating and editing images using OpenAI's gpt-image-1 model, allowing AI assistants to create and modify images from text prompts.Last updated -23317MIT License