gimp-local-mcp
Provides tools for controlling GIMP 3 locally, including image and layer management, transforms, selections, adjustments, and PDB procedure invocation.
Click on "Install 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-local-mcpOpen the last image and export it as PNG at 1920px 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 Local MCP
GIMP Local MCP is a local-first Model Context Protocol server for controlling GIMP 3 through an LLM. The LLM chooses an operation through structured MCP calls; GIMP owns the image manipulation, rendering, file loading, and exporting. Images and files remain on the user’s machine.
This v0.1 implementation favors a small, composable architecture over hundreds of one-off wrappers.
Philosophy
GIMP owns pixels. This project does not generate replacement pixels or call cloud image services.
Routine edits use ergonomic tools with stable image and layer IDs.
The live GIMP PDB is the long-term path to broad coverage, with structured invocation rather than raw Scheme input.
File writes are explicit and never overwrite existing targets by default.
The bridge preserves GIMP’s undo history and groups multi-step operations when the operation needs multiple PDB calls.
Related MCP server: GIMP MCP
Architecture
Natural language
|
v
MCP host (Codex, Claude, custom client)
|
| MCP stdio / JSON-RPC
v
gimp-local-mcp
ergonomic tools ---> GimpService ---> safe Scheme serializer
| |
+--> PDB catalog/invoker
|
v
Script-Fu TCP framing (127.0.0.1:10008)
|
v
GIMP 3 Script-Fu serverThe official MCP Python SDK is used for the server. Script-Fu socket and framing logic is isolated in gimp/transport.py and gimp/protocol.py; tool functions do not manipulate sockets directly.
Requirements
Python 3.10 or newer
GIMP 3.x
A running GIMP 3 Script-Fu server
GIMP is not required for the ordinary unit test suite.
GIMP 3 setup
Start GIMP 3.
Open Filters → Development → Script-Fu → Start Server.
Keep the listener on
127.0.0.1and port10008unless you have a specific reason to change it.Start the MCP server after the Script-Fu server is listening.
GIMP’s Script-Fu server accepts a three-byte G/16-bit-length request frame and returns a four-byte G/error/16-bit-length response frame. GIMP allows one Script-Fu client at a time; this server maintains one reconnectable client connection.
Installation
From a checkout:
python -m pip install -e '.[dev]'For a runtime-only installation:
python -m pip install .Run the server
gimp-local-mcp serveWith no subcommand, gimp-local-mcp also starts the stdio MCP server. Stdout is reserved for MCP protocol traffic; diagnostics go to stderr.
Check the local connection independently:
gimp-local-mcp doctordoctor prints Python details, the configured endpoint, local-only status, Script-Fu reachability, GIMP version, and open-image count. A connection refusal is expected until GIMP’s Script-Fu server is started.
Codex configuration
Add a project-local MCP entry in the Codex configuration used for this checkout. The exact location depends on the Codex client version; do not modify global configuration automatically.
[mcp_servers.gimp-local-mcp]
command = "gimp-local-mcp"
args = ["serve"]If the command is not on the client’s PATH, use the absolute path to the virtual-environment executable or launch it with Python:
[mcp_servers.gimp-local-mcp]
command = "python"
args = ["-m", "gimp_local_mcp.cli", "serve"]Configuration
Defaults work with a standard local GIMP setup:
Environment variable | Default | Meaning |
|
| Script-Fu host |
|
| Script-Fu port |
|
| TCP operation timeout in seconds |
|
| stderr log level |
|
| bounded response body size |
|
| explicit opt-in for non-loopback hosts |
Remote connections are rejected unless GIMP_MCP_ALLOW_REMOTE=true is set. Localhost-only operation is the secure default.
MCP tools
The current server registers 40 tools across these groups:
Session:
gimp_status,gimp_capabilities,list_open_images,get_active_image,get_image_infoFiles and images:
open_image,create_image,save_xcf,export_image,close_imageLayers:
list_layers,get_layer_info,create_layer,duplicate_layer,rename_layer,delete_layer,set_layer_visibility,set_layer_opacity,set_layer_mode,move_layer,merge_downTransforms:
resize_image,resize_canvas,crop_image,rotate_image,flip_imageSelection:
select_all,select_none,invert_selection,select_rectangle,select_ellipse,select_layer_alphaAdjustments and undo:
brightness_contrast,hue_saturation,desaturate,undo,redoPDB:
search_pdb,describe_pdb_procedure,invoke_pdb_procedure
invoke_pdb_procedure accepts JSON-compatible structured values, including { "scheme_symbol": "RGB" } for a GIMP enum. It does not accept Scheme source, Python, shell commands, or arbitrary evaluation. Runtime PDB counts and documentation are used when available. Procedure descriptions now include a bounded typed-metadata state (available, partial, unavailable, or malformed) plus argument/return records when a trusted structured adapter reports them. The default Script-Fu TCP adapter reports argument metadata as unavailable because Script-Fu does not expose a stable GimpProcedure/GParamSpec representation; no signatures or types are guessed. Named-argument validation is performed only when trustworthy names are actually available.
Example requests
“Open this image and crop it to 16:9 around the subject.”
“Duplicate the background layer, desaturate it, and reduce its opacity to 40%.”
“Resize this to 2048 pixels wide while preserving aspect ratio.”
“Export a JPEG copy at this path without overwriting anything.”
“What layers are currently in this document?”
“Find a GIMP procedure capable of applying Gaussian blur and describe its arguments.”
The final request is supported through PDB search and description; the current description reports procedure counts, documentation, and the explicit argument-metadata capability state. Rich argument records remain unavailable through the default Script-Fu bridge until a live, trustworthy adapter is available.
Security model
See SECURITY.md. In brief:
the MCP server is stdio-first and connects to loopback by default;
no shell, Python eval, raw Script-Fu MCP tool, or cloud image API exists;
procedure names and structured values are validated before serialization;
strings and paths are escaped as Scheme literals;
output paths must be explicit, normalized, and non-overwriting unless requested;
closing a dirty image requires an explicit discard choice.
Limitations
A live GIMP 3 installation is not available in this development environment, so integration tests are skipped here.
Export metadata behavior uses GIMP’s configured defaults in v0.1; no hidden metadata is added or removed.
The initial adjustment tools call stable legacy PDB adjustment procedures that GIMP 3.2 marks deprecated in favor of non-destructive filters. Structured filter configuration is a high-value follow-up.
get_active_imageuses GIMP’s default display; explicit image IDs are more reliable for multi-window workflows.Multi-call layer creation and duplication are grouped into one GIMP undo step. Additional composite operations should adopt the same internal helper as they are added.
Roadmap
Validate the high-level vertical slices against GIMP 3.2+ on Linux, macOS, and Windows.
Validate a GIMP 3-compatible structured PDB metadata adapter for argument names, types, defaults, and enum choices; keep the explicit unavailable fallback when Script-Fu cannot provide it.
Add structured non-destructive GEGL filter operations for brightness/contrast, levels, curves, hue/saturation, and Gaussian blur.
Improve recursive group-layer inspection and image/layer selection semantics.
Add explicit export metadata policies and more file-format option models.
Add safe, persistent capability caching with GIMP version invalidation.
Development
ruff format src tests
ruff check src tests
pytest -qLive tests are marked integration and skip when 127.0.0.1:10008 is unavailable. See CONTRIBUTING.md and AGENTS.md for repository invariants.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityBmaintenanceMCP server that bridges GIMP 3.0 with natural language commands, enabling conversational image editing through Claude Desktop and other MCP clients. Exposes GIMP's full PyGObject API for AI-powered image manipulation.171GPL 3.0
- Alicense-qualityFmaintenanceEnables AI models and external applications to control GIMP remotely via the Model Context Protocol, allowing image manipulation and object querying through natural language.3MIT
- AlicenseAqualityDmaintenanceControl GIMP from AI assistants via the Model Context Protocol, enabling image editing automation through natural language commands.184MIT
- Alicense-qualityBmaintenanceEnables 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.6AGPL 3.0
Related MCP Connectors
Sync Lightroom, Figma, Dropbox & Canva assets to WordPress and Shopify via natural language.
Sync Lightroom, Figma, Dropbox & Canva assets to WordPress and Shopify via natural language.
Generate images, video, and audio with Glif's media-generation agent
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/epi13/gimp-local-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server