Azure AI Image Editor MCP Server

Azure AI Image Editor MCP Server

Enables text-to-image generation and image editing using Azure AI Foundry models. Supports generating high-quality images from text descriptions and modifying existing images through natural language prompts.

Category
访问服务器

README

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

  1. Text-to-Image Generation - Generate high-quality images from text descriptions using Azure AI Foundry models
  2. Image Editing - Edit and modify existing images
  3. Configurable Models - Support for multiple Azure AI models via environment variables

Project Structure

azure-image-editor/
├── .venv/                        # Python virtual environment
├── src/
│   ├── azure_image_client.py     # Azure API client
│   └── mcp_server.py             # STDIO MCP server
├── tests/                        # Test files
├── logs/                         # Server logs
├── tmp/                          # Temporary files
├── requirements.txt              # Python dependencies
├── .env                          # Environment configuration
├── .env.example                  # Environment configuration template
└── README.md                     # Project documentation

Prerequisites

⚠️ Important: Before using this MCP server, you must deploy the required model in your Azure AI Foundry environment.

Azure AI Foundry Model Deployment

  1. Access Azure AI Foundry: Go to Azure AI Foundry
  2. Deploy the model: Deploy flux.1-kontext-pro (or your preferred model) in your Azure AI Foundry workspace
  3. Get 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

  1. Clone and setup environment:
git clone https://github.com/satomic/Azure-AI-Image-Editor-MCP.git
cd azure-image-editor
python -m venv .venv
source .venv/bin/activate  # Linux/Mac
# or .venv\Scripts\activate  # Windows
pip install -r requirements.txt

Configure VSCode MCP

Add the following to your VSCode MCP configuration:

{
  "servers": {
    "azure-image-editor": {
      "command": "/full/path/to/.venv/bin/python",
      "args": ["/full/path/to/azure-image-editor/src/mcp_server.py"],
      "env": {
        "AZURE_BASE_URL": "https://your-endpoint.services.ai.azure.com", // deployment endpoint
        "AZURE_API_KEY": "${input:azure-api-key}",
        "AZURE_DEPLOYMENT_NAME": "FLUX.1-Kontext-pro", // The name you gave your deployment
        "AZURE_MODEL": "flux.1-kontext-pro", // Default model
        "AZURE_API_VERSION": "2025-04-01-preview" // Default API version
      }
    }
  },
  "inputs": [
    {
      "id": "azure-api-key",
      "type": "promptString",
      "description": "Enter your Azure API Key",
      "password": "true"
    }
  ]
}

Important: Replace /full/path/to/ with the actual absolute path to this project directory.

Available MCP Tools

1. generate_image

Generate images from text prompts

Parameters:

  • prompt (required): English text description for image generation
  • size (optional): Image size - "1024x1024", "1792x1024", "1024x1792", default: "1024x1024"
  • output_path (optional): Output file path, returns base64 encoded image if not provided

Example:

{
  "name": "generate_image",
  "arguments": {
    "prompt": "A beautiful sunset over mountains",
    "size": "1024x1024",
    "output_path": "/path/to/output/image.png"
  }
}

2. edit_image

Edit existing images with intelligent dimension preservation

Parameters:

  • image_path (required): Path to the image file to edit
  • prompt (required): English text description of how to edit the image
  • size (optional): Output image size, uses original dimensions if not specified
  • output_path (optional): Output file path, returns base64 encoded image if not provided

Example:

{
  "name": "edit_image",
  "arguments": {
    "image_path": "/path/to/input/image.png",
    "prompt": "Make this black and white",
    "output_path": "/path/to/output/edited_image.png"
  }
}

Technical Specifications

  • Python version: 3.8+

  • Main dependencies:

    • mcp: MCP protocol support
    • httpx: HTTP client with timeout handling
    • pillow: Image processing and dimension detection
    • aiofiles: Async file operations
    • pydantic: Data validation
    • python-dotenv: Environment variable management
  • 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

  1. Timeout Errors: Image processing has 5-minute timeout, check network connectivity
  2. API Errors: Verify Azure credentials and endpoint URL
  3. Dependency Issues: Ensure virtual environment is activated and dependencies installed
  4. Server Connection Issues: Verify VSCode MCP configuration path is correct

License

MIT License

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选