GPT Image 2 Polza MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@GPT Image 2 Polza MCP Server Create a 4K cinematic shot of a futuristic city at night."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
GPT Image 2 Polza MCP Server
mcp-name: io.github.ivanantigravity-lgtm/gpt-image-2-polza-mcp-server
MCP-сервер для генерации и редактирования изображений моделью GPT Image 2 через API-провайдера Polza.
Провайдер:
PolzaModel ID:
openai/gpt-5.4-image-2Model tier:
gpt-image-2Поддержка генерации, редактирования и референсных изображений
Сохранение полноразмерных файлов на диск
Возврат превью и структурированных метаданных через MCP
Для работы нужен только POLZA_AI_API_KEY. Отдельный ключ OpenAI не требуется.
Инструменты MCP
generate_image— создаёт или редактирует изображения с помощью GPT Image 2.fetch_generation— получает результат уже запущенной генерации поgen_...ID.upload_file— загружает референс в Polza Storage.show_output_stats— показывает статистику локальной папки с результатами.maintenance— обслуживает локальный кэш и базу метаданных.
Related MCP server: openai-imagegen-mcp
Требования
Python 3.11+
Аккаунт Polza и
POLZA_AI_API_KEYЛюбой MCP-клиент: Claude Code, Claude Desktop, Cursor, VS Code или другой
Быстрая установка
Клонируйте репозиторий:
git clone https://github.com/ivanantigravity-lgtm/gpt-image-2-polza-mcp.git
cd gpt-image-2-polza-mcp
uv syncСоздайте .mcp.json:
{
"mcpServers": {
"gpt-image-2-polza": {
"command": "uv",
"args": [
"run",
"gpt-image-2-polza-mcp-server"
],
"cwd": "/absolute/path/to/gpt-image-2-polza-mcp",
"env": {
"POLZA_AI_API_KEY": "your-polza-api-key",
"POLZA_BASE_URL": "https://polza.ai/api",
"IMAGE_OUTPUT_DIR": "/absolute/path/to/gpt-image-2-output"
}
}
}
}Перезапустите MCP-клиент после добавления конфигурации.
Использование
Обычная генерация:
Создай рекламный кадр флакона духов на чёрном камне,
кинематографический свет, формат 16:9, разрешение 4K.
Используй gpt-image-2.Основные параметры generate_image:
Параметр | Описание |
| Текстовое описание изображения или инструкция по редактированию |
|
|
|
|
|
|
| Например, |
| Путь к основному референсу или редактируемому изображению |
| Второй референс |
| Третий референс |
| Конкретный файл или папка для результата |
| Принудительно запустить новую генерацию вместо использования кэша |
Восстановление после таймаута
Генерация может продолжаться на стороне Polza после таймаута MCP-клиента. Не запускайте тот же запрос повторно сразу: это может создать и оплатить ещё одну генерацию.
Получите gen_... ID в истории генераций Polza и вызовите:
fetch_generation(
media_id="gen_2158267363095220225",
output_path="/absolute/path/to/result.png"
)Переменные окружения
Переменная | Обязательно | Описание |
| Да | API-ключ аккаунта Polza |
| Нет | Базовый URL API; по умолчанию |
| Нет | Папка результатов; по умолчанию |
| Нет | Model tier; по умолчанию |
| Нет | Интервал проверки статуса генерации |
| Нет | Максимальное время ожидания результата |
| Нет | Внешний ID пользователя для Polza |
| Нет | Возвращать полное изображение вместо превью |
Локальный запуск
cp .env.example .env
uv sync
uv run gpt-image-2-polza-mcp-serverМинимальный .env:
POLZA_AI_API_KEY=your-polza-api-key
POLZA_BASE_URL=https://polza.ai/api
GPT_IMAGE_MODEL=gpt-image-2
IMAGE_OUTPUT_DIR=/absolute/path/to/gpt-image-2-outputAPI Polza
Сервер использует:
POST /v1/media— запуск генерацииGET /v1/media/{id}— получение статуса и результатаPOST /v1/storage/upload— загрузка референсовGET /v1/storage/files/{id}— метаданные файлаDELETE /v1/storage/files/{id}— удаление файла
Лицензия
MIT. См. LICENSE.
Available Tools
5 toolsfetch_generationFetch a Polza media generation by idDRead-only
Inputs: media_id (required), wait, output_path.
generate_imageGenerate or edit images (Multi-Model: Flash & Pro)ARead-only
Generate new images or edit existing images using natural language instructions.
Supports multiple input modes:
Pure generation: Just provide a prompt to create new images
Multi-image conditioning: Provide up to 3 input images using input_image_path_1/2/3 parameters
File ID editing: Edit previously uploaded images using Files API ID
File path editing: Edit local images by providing single input image path
Automatically detects mode based on parameters or can be explicitly controlled. Input images are read from the local filesystem to avoid massive token usage. Returns both MCP image content blocks and structured JSON with metadata.
Inputs: prompt (required), n, mode, file_id, +13 more.
maintenanceMaintenance and cleanup operationsBRead-only
Perform maintenance operations following workflows.md patterns.
Available operations:
cleanup_expired: Remove expired Files API entries from database
cleanup_local: Clean old local files based on age/LRU
check_quota: Check Files API storage usage vs. ~20GB budget
database_hygiene: Clean up database inconsistencies
full_cleanup: Run all cleanup operations in sequence
Inputs: operation (required), dry_run, keep_count, max_age_hours.
show_output_statsShow output directory statsARead-only
Show statistics about the output directory and recently generated images.
Inputs: no named parameters.
upload_fileUpload file to Polza Storage APIA
Upload a local file through the Polza Storage API and return its URI & metadata. Useful when the image is larger than 20MB or reused across prompts.
Inputs: path (required), display_name.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
generate_image, upload_file, show_output_stats, and maintenance each have clear and separate purposes. fetch_generation is the only ambiguous tool because it lacks a description and may be confused with retrieval or generation workflows.
Four tools follow a verb_noun pattern (generate_image, upload_file, show_output_stats, fetch_generation), but maintenance is a bare noun instead of something like perform_maintenance. The pattern is still readable and mostly predictable.
Five tools is well-scoped for an image generation server: one core generation tool, upload support, stats, fetch, and maintenance. Each tool covers a distinct functional area without redundancy.
The set covers the primary generation/editing, upload, retrieval, stats, and cleanup workflows. Minor gaps include no explicit per-file delete/list operations and fetch_generation's undocumented behavior, but agents can generally work around them via maintenance and cleanup.
Maintenance
Related MCP Connectors
Generate and edit images (PNG, transparent, GIF, SVG) with GPT Image and Nano Banana models.
Generate and edit realistic images from a prompt. Returns the image and a download link.
Generate images with your own ChatGPT subscription (Plus, Pro or Team), without spending API credits
Generate, edit and upscale images with references, batch jobs, cost previews and original downloads.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables image generation and editing using OpenAI's GPT Image API (gpt-image-1, 1.5, 2) with support for multi-image generation, history management, and batch processing.12855 npm1MIT
- FlicenseNot gradedqualityDmaintenanceEnables image generation and editing via OpenAI's gpt-image-1 model, with options for saving, format control, and transparency.-
- AlicenseBqualityDmaintenanceEnables generating images from text or transforming existing images using GPT-Image-compatible APIs, with support for OpenAI and Agnes AI backends.2MIT
- AlicenseAqualityCmaintenanceEnables image generation and editing through OpenAI's gpt-image-2 model, supporting text-to-image, reference-guided generation, and editing with local files or URLs.22MIT