Skip to main content
Glama

GIMP MCP

Produktionsnaher MCP-Server fuer strukturierte GIMP-3-Automation. Ziel ist eine semantische Art-Editing-API fuer KI-Agenten statt GUI-Klickautomation oder tausender roher PDB-Tools.

Getesteter Stand

  • GIMP 3.2.2 via offizieller python-fu-eval BatchProcedure

  • MCP Python SDK 2.2.x / MCPServer

  • XCF-gestuetzte Artwork-Sessions mit Snapshot Undo/Redo

  • stabile Layer-IDs ueber GIMP tattoos

  • Path Policy gegen Writes ausserhalb freigegebener Roots

  • strukturierte Fehlerantworten

  • PNG/JPEG/WebP Export und PNG Preview Resource

  • PDB Search/Describe

  • nicht-destruktive Gimp.DrawableFilter-Effekte

Related MCP server: gimp-local-mcp

Architektur

MCP client -> semantic tools -> SessionManager -> GimpBridge -> GIMP python-fu-eval -> libgimp/PDB/DrawableFilter

Version 0.4 kombiniert crash-isolierte Batch-Aufrufe mit einer optionalen persistenten GIMP-Bridge. Direkte Live-Operationen werden fuer sichere Layer-Mutationen verwendet; bei Ausfall bleibt Batch der deterministische Fallback.

Installation

uv sync
uv run pytest -q
uv run gimp-mcp

Inspector:

uv run mcp dev src/gimp_mcp/server.py:mcp

Streamable HTTP kann mit dem SDK-Runner gestartet werden:

uv run mcp run src/gimp_mcp/server.py:mcp --transport streamable-http

MCP Tools

The public MCP surface is intentionally two-layered: a compact semantic tool set for reliable AI editing, plus expert PDB discovery/calls for installed GIMP features that do not need a dedicated wrapper.

Semantic core:

  • Session/document: session_create, session_open, session_info, session_undo, session_redo, session_close, document_save_as, document_resize, document_scale, document_crop, document_flatten.

  • Layers/content: layer_create, layer_duplicate, layer_delete, layer_update, layer_fill, layer_reorder, layer_resize, layer_resize_to_image, layer_add_alpha, layer_merge_down, layers_merge_visible, shape_create, text_create, import_layer, transform_layer.

  • Selection/layout: selection_set, guide_add, guide_list, guide_delete.

  • Effects/output: filter_list, filter_describe, filter_apply, preview_render, vision_capture, export_image, export_artwork, publish_artwork_downloads.

  • Runtime/AI: provider, TriForce, live-bridge, headless-workspace and artwork-job lifecycle tools.

Expert coverage:

  • pdb_search discovers procedures from the GIMP installation itself.

  • pdb_describe returns the exact installed argument/return signature.

  • pdb_call provides typed JSON-safe invocation for primitives, the active image, layer/item/channel/path tattoo references, sandboxed GFile, GIMP/GEGL enums, GeglColor, and common named GIMP resources (brush/font/gradient/palette/pattern).

  • Specialized GI boxed-array types such as GimpDoubleArray, GimpInt32Array and GimpCoreObjectArray are not claimed as generic JSON-coercible; expose a semantic wrapper for workflows that require them. This avoids a false “complete” claim while preserving safe access to the practical PDB surface.

Preview is additionally exposed as binary MCP resources such as gimp-preview://{session_id}, with vision/timeline resources for agent feedback.

Security

Default erlaubte Roots: ~/Pictures, ~/Downloads, ~/gimp-mcp/workspace, /tmp/gimp-mcp. Ueberschreiben muss explizit aktiviert werden. raw_python wurde aus der normalen Tool-Oberflaeche entfernt.

Konfiguration via Env: GIMP_MCP_GIMP, GIMP_MCP_TIMEOUT, GIMP_MCP_PREVIEW_MAX, GIMP_MCP_ALLOWED_ROOTS, GIMP_MCP_SESSION_ROOT, GIMP_MCP_EXPERT.

Python/GI Fallstrick

GIMPs Python-Plug-ins muessen mit einer Python-Umgebung laufen, die gi/PyGObject besitzt. Eine uv-venv darf /usr/bin/env python3 nicht auf eine inkompatible venv-Python umbiegen. Der Bridge-Prozess entfernt deshalb VIRTUAL_ENV, PYTHONHOME, PYTHONPATH und setzt einen kontrollierten System-PATH.

GIMP 3.2.2 Besonderheit

Gegl.list_operations() laesst den getesteten python-fu-eval Prozess reproduzierbar abstuerzen. 0.1 verwendet deshalb eine kleine validierte Filter-Registry fuer Discovery. Exakte Filter werden weiterhin dynamisch ueber Gimp.DrawableFilter.new() und dessen Config introspektiert. Getestet sind u.a. gegl:gaussian-blur, gegl:brightness-contrast, gegl:unsharp-mask, gegl:color-temperature, gegl:shadows-highlights.

Tests

tests/unit: Path Policy. tests/integration: echte GIMP-Probe, Canvas, Layer, Opacity, XCF und PNG. tests/test_mcp.py: echter MCP Client gegen den Server sowie Tool-Discovery und gimp_status.

Control Center and live observation

GIMP MCP now includes an optional PyQt6 control surface for operating and observing the server:

cd ~/gimp-mcp
./scripts/gimp-mcp-control

The Control Center provides:

  • Live — recovered artwork sessions, operation event stream and automatically refreshed previews.

  • Server — start/stop the local Streamable HTTP MCP endpoint.

  • AI Control — optional art-director provider/model selection through native official-client account integrations.

  • Settings — preview interval and size settings stored privately under ~/.local/state/gimp-mcp/control.json.

Provider credentials are deliberately not copied into GIMP MCP. ChatGPT/Codex, Claude Code, Mistral Vibe, Google Antigravity and Grok Build remain owners of their OAuth state. ChatGPT/Codex, Claude Code, Mistral Vibe and Google Antigravity are queried directly. AILinux/TriForce can be configured independently with GIMP_MCP_TRIFORCE_TOKEN.

AI-client routing rule

When a user explicitly asks to draw, paint, edit or create an image with GIMP, an AI client integrating this server should route the task through GIMP MCP rather than silently substituting an unrelated image generator. Image generation may still be used as an explicit source/reference only when the user asks for it or approves a hybrid workflow.

Recommended workflow:

user prompt
  -> session_create/session_open
  -> semantic GIMP edits
  -> preview_render
  -> vision/art review
  -> further edits
  -> document_save_as + export_image

events_recent exposes the operation timeline for observers. session_list includes recovered sessions and preview locations. Sessions survive a server restart as long as their working XCF remains under the configured session root.

Architecture direction

The current production-safe path remains batch-isolated GIMP execution. The next major bridge is a persistent GIMP 3 plug-in/IPC mode for truly visible edits inside one open GIMP GUI. The semantic MCP layer, session IDs, event bus and Control Center are intentionally transport-independent so a future PersistentPluginBridge can replace or complement the current batch bridge without changing AI-facing tools.

One-shot setup and update checks

Launch ./scripts/gimp-mcp-control and open Setup / Updates. The studio can:

  • check required Debian/Ubuntu/AILinux packages and configured APT candidates,

  • compare selected upstream versions for GIMP, uv, MCP and PyQt6,

  • install/repair system dependencies through PolicyKit after explicit confirmation,

  • uv sync the project or explicitly upgrade/re-lock dependencies,

  • update uv,

  • fetch repository update state, and

  • run pytest plus a real GIMP bridge probe.

The updater distinguishes distribution candidate from upstream latest. It does not silently replace distro packages with foreign repositories.

Persistent visible GIMP mode (0.3)

Install the bundled GIMP 3 persistent plug-in:

./scripts/install-gimp-live-plugin

Restart GIMP once. The plug-in starts automatically as a PERSISTENT GIMP procedure and creates a user-only Unix socket at:

~/.local/state/gimp-mcp/gimp-live.sock

When the socket is available, successful MCP document mutations are mirrored into a visible GIMP display. If GIMP is closed or the live plug-in is unavailable, GIMP MCP falls back to the crash-isolated batch workflow automatically.

The persistent bridge started as a visible document mirror. In 0.4 it also supports a small whitelist of direct in-process layer operations; all unsupported operations remain on the isolated batch path. Arbitrary Python execution is not exposed.

See docs/CREATIVE_AI_CLOUD.md for the shared multi-application direction, including a proposed FL Studio MCP adapter.

GIMP MCP Studio 0.4

The default Control Center view is now Studio: prompt -> selected provider/model -> persistent artwork job -> safe semantic GIMP actions -> live preview -> follow-up/export workflow. Jobs survive application restarts and recover as paused instead of silently disappearing.

Model output is treated as untrusted input. The PromptRunner accepts only structured JSON plans using a small semantic allowlist, validates arguments, rejects invented/executable tools, limits repair attempts, and never executes model-provided Python or shell commands.

Direct persistent editing currently covers layer rename, visibility, opacity and translation. The plug-in saves direct mutations back to the session XCF and flushes displays. Other operations continue through the isolated batch path and mirror back into the visible GIMP document.

See docs/QUICKSTART.md and CHANGELOG.md.

Studio plans can use $background_layer_id for the initial layer and $last_layer_id for a layer created earlier in the same plan; numeric IDs should never be invented by a model.

Live preview and export

The Control Center Live view refreshes preview.png from the selected artwork session and exposes EXPORT XCF, EXPORT PNG, and EXPORT JPG. Studio exposes compact XCF/PNG/JPG export buttons as well. XCF copies the canonical editable document.xcf; PNG/JPG are rendered by GIMP from that same document. The MCP surface also exposes export_artwork.

Autonomous diagnostics

Run ./scripts/auto-debug for a repeatable health pass. It records results in ~/.local/state/gimp-mcp/auto-debug.log and checks the test suite, native provider status, latest preview integrity, a real PNG export, the live bridge state, and the Streamable HTTP MCP handshake. GUI runtime exceptions are written to ~/.local/state/gimp-mcp/gui.log.

Vision-assisted MCP

GIMP MCP can expose a lightweight visual feedback loop for MCP-capable AI clients. Call vision_capture(session_id) after meaningful edits, then read the returned resources:

  • gimp-vision://<session_id> - current PNG with a non-destructive GIMP canvas-coordinate overlay.

  • gimp-timeline://<session_id> - rolling animated GIF of the most recent vision frames; re-read the same URI to obtain the newest timeline.

  • gimp-vision-meta://<session_id> - structured canvas and layer geometry matching the overlay.

The coordinate contract follows GIMP/XCF canvas coordinates: (0,0) is the top-left of the image canvas, X increases right, Y increases down, and layer offsets may be outside the canvas. The overlay is never written into the artwork. When the persistent live plug-in supports vision_snapshot, the capture comes from the visible GIMP image; otherwise the current session XCF is rendered as a safe fallback. ImageMagick (magick or convert) is required for overlay/GIF rendering.

Headless creative workspaces and multi-worker AI

GIMP MCP prefers the normal visible GIMP 3 persistent bridge. If no visible GIMP bridge is reachable, it now lazily starts a private gimp -n -i GIMP 3 process and invokes the installed persistent plug-in-gimp-mcp-live procedure through GIMP's official Python/PDB batch interpreter. The headless process keeps real GIMP images open and can render vision_snapshot PNGs, so an AI can inspect the same canvas it is editing without an X11/Wayland display.

For concurrent agents, GIMP_MCP_HEADLESS_WORKERS controls a bounded pool (default 2, maximum 8). Artwork paths are deterministically assigned to a worker, allowing different sessions to execute concurrently while every session document is protected by a thread-reentrant and process-wide file lock. Multiple LLM/MCP clients may therefore share the service without writing the same XCF concurrently.

Useful expert tools:

  • headless_workspace_status — visible/headless mode and worker health.

  • pdb_search / pdb_describe — discover GIMP's installed Procedure Database.

  • pdb_call — call a discovered PDB procedure with JSON-safe values against an artwork session. Image arguments bind to the session; layer/drawable/item arguments use MCP layer_id tattoos. Generic GFile arguments are confined to the session work directory; normal import/export should use the dedicated safe MCP tools.

  • filter_list / filter_describe / filter_apply — GEGL discovery and non-destructive Gimp.DrawableFilter editing.

  • vision_capture plus gimp-vision://, gimp-vision-meta:// and gimp-timeline:// — coordinate-aware visual feedback for models.

The headless pool is a fallback, not a replacement for interactive GIMP. If a visible bridge appears, new bridge requests prefer it automatically.

systemd service / Control Center

The recommended server runtime is the per-user gimp-mcp.service. The Control Center can install or repair it, enable/disable login autostart, start, stop and restart it, and show its journal. The service is independent from the GUI: closing the Control Center does not stop MCP or its headless GIMP workers. Runtime bind/auth/GIMP settings are loaded from ~/.local/state/gimp-mcp/control.json each time the service starts.

Available Tools

61 tools
artwork_followupC

Apply a follow-up art direction to the existing session and preserve undo history.

Inputs: job_id (required), prompt (required). Returns: object

artwork_job_cancelC

Cancel an artwork job at the next safe step boundary.

Inputs: job_id (required). Returns: object

artwork_job_createB

Create and persist an AI-to-GIMP artwork job without running it yet.

Inputs: prompt (required), mode, model, provider, +1 more. Returns: object

artwork_job_listB

List persisted artwork jobs, newest active jobs first.

Inputs: no named parameters. Returns: object

artwork_job_pauseA

Cooperatively pause an artwork job at the next safe step boundary.

Inputs: job_id (required). Returns: object

artwork_job_resumeA

Clear the pause flag for an artwork job. Call artwork_job_run to continue execution.

Inputs: job_id (required). Returns: object

artwork_job_runC

Run a queued/paused artwork job through the selected AI provider and semantic GIMP tools.

Inputs: job_id (required). Returns: object

artwork_job_statusB

Return persistent artwork-job state and progress.

Inputs: job_id (required). Returns: object

artwork_make_it_coolerC

Ask the selected model for a few targeted improvements and execute them through safe semantic GIMP actions.

Inputs: job_id (required), preset. Returns: object

document_autocropC

Autocrop the image to non-empty content, optionally using a specific layer as the reference drawable.

Inputs: session_id (required), layer_id. Returns: object

document_cropC

Crop the image to a bounded rectangle in canvas pixels.

Inputs: width (required), height (required), session_id (required), x, +1 more. Returns: object

document_flattenB

Flatten all visible image content to one layer. Snapshot-undoable.

Inputs: session_id (required). Returns: object

document_resizeA

Resize the canvas without scaling pixels. offset_x/y position the old image within the new canvas.

Inputs: width (required), height (required), session_id (required), offset_x, +1 more. Returns: object

document_save_asB

Commit the current session document to an allowed XCF path. Refuses overwrites unless explicitly enabled.

Inputs: output_xcf (required), session_id (required), overwrite. Returns: object

document_scaleC

Scale the full image and all layers to width x height.

Inputs: width (required), height (required), session_id (required). Returns: object

events_recentC

Return recent live operation events for observers and control UIs.

Inputs: limit, session_id. Returns: object

export_artworkC

Export the current artwork as an editable XCF project, PNG, or JPEG.

Inputs: session_id (required), output_path (required), format, overwrite. Returns: object

export_imageB

Export the session to PNG/JPEG/WebP or another GIMP-supported format inferred from the extension.

Inputs: session_id (required), output_path (required), overwrite. Returns: object

filter_applyB

Apply a GEGL operation as a non-destructive GIMP DrawableFilter to a layer. Discover parameters first if uncertain.

Inputs: layer_id (required), operation (required), parameters (required), session_id (required), +1 more. Returns: object

filter_describeA

Describe a GEGL operation's configurable properties so an AI can construct a valid filter_apply call.

Inputs: operation (required). Returns: object

filter_listA

Discover available GEGL operations. Use this before filter_describe/filter_apply when the exact operation name is unknown.

Inputs: limit, query. Returns: object

gimp_statusA

Verify the real GIMP binary, Python GI bridge and PDB availability. Read-only. Use this first when diagnosing setup problems.

Inputs: no named parameters. Returns: object

guide_addC

Add a horizontal or vertical image guide.

Inputs: position (required), session_id (required), orientation (required). Returns: object

guide_deleteC

Delete one image guide by guide_id.

Inputs: guide_id (required), session_id (required). Returns: object

guide_listC

List image guides and positions.

Inputs: session_id (required). Returns: object

headless_workspace_statusA

Report visible/headless workspace state and configured headless GIMP worker pool without exposing credentials.

Inputs: no named parameters. Returns: object

import_layerC

Import an allowed image file as a new layer in the current artwork session.

Inputs: path (required), session_id (required), name. Returns: object

layer_add_alphaC

Ensure a layer has an alpha channel.

Inputs: layer_id (required), session_id (required). Returns: object

layer_createA

Create a transparent layer. Width/height default to canvas dimensions. opacity is 0..100; blend_mode accepts normal/multiply/screen/overlay and other valid GIMP LayerMode names. Returns a persistent layer_id.

Inputs: session_id (required), name, width, height, +3 more. Returns: object

layer_deleteB

Delete one layer identified by layer_id. The operation is snapshot-undoable.

Inputs: layer_id (required), session_id (required). Returns: object

layer_duplicateC

Duplicate a layer and return a new persistent layer_id.

Inputs: layer_id (required), session_id (required), name. Returns: object

layer_fillA

Fill the selected area of a layer with a CSS/Gegl color; with no selection this fills the layer. Snapshot-undoable.

Inputs: layer_id (required), session_id (required), color. Returns: object

layer_merge_downC

Merge one layer into the next layer below and return the resulting layer_id.

Inputs: layer_id (required), session_id (required), merge_type. Returns: object

layer_reorderB

Move a layer to a zero-based stack position; 0 is the top of the layer stack.

Inputs: layer_id (required), position (required), session_id (required). Returns: object

layer_resizeC

Resize a layer boundary without scaling its pixels.

Inputs: width (required), height (required), layer_id (required), session_id (required), +2 more. Returns: object

layer_resize_to_imageC

Resize a layer boundary to the current image canvas.

Inputs: layer_id (required), session_id (required). Returns: object

layers_merge_visibleB

Merge all visible layers while preserving hidden layers.

Inputs: session_id (required), merge_type. Returns: object

layer_updateC

Update layer name, visibility, opacity, absolute offsets, blend mode and/or alpha lock.

Inputs: layer_id (required), session_id (required), x, y, +5 more. Returns: object

live_bridge_statusA

Return whether the persistent visible GIMP bridge is connected. When connected, successful edits are mirrored into an open GIMP display.

Inputs: no named parameters. Returns: object

pdb_callA

Expert GIMP 3 PDB bridge. Calls a discovered official PDB procedure against a session. Use pdb_describe first. GimpImage args accept any value and bind to the session; Drawable/Layer/Item args accept layer_id; GFile accepts a path; RunMode accepts NONINTERACTIVE/INTERACTIVE/WITH_LAST_VALS.

Inputs: name (required), arguments (required), session_id (required). Returns: object

pdb_describeA

Expert discovery: inspect the arguments and returns of one GIMP PDB procedure. This tool is read-only.

Inputs: name (required). Returns: object

preview_renderB

Render a bounded PNG preview. A successful preview also refreshes the coordinate-overlay and rolling GIF vision resources without modifying the artwork.

Inputs: session_id (required), max_width, max_height. Returns: object

provider_modelsA

List models exposed by an already-linked ChatGPT, Claude, Gemini or Mistral account.

Inputs: provider (required). Returns: object

provider_statusB

Report native official-provider account status. No credentials are returned.

Inputs: no named parameters. Returns: object

publish_artwork_downloadsB

Export the final artwork to XCF, JPEG and PNG and return three expiring HTTPS download links for external/autonomous clients.

Inputs: session_id (required), ttl_seconds. Returns: object

selection_setC

Create/combine geometry selections or modify the current selection. Polygon points are a flat x/y list.

Inputs: action (required), session_id (required), x, y, +8 more. Returns: object

session_closeB

Close a session. Set discard=true to delete its temporary XCF and history.

Inputs: session_id (required), discard. Returns: object

session_createB

Create a new isolated artwork session and XCF working document. Returns a session_id used by all editing tools.

Inputs: width, height, background_name, background_color. Returns: object

session_infoB

Return dimensions, layers and current XCF state for an artwork session without modifying it.

Inputs: session_id (required). Returns: object

session_listA

List active and recovered artwork sessions, including preview paths and undo depth.

Inputs: no named parameters. Returns: object

session_openA

Open an existing image/XCF into an isolated session copy so source files are never edited in-place.

Inputs: path (required). Returns: object

session_redoC

Redo the last snapshot-level undo in this session.

Inputs: session_id (required). Returns: object

session_undoB

Undo the last successful mutating MCP operation using the session snapshot journal.

Inputs: session_id (required). Returns: object

shape_createC

Create a filled ellipse or rectangle on its own transparent full-canvas layer.

Inputs: x (required), y (required), name (required), color (required), +4 more. Returns: object

text_createB

Create an editable GIMP text layer at pixel position x/y. Optional color accepts CSS/Gegl syntax.

Inputs: x (required), y (required), text (required), session_id (required), +3 more. Returns: object

text_updateC

Update an existing editable GIMP text layer.

Inputs: layer_id (required), session_id (required), size, text, +2 more. Returns: object

transform_layerC

Transform one layer. values may be arrays or semantic objects: translate=[dx,dy] or {x,y}/{dx,dy}; rotate=[degrees] or {degrees,cx,cy}; scale=[x0,y0,x1,y1] or {x,y,width,height}.

Inputs: action (required), values (required), layer_id (required), session_id (required). Returns: object

triforce_modelsB

List models available to the currently logged-in AILinux/TriForce account.

Inputs: no named parameters. Returns: object

triforce_statusA

Report independently configured AILinux/TriForce status without exposing its bearer token.

Inputs: no named parameters. Returns: object

vision_captureB

Force a fresh AI vision frame using GIMP canvas pixels. Prefer the visible live GIMP image; fall back to the current session preview. Re-read returned MCP resources whenever the AI wants to visually review progress.

Inputs: session_id (required), grid_px, show_labels, show_centers, +2 more. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.8/5.0

    Scored across 61 tools

    Disambiguation3/5

    Many tools target distinct GIMP operations, but the set has overlapping persistence/export tools (export_artwork, export_image, publish_artwork_downloads, document_save_as), multiple status tools, and several artwork-job/session tools that could be confused. Descriptions generally help differentiate, but boundaries are not consistently sharp across all 61 tools.

    Naming Consistency3/5

    Mostly snake_case and readable, but conventions mix noun_verb (layer_create, session_open) and verb_noun (export_artwork, import_layer, transform_layer), plus phrasing like artwork_make_it_cooler. This is understandable but not a predictable single pattern.

    Tool Count1/5

    61 tools is far beyond the typical well-scoped MCP server range and creates a very heavy surface. Even for a complex domain like GIMP, this is an extreme count that burdens discovery and selection.

    Completeness4/5

    The set covers sessions, layers, selections, text, shapes, guides, GEGL filters, undo/redo, export, and jobs, with pdb_call providing an expert escape hatch. Some common semantic operations (e.g. masks, freehand/path selection, many paint tools) are only reachable through generic PDB calls, leaving minor gaps.

    Maintenance

    ActivitySlowing
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to control GIMP 2.10 through its Script-Fu server, providing access to the entire GIMP procedure database with a vision feedback loop for iterative editing.
      6
      AGPL 3.0
    • A
      license
      B
      quality
      D
      maintenance
      Enables controlling GIMP 3 locally through natural language, providing tools for image editing, layer management, selections, and PDB procedure invocation. Keeps all images and files on the user's machine with a local-first, secure design.
      40
      1
      GPL 3.0
    • A
      license
      B
      quality
      B
      maintenance
      Enables AI agents to operate GIMP 3 end-to-end: open and inspect images, call every PDB procedure, apply GEGL filters destructively or as layer effects, measure pixels, render before/after/diff comparisons, cut out subjects with AI segmentation, and run multi-step recipes across folders.
      32
      76 PyPI
      5
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to drive GIMP 3.x end-to-end with 119 validated, structured tools covering documents, layers, masks, selections, paint, text, color, filters, analysis, and checkpoints, including print/DTF-aware workflows such as white underbase, edge choke, garment-aware background knockout, halftone separation, and gang sheets. It works against a live or headless GIMP, returns viewable previews for self-verification, and captures real errors without losing output.
      67 PyPI
      2
      MIT