Skip to main content
Glama

GimpMCP

An MCP server that lets an LLM (Claude Code, Claude Desktop, etc.) drive a running GIMP instance: images, layers, selections, gradients, text, transforms, color adjustments, any GEGL filter, or arbitrary Script-Fu (Scheme) code against GIMP's PDB.

How it works

GIMP ships a plug-in called plug-in-script-fu-server that turns GIMP into a persistent TCP server: you send it Scheme source over a socket and it sends back the printed result. This project exposes MCP tools that build the right Scheme snippet, send it over the socket, and parse the reply.

Full GIMP access comes in three layers:

  1. Curated tools (below) for the common operations, with clean parameters.

  2. apply_gegl_filter — applies any of GIMP's ~400 GEGL filters by name (gegl:pixelize, gegl:oilify, gegl:lens-flare, ...) with keyword params.

  3. run_script_fu — runs arbitrary Scheme against the full PDB (~2,000 procedures), with search_gimp_api to discover what exists.

Related MCP server: mcp-toolbox

Live UI mode (watch edits happen in GIMP)

If the Script-Fu server runs inside your visible GIMP window, every edit is shown live on screen. To enable this, in GIMP:

Filters ▸ Development ▸ Script-Fu ▸ Script-Fu Server (older builds: Filters ▸ Script-Fu ▸ Start Server), keep IP 127.0.0.1 and port 10008, click Start.

If no GIMP is running at all, the first tool call auto-starts a headless GIMP instead (fast, but edits are invisible). If GIMP's GUI is open but the server isn't started, tools refuse with a hint rather than silently editing in an invisible instance. gimp_status reports which mode you're connected to.

Setup

  1. Install GIMP 3.0 if you haven't already: https://www.gimp.org/downloads/

  2. From this directory:

    python -m venv .venv
    .venv\Scripts\pip install -e .
  3. (Optional) If auto-detection can't find your GIMP install, set the GIMP_EXECUTABLE environment variable to the full path of gimp-console-3.0.exe (typically under C:\Program Files\GIMP 3\bin\).

Register with Claude Code

Add to your MCP config (e.g. via claude mcp add or your .mcp.json):

{
  "mcpServers": {
    "gimp": {
      "command": "C:\\path\\to\\GimpMCP\\.venv\\Scripts\\python.exe",
      "args": ["-m", "gimp_mcp.server"]
    }
  }
}

Then ask Claude things like "open C:\photos\cat.png in GIMP, resize it to 800x600, and export it as cat_small.jpg".

Tools

Tool

Purpose

gimp_status

Check/start the server; reports GIMP version and GUI/headless mode

run_script_fu

Run arbitrary Scheme code against the PDB

search_gimp_api

Search all bound Script-Fu symbols (procedures, enums)

apply_gegl_filter

Apply any GEGL filter by name with params

open_image / new_image

Load a file / create a blank image (auto-shows in GUI)

display_image / refresh_ui

Show an image in a window / flush pending UI updates

export_image

Save to a path (format from extension); non-destructive

get_image_info / list_open_images / close_image

Inspect and manage open images

resize_image / crop_image / rotate_image / flip_image

Whole-image transforms

flatten_image

Merge all layers down

list_layers / add_layer / duplicate_layer

Layer stack management

set_layer_opacity / set_layer_visible / move_layer / fill_layer

Layer properties

select_rectangle / select_ellipse / select_none

Selections

gradient_fill

Linear/radial two-color gradient on the active layer/selection

gaussian_blur / sharpen

Common filters (also reachable via apply_gegl_filter)

brightness_contrast / desaturate / invert_colors

Color adjustments

add_text_layer

Add a text layer, returns the new layer ID

list_fonts

Installed font names, filterable

Example

examples/poster.py builds a complete layered poster (gradient background, glowing shapes, positioned text with a screen-mode glow) live in a visible GIMP window, then exports a PNG — a good tour of the API.

Platform support

Developed and fully verified on Windows + GIMP 3.0.8 (both the per-user %LOCALAPPDATA%\Programs\GIMP 3 and system-wide Program Files install locations are auto-detected). macOS and Linux path detection is included but untested — set GIMP_EXECUTABLE to your gimp-console binary if detection fails, and please report what you find. GIMP 2.10 is not supported: the curated tools target GIMP 3.0's renamed PDB API (see below).

Verified against GIMP 3.0.8

Every tool above has been exercised end-to-end against a real, running GIMP 3.0.8 (Windows) Script-Fu server — see smoketest.py. GIMP 3.0 renamed or removed a surprising number of PDB procedures compared to 2.10; here's what changed and what this project uses instead:

Old (2.10)

Status in 3.0.8

Used instead

gimp-layer-new image width height type name opacity mode

arg order changed

gimp-layer-new image name width height type opacity mode

gimp-edit-fill

removed

gimp-drawable-edit-fill

gimp-image-get-active-drawable

removed

gimp-image-get-selected-drawables (returns a vector; take (vector-ref ... 0))

gimp-file-save run-mode image drawable filename raw-name

signature simplified

gimp-file-save run-mode image filename (no drawable/raw-name)

gimp-image-width / -height

removed

gimp-image-get-width / gimp-image-get-height

gimp-image-list

removed

gimp-get-images

gimp-text-fontname image drawable x y text border antialias size size-type fontname-string

removed

gimp-text-font image drawable x y text border antialias size font-id — no size-unit arg (always pixels), and font is a resource ID ((vector-ref (car (gimp-fonts-get-list "Name")) 0)), not a string. Get the arg order wrong and you silently get a 3×4 px empty text layer

plug-in-gauss, plug-in-unsharp-mask, and nearly the entire plug-in-* GEGL-filter family

removed with no direct replacement

the generic gimp-drawable-merge-new-filter drawable "gegl:<op-name>" 0 LAYER-MODE-REPLACE 1.0 "<prop>" <val> ... (discovered by reading GIMP's own bundled unsharp-mask.scm)

The last one is the big one: GIMP 3.0's Script-Fu no longer exposes most GEGL filters as individual named procedures. Anything not covered by a curated tool here can likely still be reached via gimp-drawable-merge-new-filter with the right gegl: operation name — check GIMP's share/gimp/3.0/scripts/*.scm files (installed alongside GIMP) for real, working examples, or use (oblist) in run_script_fu to list every currently-bound Script-Fu symbol and grep for what you need.

If you're on a different GIMP version and something breaks, GIMP's own Script-Fu console (Filters > Script-Fu > Console) plus (defined? 'some-name) is the fastest way to check whether a procedure exists before wiring it up.

Protocol notes (for hacking on this further)

src/gimp_mcp/client.py implements the raw binary framing:

  • Request: [0x47][len_hi][len_lo][script bytes]

  • Response: [0x47][err_code][len_hi][len_lo][result bytes]

err_code is 0 on success, non-zero on Script-Fu evaluation errors. Length fields are 16-bit big-endian, so a single script is capped at 65535 bytes.

Every Script-Fu PDB call returns a list of its results even when there's only one, hence the frequent (car ...) in the generated scripts.

License

MIT — see LICENSE.

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SavithOnline/GimpMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server