Are you the author? Sign in to claim
GIMP MCP server for AI image editing, GIMP automation, and Model Context Protocol clients
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.
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:
The normal MCP path auto-starts a private headless GIMP bridge, so users do not
need to open GIMP or click Filters > Development.
/Applications/GIMP.appThis 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.
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.sh
If 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.sh
Use the wrapper script as your MCP server command:
/absolute/path/to/gimp-mcp/scripts/run_mcp_server.sh
The wrapper starts the stdio MCP server and automatically launches a private headless GIMP bridge if one is not already running.
Add this to your Codex MCP config:
[mcp_servers.gimp]
command = "/absolute/path/to/gimp-mcp/scripts/run_mcp_server.sh"
Add this to your Claude Desktop config:
{
"mcpServers": {
"gimp": {
"command": "/absolute/path/to/gimp-mcp/scripts/run_mcp_server.sh"
}
}
}
The repository includes .mcp.json for clients that support project-local MCP
server discovery.
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.sock
The 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.
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 sequenceSearch 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
}
}
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
}
For normal automation, use scripts/run_mcp_server.sh. It auto-starts a
headless bridge.
For debugging against the visible GIMP app:
Filters > Development > Start MCP Bridge.GIMP_MCP_SOCKET.This manual menu is a debug fallback, not the recommended production path.
Run the smoke test:
./scripts/smoke_test.sh
Run full local diagnostics:
./scripts/doctor.sh
Compile-check the Python files:
python3 -m py_compile src/gimp_mcp/server.py bridge/gimp_mcp_bridge.py
Install the bridge after editing it:
./scripts/install_bridge.sh
Generated examples are in examples/generated/, including:
horse-from-gimp-mcp.pngbar-chart-from-gimp-mcp.pngshapes-text-demo.pngGIMP MCP is a local automation bridge. Treat access to the Unix socket as access to the running GIMP process.
SECURITY.md before enabling any future raw Python execution feature.MIT. See LICENSE.
Run analytics queries on ClickHouse — explore schemas, execute SQL, fetch results
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots
Google's universal MCP server supporting PostgreSQL, MySQL, MongoDB, Redis, and 10+ databases