gimp-mcp
Controls GIMP (GNU Image Manipulation Program) through MCP, enabling AI assistants to inspect, edit, and export images, call PDB procedures, manage layers, and perform batch operations.
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., "@gimp-mcp resize current image to 800 pixels wide"
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.
GIMP MCP Server
Control GIMP from Claude Desktop, Codex, Cursor, and other Model Context Protocol clients. This project provides a local MCP server and a GIMP 3.x Python plug-in that expose GIMP automation through a secure Unix socket, including Procedure Database discovery, image export, canvas snapshots, context inspection, and batch operations.
Keywords: GIMP MCP, GIMP Model Context Protocol, Claude GIMP, Codex GIMP, AI image editing, GIMP automation, GIMP Python plug-in, GIMP PDB, MCP server.
Why This Exists
GIMP has a powerful Python and Procedure Database API, but it is not easy for AI assistants to use directly. GIMP MCP bridges that gap:
Ask an AI assistant to inspect or edit images in GIMP.
Search and call GIMP PDB procedures from MCP tools.
Capture the current canvas as MCP image content for visual verification.
Run repeatable image workflows without clicking through the GIMP UI.
Keep automation local by default with a user-owned Unix socket.
The normal MCP path auto-starts a private headless GIMP bridge, so users do not
need to open GIMP or click Filters > Development.
Related MCP server: gimp-mcp
Features
GIMP 3.x automation through MCP
PDB search, describe, and call for broad GIMP feature coverage
MCP image capture with optional crop and max-size scaling
Open image and layer inspection
First-class layer tools for listing and updating layer properties
Friendly drawing tools for rectangles, ellipses, text, and polylines
Foreground/background, brush, font, opacity, antialias, and feather state
File open/export helpers for PNG, JPEG, WebP, TIFF, GIF, BMP, and XCF
Batch bridge operations
Headless auto-start for production-style automation
Manual visible-GIMP bridge for debugging interactive sessions
macOS-friendly installer for
/Applications/GIMP.app
Requirements
GIMP 3.x installed locally
Python 3.11+
An MCP-compatible client such as Codex, Claude Desktop, Cursor, or another stdio MCP client
This repo defaults to macOS and /Applications/GIMP.app. The bridge itself is
Python/GIMP based and can be adapted for Linux by installing the plug-in into
the relevant GIMP profile directory.
Quick Start
git clone https://github.com/abelduarte/gimp-mcp.git
cd gimp-mcp
python3 -m venv .venv
. .venv/bin/activate
python -m pip install -e .
./scripts/install_bridge.sh
./scripts/smoke_test.shIf GIMP is not installed at /Applications/GIMP.app:
GIMP_APP=/path/to/GIMP.app ./scripts/install_bridge.sh
GIMP_APP=/path/to/GIMP.app ./scripts/smoke_test.shMCP Client Configuration
Use the wrapper script as your MCP server command:
/absolute/path/to/gimp-mcp/scripts/run_mcp_server.shThe wrapper starts the stdio MCP server and automatically launches a private headless GIMP bridge if one is not already running.
Codex
Add this to your Codex MCP config:
[mcp_servers.gimp]
command = "/absolute/path/to/gimp-mcp/scripts/run_mcp_server.sh"Claude Desktop
Add this to your Claude Desktop config:
{
"mcpServers": {
"gimp": {
"command": "/absolute/path/to/gimp-mcp/scripts/run_mcp_server.sh"
}
}
}Project-local MCP discovery
The repository includes .mcp.json for clients that support project-local MCP
server discovery.
How It Works
There are two pieces:
gimp_mcp.server: the stdio MCP server used by the AI client.bridge/gimp_mcp_bridge.py: a GIMP Python plug-in that runs inside GIMP and exposes a JSON bridge over a local Unix socket.
Default socket:
/tmp/gimp-mcp-$USER.sockThe socket is created with 0600 permissions. Anyone who can connect to it can
drive the GIMP process, so do not expose it to untrusted users.
Available Tools
gimp.status: check bridge healthgimp.get_info: inspect GIMP version, directories, session, platform, and PDBgimp.get_context_state: inspect colors, brush, opacity, font, antialias, and feathergimp.get_image_bitmap: return a GIMP image as MCP image contentgimp.list_images: list open images and layer treesgimp.get_image: inspect one image by IDgimp.list_layers: list layers for one imagegimp.set_layer_properties: rename layers or update visibility, opacity, and blend modegimp.procedure.search: search GIMP's Procedure Databasegimp.procedure.describe: inspect procedure arguments and return valuesgimp.procedure.call: call a GIMP PDB proceduregimp.open: open an image filegimp.export: export an image filegimp.fill_rect: fill a rectangle on a drawablegimp.fill_ellipse: fill an ellipse on a drawablegimp.add_text: create a text layergimp.draw_polyline: draw deterministic pixel polylinesgimp.batch: run bridge operations in sequence
Example PDB Call
Search before calling:
{
"query": "image-resize",
"limit": 10
}Then call the procedure with exact PDB argument names:
{
"name": "gimp-image-resize",
"args": {
"image": { "id": 1, "type": "image" },
"new-width": 1920,
"new-height": 1080,
"offx": 0,
"offy": 0
}
}Visual Verification
Use gimp.get_image_bitmap to let the AI client see the current GIMP image:
{
"image_id": 1,
"max_width": 1024,
"max_height": 1024
}Crop a region for faster iteration:
{
"image_id": 1,
"region": {
"origin_x": 100,
"origin_y": 100,
"width": 400,
"height": 300
},
"max_width": 800,
"max_height": 600
}Manual Visible-GIMP Mode
For normal automation, use scripts/run_mcp_server.sh. It auto-starts a
headless bridge.
For debugging against the visible GIMP app:
Open GIMP.
Run
Filters > Development > Start MCP Bridge.Start your MCP client with the same
GIMP_MCP_SOCKET.
This manual menu is a debug fallback, not the recommended production path.
Development
Run the smoke test:
./scripts/smoke_test.shRun full local diagnostics:
./scripts/doctor.shCompile-check the Python files:
python3 -m py_compile src/gimp_mcp/server.py bridge/gimp_mcp_bridge.pyInstall the bridge after editing it:
./scripts/install_bridge.shExamples
Generated examples are in examples/generated/, including:
horse-from-gimp-mcp.pngbar-chart-from-gimp-mcp.pngshapes-text-demo.png
Security
GIMP MCP is a local automation bridge. Treat access to the Unix socket as access to the running GIMP process.
Do not expose the socket to untrusted users.
Do not run the bridge as root.
Prefer the default Unix socket transport over TCP.
Review
SECURITY.mdbefore enabling any future raw Python execution feature.
License
MIT. See LICENSE.
Available Tools
18 toolsgimp.add_textC
Create a text layer in an image.
Inputs: image_id (required), text (required), x (required), y (required), +6 more.
gimp.batchA
Run a list of bridge operations in order. Stops at the first failing operation.
Inputs: operations (required).
gimp.draw_polylineC
Draw a deterministic pixel polyline on a drawable.
Inputs: drawable_id (required), points (required), color, brush_size.
gimp.exportB
Export an image to a file. The bridge chooses a file-* export procedure from the extension unless procedure is supplied.
Inputs: image_id (required), path (required), procedure, options.
gimp.fill_ellipseC
Fill an elliptical region on a drawable using the foreground color.
Inputs: image_id (required), drawable_id (required), x (required), y (required), +3 more.
gimp.fill_rectC
Fill a rectangular region on a drawable using the foreground color.
Inputs: image_id (required), drawable_id (required), x (required), y (required), +3 more.
gimp.get_context_stateA
Get current GIMP context state such as foreground/background colors, brush, opacity, feather, antialias, and font.
Inputs: no named parameters.
gimp.get_imageC
Inspect one open image by GIMP image ID.
Inputs: image_id (required).
gimp.get_image_bitmapB
Return a GIMP image as MCP image content with optional max-size scaling and region extraction.
Inputs: image_id, max_width, max_height, region.
gimp.get_infoA
Get GIMP version, directories, session details, platform information, and PDB health checks.
Inputs: no named parameters.
gimp.list_imagesA
List open images, dimensions, layers, channels, and selected drawables.
Inputs: no named parameters.
gimp.list_layersB
List layers for an image with IDs, names, visibility, opacity, dimensions, and offsets.
Inputs: image_id (required).
gimp.openB
Open an image file in GIMP through the file load PDB procedure.
Inputs: path (required).
gimp.procedure.callA
Call a GIMP PDB procedure. Use describe first; pass object arguments as {"id": 123} or typed refs.
Inputs: name (required), args.
gimp.procedure.describeB
Describe a PDB procedure's arguments and return values.
Inputs: name (required).
gimp.procedure.searchA
Search GIMP's Procedure Database by name/help text. This is the discovery entry point for most GIMP features.
Inputs: query, limit.
gimp.set_layer_propertiesB
Update a layer's name, visibility, opacity, or blend mode.
Inputs: layer_id (required), name, visible, opacity, +1 more.
gimp.statusA
Check whether the GIMP bridge is alive and which GIMP/Python process is serving requests.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Each tool has a clearly distinct purpose. Even similar tools like fill_ellipse and fill_rect are differentiated by shape, and list_images vs get_image are different operations. The procedure.* tools are for PDB access and don't overlap with others.
All tool names follow a consistent `gimp.<verb>_<noun>` pattern, with compound verbs like `get_context_state`. The sub-namespace for procedure tools (`gimp.procedure.*`) is also consistent.
18 tools is well-scoped for a GIMP MCP server. It covers core image operations without being overwhelming, and the batch and procedure tools add flexibility without bloating the surface.
The tool set covers essential image operations (open, list, add text, draw shapes, fill, export, layer manipulation) and provides access to the entire GIMP PDB via `procedure.call`, making the surface effectively complete for any GIMP operation.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Hosted MCP server for AI photo editing: nothing to install, no desktop photo editor needed.
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Image and video AI tools and your own pipelines, run from any AI assistant.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI models and external applications to control GIMP remotely via the Model Context Protocol, allowing image manipulation and object querying through natural language.4MIT
- AlicenseNot gradedqualityDmaintenanceBridges GIMP image editing with AI assistants via the Model Context Protocol, enabling visual feedback and 56 tools for autonomous image workflows.GPL 3.0
- AlicenseBqualityDmaintenanceEnables 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.401GPL 3.0
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to create, paint, edit, inspect, and export images in a running GIMP 3.2 instance via MCP.199 PyPIGPL 3.0