GPT Image 2 Polza MCP Server
Click on "Install 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 ServerCreate 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-gpt-image-1-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
| Name | Required | Description | Default |
|---|---|---|---|
| wait | No | If true (default), polls until the generation reports 'completed' or 'failed', respecting POLZA_POLL_TIMEOUT_SECONDS. If false, returns the raw status without downloading. | |
| media_id | Yes | Polza generation id (e.g. 'gen_2158264963618050049'). Returned by the Polza API when an `images/generations` or `/v1/media` call switches to async mode or when the MCP client times out waiting for a synchronous response. | |
| output_path | No | Where to save the downloaded asset(s). If a file path with an extension is provided, saves the first asset there. If a directory is provided, saves using '<media_id>_<index>.<ext>'. If omitted, saves into IMAGE_OUTPUT_DIR. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | Requested image count (model may return fewer). | |
| mode | No | Operation mode: 'generate' for new image creation, 'edit' for modifying existing images. Auto-detected based on input parameters if not specified. | auto |
| prompt | Yes | Clear, detailed image prompt. Include subject, composition, action, location, style, and any text to render. Use the aspect_ratio parameter to pin a specific canvas shape when needed. | |
| file_id | No | Files API file ID to use as input/edit source (e.g., 'files/abc123'). If provided, this takes precedence over input_image_path_* parameters for the primary input. | |
| model_tier | No | Model tier. Use 'gpt-image-2' for OpenAI GPT Image 2 through Polza. This is the default model. | gpt-image-2 |
| resolution | No | Output resolution: 'high', '4k', '2k', '1k'. GPT Image 2 supports high-resolution output. Default: '1k'. | 1k |
| output_path | No | Output path for generated image(s). If a file path with extension (e.g., '/path/image.png'), saves directly to that path. If a directory path (e.g., '/path/to/dir/'), uses default filename in that directory. If None, uses IMAGE_OUTPUT_DIR environment variable or ~/gpt-image-2-images. | |
| aspect_ratio | No | Optional output aspect ratio (e.g., '16:9'). Polza-supported values: auto, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9. | |
| thinking_level | No | Reasoning depth hint: 'low' (faster), 'high' (better quality). Applied to the 'nb2' model; 'high' also biases auto-selection toward Pro. Default: None (auto). | |
| negative_prompt | No | Things to avoid (style, objects, text). | |
| enable_grounding | No | Enable Google Search grounding for factual accuracy (NB2 and Pro models). Useful for real-world subjects. Default: true. | |
| return_full_image | No | Return full-resolution images in MCP response instead of thumbnails. Warning: full images can be large (3-7MB each for 4K). Default: uses RETURN_FULL_IMAGE env var, or false if not set. | |
| input_image_path_1 | No | Path to first input image for composition/conditioning | |
| input_image_path_2 | No | Path to second input image for composition/conditioning | |
| input_image_path_3 | No | Path to third input image for composition/conditioning | |
| system_instruction | No | Optional system tone/style guidance. | |
| force_new_generation | No | Start a brand-new upstream generation even if the same request is already pending or recently completed. Use only after the user explicitly confirmed they want a rerun. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the readOnlyHint annotation, the description discloses that input images are read from the local filesystem to reduce token usage, that mode detection is automatic, and that the return payload includes both MCP image blocks and structured JSON. This is meaningful behavioral context; it does not contradict the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a clear opening and numbered modes, making it scannable. It is slightly longer than strictly necessary because modes 2 and 4 overlap conceptually, but the layout earns its place for a tool with 17 parameters.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a complex tool with 17 parameters and no output schema, the description adequately covers generation versus editing modes, input handling, and the return format. It relies on the schema for detailed parameter semantics, which is appropriate given 100% schema coverage. Nothing critical for invoking the tool correctly is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds value by mapping input modes to specific parameters (e.g., up to 3 input images via input_image_path_1/2/3, file_id for Files API editing), which helps an agent choose the right parameter combination for the intended mode.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb and resource: 'Generate new images or edit existing images.' It then enumerates four concrete input modes, making the tool's full scope unambiguous. The title and description together clearly distinguish this from siblings like upload_file or fetch_generation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains when to use each input mode and states that mode selection is auto-detected or explicitly controlled. It does not explicitly name alternative tools for when-not-to-use cases, but the mode guidance is clear enough for parameter selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | If true, only report what would be done without making changes | |
| operation | Yes | Maintenance operation to perform: 'cleanup_expired', 'cleanup_local', 'check_quota', 'database_hygiene', 'full_cleanup' | |
| keep_count | No | For local cleanup: minimum number of recent files to keep | |
| max_age_hours | No | For local cleanup: maximum age in hours (default: 168 = 1 week) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations declare readOnlyHint=true, but the description explicitly describes destructive actions like 'Remove expired Files API entries from database' and 'Clean old local files'. This is a direct annotation contradiction, which the rubric requires scoring as 1, and the description also fails to disclose irreversibility or safety implications beyond the dry_run parameter in the schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and front-loaded with a clear purpose, followed by a well-structured bullet list of operations. The phrase 'following workflows.md patterns' is somewhat ambiguous and could be clearer, but overall every line adds useful information without unnecessary verbosity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has four parameters, multiple operation modes, and no output schema, the description covers the operation choices reasonably well. However, it relies on a vague external reference, does not describe return values or success/failure behavior, and the readOnlyHint contradiction makes the safety profile incomplete for an agent deciding whether to invoke it.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the input schema already fully documents operation, dry_run, keep_count, and max_age_hours. The description adds a helpful mapping of operation names to behaviors, but does not provide extra parameter semantics beyond what the schema already gives, so it stays at the baseline.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a specific resource ('maintenance operations') and enumerates each concrete sub-operation with a verb and object, such as 'Remove expired Files API entries from database' and 'Check Files API storage usage'. It is clearly distinguishable from sibling tools like generate_image and upload_file, so an agent can tell what this tool does without opening the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies this tool is for maintenance and cleanup tasks, but it does not explicitly state when to use it versus sibling tools or when to prefer one operation over another. The reference to 'following workflows.md patterns' gives some context but is vague and does not provide concrete selection criteria or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
show_output_statsShow output directory statsARead-only
Show statistics about the output directory and recently generated images.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The annotations already declare readOnlyHint=true, and the description's use of 'Show' is consistent with that. It adds useful scoping around output directory and recently generated images, but it does not disclose output format, potential cost, or hidden scanning behavior. Given the read-only annotation, a mid-range score is appropriate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no filler, repetition, or unnecessary detail. It communicates the verb, resource, and scope efficiently.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter, read-only stats tool, the description adequately states what the tool operates on and what it returns at a high level. No output schema exists, so 'statistics' is somewhat vague, but the tool is simple enough that an agent can select and invoke it correctly without more detail.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so there is no parameter behavior to explain. The baseline of 4 applies here because the description does not need to compensate for missing parameter documentation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Show') and clearly identifies the resource ('statistics about the output directory and recently generated images'). It is clearly distinct from generate_image and upload_file, but it does not explicitly differentiate itself from fetch_generation or maintenance.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies a monitoring use case for checking output directory stats, but it provides no explicit when-to-use guidance or exclusions. Sibling tools like fetch_generation are not referenced as alternatives, so an agent must infer when this tool is appropriate.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Server-accessible file path to upload to Polza Storage API. | |
| display_name | No | Optional display name for the uploaded file. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate readOnlyHint=false, so the write behavior is known. The description adds return value details ('URI & metadata') and a practical constraint (20MB/reuse context), but does not disclose side effects like persistence, overwriting, or authentication requirements. Adds moderate value beyond annotations without contradicting them.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with no wasted words: the first states the action and outcome, the second gives practical usage guidance. Front-loaded and highly scannable.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple two-parameter upload tool with full schema coverage and no nested objects, the description is complete. It explains what the tool does, what it returns, and when to use it. No output schema exists, but the return format is explicitly mentioned.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and both parameters already have clear descriptions. The tool description adds minimal parameter-level context beyond the schema, so it stays at the baseline.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('Upload'), a clear resource ('a local file through the Polza Storage API'), and the expected outcome ('return its URI & metadata'). This clearly distinguishes it from siblings like generate_image and fetch_generation, which do different things.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit use conditions: 'Useful when the image is larger than 20MB or reused across prompts.' This gives clear context for when to invoke the tool, though it does not name alternative tools or explicitly state when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
v0.6.2- First observed
fetch_generation - First observed
generate_image - First observed
maintenance - First observed
show_output_stats - First observed
upload_file
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Generate images with your own ChatGPT subscription (Plus, Pro or Team), without spending API credits
LLM chat, text tools, image generation, editing and batch image jobs
Create images and videos from prompts, with options for image mixing, reference images, and start/…
Generate AI images and videos from any compatible MCP client.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables 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.121181MIT
- FlicenseNot gradedqualityDmaintenanceProvides AI agents and coding assistants with image generation and editing capabilities using OpenAI's GPT-image-1 model, with support for local or Supabase storage.3-
- FlicenseNot gradedqualityDmaintenanceEnables image generation and editing via OpenAI's gpt-image-1 model, with options for saving, format control, and transparency.-
- AlicenseBqualityBmaintenanceEnables generating images from text or transforming existing images using GPT-Image-compatible APIs, with support for OpenAI and Agnes AI backends.2MIT