GIMP Agent MCP

io.github.SarutobiSasuke8由 GitHub 帳號 SarutobiSasuke8 發布v0.5.0更新於 Oct 24, 2026

Edit in GIMP 3 with AI agents: live previews, grouped edits, pixel measurements and recipes.

已驗證STDIO僅桌面開發者工具媒體與設計

概覽

AI 產生的概覽

讓 AI 助理在執行中的 GIMP 3 裡編輯影像,支援預覽、量測、成組編輯與批次配方。

可以做什麼
透過本機橋接把 MCP 用戶端連到 GIMP 3,助理可以開啟、新建、編輯與匯出影像,並保留具名圖層、文字、路徑與遮罩。它提供預覽與前後對比、像素量測、PDB 與 GEGL 查詢、可合併為一次復原的結構化編輯批次,以及十個配方,用於精靈圖、貼圖、浮水印、聯絡表等任務。無介面模式可對資料夾中的影像批次執行相同流程。
適用情境
適合希望影像編輯留在 GIMP 中並保持可繼續編輯的情境,例如分層素材、精靈圖、圖示集、批次縮放或依檔案大小目標匯出。也適合需要助理檢查並量測實際輸出、而不只是產生一張合併檔案的開發者。
執行需求
同一台機器上需安裝 GIMP 3.2.x、Python 3.11+、uv 與 MCP 用戶端。需先啟動一次 GIMP 以建立使用者設定,安裝橋接外掛與技能,並在 GIMP 的 Filters 選單啟動橋接。選用的背景移除需要額外模型執行環境,首次使用會下載模型。環境變數 GIMP_AGENT_ALLOW_PYTHON 設為 0 可移除 gimp_run_python 工具。
安裝前請注意
橋接使用帶每次安裝權杖的本機回送 TCP 連線,僅綁定 127.0.0.1,但 PDB 呼叫、配方與 Python 能以使用者權限執行程式碼,因此只應連接可信任的用戶端。停用 gimp_run_python 並不等於沙箱。編輯會改動開啟的文件與匯出的檔案;失敗的批次不會自動回復,連線中斷也不會自動重播,重試前應先檢查。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 GIMP Agent MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

GIMP Agent MCP

Let your AI agent edit in GIMP. Keep the layers. See what changed.

[GIMP Agent MCP v0.5.0: your AI agent now works in GIMP]

[CI] [Windows GIMP] [Linux GIMP] [macOS GIMP] [PyPI] [License]

Connect Claude, Codex, Cursor or another MCP client to GIMP 3. The agent can work in your open window, inspect the result, refine an edit and save an XCF you can keep working on. Headless mode runs the same workflows over folders of images.

See it working

[GIMP walkthrough: original, three MCP text edits, one Ctrl+Z, redo]

Watch the 20-second MP4 · Open the editable XCF · Reproduce the MCP session

This is a captured-step walkthrough of the real GIMP window, with pauses shortened. Three text layers are changed through MCP in one batch. One Ctrl+Z restores all three; Ctrl+Y brings them back. The text, artwork and background stay on separate named layers. This demonstrates actual tool execution, not a claim that every model will follow the same plan from a prompt.

Try asking

“Change the headline and supporting text in this card. Keep them as text layers, group the edits into one undo step, and show me the result before exporting.”

“Make this transparent artwork into a Telegram sticker with a white outline and shadow. Save a 512 × 512 PNG.”

“Pack these equal-sized PNG frames into a sprite sheet. Keep an XCF master, write the atlas JSON and verify the exported pixels against the originals.”

[Sticker recipe: source and finished sticker]

The included skills guide layered artwork, sprite sheets and batch jobs. They tell the agent to inspect and measure the actual output before calling a job complete.

Install

You need GIMP 3.2.x, Python 3.11+, uv and an MCP client. GIMP must be installed on the same machine as the server. Start GIMP once so its user profile exists.

bash
uvx gimp-agent-mcp install-pluginuvx gimp-agent-mcp install-skillsuvx gimp-agent-mcp doctor

Restart GIMP after installing or upgrading the bridge. In your open GIMP window, choose Filters → Development → Start Agent Bridge.

Add this configuration to your client's MCP settings:

json
{  "mcpServers": {    "gimp": {      "command": "uvx",      "args": ["gimp-agent-mcp", "serve"]    }  }}

For Claude Code:

bash
claude mcp add gimp -- uvx gimp-agent-mcp serve

Claude Code can also install the server and skills as a plugin; see skills installation. For AI background removal, install the optional model runtime with uvx --from "gimp-agent-mcp[segmentation]" gimp-agent-mcp serve (use the same arguments in your MCP config). The first use downloads a model; image processing stays local.

Working from source? Run uv sync --extra dev, then uv run gimp-agent-mcp install-plugin. Configure the server as uv run --no-sync --directory /absolute/path/to/repo gimp-agent-mcp serve. --no-sync avoids Windows executable-lock errors when another server is running.

Work in your window, or run a batch

  • Your existing window: start the bridge from the menu. Continue editing the same document by hand.
  • A shortcut: uvx gimp-agent-mcp shortcut creates a launcher that starts GIMP with the bridge enabled.
  • Agent-launched: gimp_launch(mode="gui") opens GIMP; mode="headless" runs without a window.

gimp_status and gimp_list_images report the image attached to GIMP's active user display, its selected layer ids, selection bounds and dirty state. When the user says "this layer" or "the selection", read that context before editing. Use gimp_context(image_id) for a specific document or to bring it forward with present=true. If multiple bridges run, gimp_status follows the newest bridge file; isolate test profiles when a user session is active.

What makes this useful

CapabilityWhat you get
Visual feedbackWhole-image, layer and region previews; saved snapshots; before/after/diff comparisons. Diagnostic overlays can add a coordinate grid, layer boxes, selection bounds and labelled points without changing the source.
Measured outputPixel colours, alpha bounds, histograms and dominant colours. Sprite packing reopens the exported PNG and compares each cell's decoded RGBA pixels with its source.
Editable workNamed layers, text, paths, masks and non-destructive layer effects. Export an XCF master and delivery files separately.
Everyday editingThree compact tools cover common adjustments, canvas transforms, fills and simple drawing. Every action reports the installed GEGL or PDB operation it used.
One undo stepgimp_edit_batch groups supported edits in one call. gimp_undo_group holds one image's edits across calls until ended, so one Ctrl+Z can revert the turn. A lost bridge connection closes its groups.
Runtime discoverySearch and describe the installed PDB procedures and GEGL operations, including parameter names, types and enum values. Numeric-array arguments support curves and brush strokes.
Repeatable jobsEleven recipes and folder batching, plus three bundled workflow skills.
Honest failure handlingA lost connection never silently replays an edit whose outcome is unknown. Reconnect, inspect, then decide whether to retry.

Other GIMP MCP projects also provide TCP bridges and visual feedback. This project's emphasis is editable output, measurement, grouped edits and reproducible validation. Generic API access is broad, but does not guarantee that every GIMP procedure or GEGL operation works with every argument combination.

Tools (40)

AreaTools
Learn and connectgimp_help, gimp_status, gimp_launch, gimp_shutdown, gimp_context
Imagesgimp_list_images, gimp_image_info, gimp_new_image, gimp_open, gimp_export, gimp_close_image
See and measuregimp_render, gimp_snapshot, gimp_drop_snapshot, gimp_render_compare, gimp_measure
PDBgimp_pdb_search, gimp_pdb_describe, gimp_pdb_call
Filtersgimp_filter_search, gimp_filter_describe, gimp_apply_filter, gimp_layer_effects, gimp_layer_effect
Everyday editsgimp_adjust, gimp_canvas, gimp_draw
Structured editgimp_edit_batch, gimp_undo_group, gimp_select, gimp_layer_mask, gimp_layer, gimp_text, gimp_list_fonts, gimp_path
Cut outgimp_remove_background (optional rembg model runtime)
Automategimp_run_python, gimp_list_recipes, gimp_run_recipe, gimp_batch_recipe, gimp_brand, gimp_cancel

Images and items use integer IDs. Colours accept hex, common names, CSS RGB strings or component arrays; enums use nicks returned by the describe tools. Call gimp_help("batch") for grouped-edit examples. gimp_run_python may be disabled, reducing the tool count by one.

Common work no longer needs procedure discovery. For example, use gimp_adjust(layer_id, "brightness_contrast", {"brightness": 0.15}), gimp_canvas(image_id, "crop", width=1200, height=630, x=40, y=20), or gimp_draw(image_id, layer_id, "line", color="#ffffff", x=20, y=40, x2=300, y2=40, line_width=6). Adjustments default to editable layer effects where GIMP supports them; canvas and drawing actions bake pixels or structure. Every result identifies the runtime operation selected before execution.

For visual placement, ask for a diagnostic preview without marking the working image:

text
gimp_render(image_id=3, overlay=["grid", "layers", "selection"], grid_size=100,            points=[{"x": 600, "y": 340, "label": "headline centre"}])

Recipes

RecipeJob
telegram_stickerFit, outline and shadow on a transparent 512 × 512 canvas.
composeCards and banners from a manifest of images, text, shapes and effects.
sprite_sheet_packOrdered, equal-sized PNGs → verified grid PNG, layered XCF and atlas JSON, with optional margin and spacing.
sprite_atlas_packMixed-size PNGs → padded, optionally trimmed atlas PNG, layered XCF and atlas JSON, verified pixel for pixel.
social_cropNamed social profiles (Open Graph, X, Instagram, story, YouTube or custom) around a focus point, with measured, pixel-checked output.
sprite_sheet_sliceFixed-size tiles from a sheet, optionally skipping empty cells.
web_optimiseResize and adjust export quality toward a file-size budget.
icon_setExport a square source at multiple sizes.
watermarkPosition a text or image watermark.
contact_sheetLabelled thumbnails from a folder.
fit_and_exportFit to a maximum edge and export by extension.

Brand kits for compose

Store a brand's colours, fonts, assets and canvas sizes once, then refer to them by token. Profiles are JSON files in the per-user config directory (%APPDATA%\gimp-agent-mcp\brands on Windows, ~/Library/Application Support/gimp-agent-mcp/brands on macOS, $XDG_CONFIG_HOME/gimp-agent-mcp/brands elsewhere; GIMP_AGENT_BRANDS_DIR overrides). Font names are checked against the running GIMP when a profile is saved.

text
gimp_brand(action="set", profile={"name": "example",  "colors": {"bg": "#0f1117", "accent": "#1f3a8a", "text": "#ffffff"},  "fonts": {"headline": "Bahnschrift Bold"}, "assets": {"logo": "/brand/logo.png"},  "canvases": {"x-card": [1200, 675], "og": [1200, 630]}})
gimp_run_recipe("compose", {"output_path": "out/card.png", "manifest": {  "brand": "example", "canvas": "x-card", "background": "@bg",  "items": [{"type": "image", "path": "@logo", "x": 40, "y": 40, "width": 160},            {"type": "text", "text": "Launch day", "font": "@headline", "size": 72, "color": "@text", "x": 40, "y": 240}]}})

Tokens are resolved in the server before anything reaches GIMP, so a token manifest becomes exactly the manifest you would have written by hand. Literal values still work and win over the profile; an unknown token fails with the profile name and its available keys. gimp_help("compose") has the full rules.

Recipe arguments and examples · Asset workflows · Skills

Tested scope and limits

Version 0.5.0, beta. Tested with Windows GIMP 3.2.4, Linux GIMP 3.2.2 (Ubuntu 26.04), and macOS 15 GIMP 3.2.4 on Apple Silicon and Intel. Each platform runs the full smoke suite, targeted capability proof and all 23 everyday editing actions against real GIMP. GIMP 2.10 is unsupported; earlier 3.x releases are not part of the current test matrix.

  • gimp_edit_batch accepts bounded layer, text, selection, path, mask and filter edits. gimp_undo_group(image_id, action="start", name="agent: sticker pass") holds a group across calls; end it with action="end". gimp_status lists open groups. A client disconnect closes its groups. The supplied name is tracked by the bridge, but GIMP 3's public undo-group API cannot set the Undo History label. The human uses GIMP's Undo/Redo; there is no programmatic undo endpoint.
  • uv run python scripts/undo_group_smoke.py checks three edits against a pre-turn snapshot after you press Ctrl+Z once in a GUI GIMP session. The headless gimp-agent-mcp smoke check covers group lifecycle and disconnect cleanup.
  • Some GEGL source operations, including linear gradients, are not drawable filters. Use the PDB gradient-fill procedure instead. Vector warp/liquify parity is not claimed; see the warp investigation note.
  • Sprite packing takes equal-sized frames (sprite_sheet_pack, with margin and spacing) or mixed-size PNGs and open layers (sprite_atlas_pack, with padding and trimming). Neither aligns animation or rotates sprites.
  • Long work reports progress and can be cancelled with gimp_cancel at checkpoints: between recipe items, batch files and edit-batch steps, between passes of gimp_run_python code that calls checkpoint(), and before a filter starts. A single GEGL merge already running cannot be interrupted, and GIMP's own per-procedure progress is not forwarded yet.

Verify your setup

bash
uvx gimp-agent-mcp smoke# From the source checkout:uv run pytestuv run python scripts/capability_proof.py /path/to/proof-outputuv run python scripts/everyday_proof.py /path/to/proof-output

CI checks supported Python versions, and separate jobs exercise real GIMP on Windows, Linux and both macOS architectures. Release publication depends on all three real-GIMP workflows passing. The general capability proof measures curves, gradients and brush output and checks batch recovery, document boundaries, diagnostic overlays, nested previews and snapshot cleanup. A second proof resolves and exercises every action in gimp_adjust, gimp_canvas and gimp_draw, recording dimensions, layer counts and measured pixels. See validation details.

Each smoke and proof script runs on a GIMP it launched itself and, when it shuts that GIMP down, waits until the bridge is really gone (port closed, bridge file removed, plug-in process exited) before returning. A bridge that has been asked to shut down refuses new connections and new requests at once. The smoke asserts this in its shutdown (bridge gone before return) check, and CI sets GIMP_AGENT_REQUIRE_OWN_GIMP=1 so a proof that finds an earlier step's bridge still answering fails with that reason instead of borrowing it. This fixed the macOS arm64 live-smoke failures of 15 October 2026, which looked like GIMP crashes but were a proof attaching to the previous step's GIMP while it quit. The live jobs do not retry checks: if the macOS job fails, its log says whether macOS wrote a GIMP crash report, and the macos-gimp-proof-<arch> artifact holds the proof reports, the GIMP launch log and any crash reports.

Architecture and trust

MCP client → stdio server → authenticated loopback TCP → plug-in inside GIMP

The plug-in runs operations on its GLib main loop, without worker threads. It uses a per-install token and only binds to 127.0.0.1. PDB calls, recipes and Python can execute code with your user permissions: connect only trusted clients. Disabling gimp_run_python is not a sandbox. Security · Architecture

Clean-room implementation under Apache-2.0; no code copied from other GIMP MCP projects. Roadmap · Changelog · Report a bug

來源:README.md,提交 1c1ae39

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.5.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分