Logo von GIMP MCP

GIMP MCP

Community
maorcc

GIMP MCP server

Herausgebermaorcc
Repositorygimp-mcp
SprachePython
Forks
40
Sterne
225
Verfügbare Tools
0
Transporttypstdio
Kategorien
LizenzGPL-3.0
Links
  • Tools mit KI-Workflows verbinden

    GIMP MCP stellt MCP-Funktionen bereit, die kompatible KI-Clients und Agenten nutzen können.

  • 0 verfügbare Tools

    Sehen Sie sich unten die aufrufbaren Aktionen an, einschließlich Namen und Beschreibungen, sofern der Server diese bereitstellt.

  • Konfiguration zum Kopieren

    Nutzen Sie die Installationsbeispiele, um diesen Server in Ihrem bevorzugten MCP-Client zu konfigurieren.

  • Open-Source-Kennzahlen

    225 Sterne und 40 Forks im verlinkten Repository.

GIMP MCP

License: GPL v3 Works with Claude Desktop GIMP 3.2 MCP Compatible CodeRabbit

Demo

GIMP MCP in action — AI agent driving GIMP through natural language

Full demo (with audio): https://github.com/maorcc/gimp-mcp/raw/main/docs/demo.mp4

AI agent using GIMP MCP to remove a background, edit a character's expression, and verify results — all through natural language via Claude


Overview

GIMP MCP bridges GIMP's professional image editing capabilities with AI assistants through the Model Context Protocol. It lets you edit images by describing what you want — and gives the AI a live visual feedback channel to verify each change before moving on.

What makes it different from other GIMP integrations:

  • The AI can see the image at any point in the workflow without saving to disk (get_state_snapshot)
  • Supports fully autonomous multi-step pipelines: open → edit → verify → refine → export
  • 56 dedicated tool commands covering every major GIMP operation
  • Fully compatible with GIMP 3.2.x (all breaking API changes resolved)

Key Features

👁️ Live Visual Feedbackget_state_snapshot returns a PNG preview mid-workflow so the AI verifies each step
🎨 56 GIMP ToolsAdjustments, transforms, selections, layers, drawing, text, filters — all via MCP
🔧 GIMP 3.2 CompatibleAll GIMP 3.2 API breaks fixed and tested (56/56 passing)
🔁 Iterative WorkflowsAI loops until a goal is met — e.g. keeps removing BG until no pixels remain
🖼️ Region SnapshotsZoom into any area for detail verification (face, mouth, corner, etc.)
🔌 Universal MCPWorks with Claude Desktop, Claude Code, Gemini CLI, PydanticAI, and more

What Can It Do?

Background Removal with Iterative Verification

The AI removes the background, takes a snapshot to inspect the result, detects remaining pixels, and loops until the image is clean:

"Remove the background from this image and keep looping until only the character remains"

Expression Editing

"Make the character smile — paint a smile arc with teeth over her mouth"

Complex Multi-Step Pipelines

"Open navi_portrait.png, remove the background, verify it's clean,
 then make her smile and export the final result as a PNG"

Color & Tone Work

"Boost the contrast, shift the hue 15 degrees warmer, then show me a before/after zoom of the face"

Text & Compositing

"Add a bold title at the top in white with a subtle drop shadow, then export for web"

Prerequisites

  • GIMP 3.2+ — tested on GIMP 3.2.2 (Windows, macOS, Linux)
  • Python 3.8+ — for the MCP server
  • uv — Python package manager (pip install uv)
  • MCP-compatible AI client — Claude Desktop, Claude Code, Gemini CLI, PydanticAI, etc.

Quick Start

1. Install Dependencies

bash
git clone https://github.com/maorcc/gimp-mcp.git
cd gimp-mcp
uv sync

2. Install the GIMP Plugin

Copy gimp-mcp-plugin.py to GIMP's plug-ins directory and restart GIMP.

Which directory? GIMP names its per-user folder after its major.minor version (3.0, 3.2, 3.4, …) and creates a fresh one on each minor upgrade, so the folder moves when you upgrade GIMP (e.g. 3.0 → 3.2). The snippet below auto-selects the newest one, so it keeps working across upgrades. To check the path manually, open GIMP and look at Edit → Preferences → Folders → Plug-ins.

Launch GIMP at least once before running this, so its config folder exists.

macOS / Linux:

bash
# Pick the base directory for your platform:
BASE="$HOME/Library/Application Support/GIMP"     # macOS
# BASE="$HOME/.config/GIMP"                        # Linux (standard)
# BASE="$HOME/snap/gimp/current/.config/GIMP"      # Linux (Snap)

# Auto-select the newest GIMP 3.x config directory (3.0, 3.2, 3.4, ...):
GIMP_DIR="$(ls -d "$BASE"/3.* 2>/dev/null | sort -V | tail -1)"
if [ -z "$GIMP_DIR" ]; then
  echo "No GIMP 3.x config dir found under $BASE — launch GIMP once, then re-run." >&2
  exit 1
fi
mkdir -p "$GIMP_DIR/plug-ins/gimp-mcp-plugin"
cp gimp-mcp-plugin.py "$GIMP_DIR/plug-ins/gimp-mcp-plugin/"
chmod +x "$GIMP_DIR/plug-ins/gimp-mcp-plugin/gimp-mcp-plugin.py"
echo "Installed into: $GIMP_DIR/plug-ins/gimp-mcp-plugin"

Windows:

text
%APPDATA%\GIMP\<VERSION>\plug-ins\gimp-mcp-plugin\gimp-mcp-plugin.py

Replace <VERSION> with your GIMP major.minor (e.g. 3.2). No chmod needed on Windows. Just copy and restart GIMP.

For all platforms: GIMP Plugin Installation Guide

3. Start the MCP Server in GIMP

  1. Open any image in GIMP
  2. Go to Tools > MCP > Start MCP Server
  3. Server starts on localhost:9877

4. Configure Your MCP Client

Claude Desktop

~/.config/Claude/claude_desktop_config.json (Linux/macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

json
{
  "mcpServers": {
    "gimp": {
      "command": "uv",
      "args": ["run", "--directory", "/full/path/to/gimp-mcp", "gimp_mcp_server.py"]
    }
  }
}

Claude Code

bash
cd /path/to/gimp-mcp
claude  # .mcp.json is auto-detected

Or manually:

bash
claude mcp add gimp-mcp -- uv run --directory /full/path/to/gimp-mcp gimp_mcp_server.py

Gemini CLI

~/.config/gemini/.gemini_config.json:

json
{
  "mcpServers": {
    "gimp": {
      "command": "uv",
      "args": ["run", "--directory", "/full/path/to/gimp-mcp", "gimp_mcp_server.py"]
    }
  }
}

PydanticAI

python
from pydantic_ai import Agent
from pydantic_ai.mcp import MCPServerStdio

server = MCPServerStdio('uv', args=['run', '--directory', '/path/to/gimp-mcp', 'gimp_mcp_server.py'])
agent = Agent('openai:gpt-4o', mcp_servers=[server])

Available MCP Tools

👁️ Visual Feedback

get_state_snapshot(image_index, max_size, region, label)

Returns a live PNG of the current image state — the AI's primary feedback mechanism. Call this between any edits to verify the result without saving to disk.

python
# Full image snapshot
snapshot = get_state_snapshot(max_size=512)

# Zoom into a face region for detail inspection
snapshot = get_state_snapshot(
    region={"x": 140, "y": 80, "width": 240, "height": 300},
    max_size=512,
    label="face-check"
)

This enables iterative agentic workflows: edit → snapshot → assess → refine → repeat.

get_image_bitmap(image_index, max_width, max_height, region)

Lower-level bitmap fetch with region extraction and scaling. Returns base64-encoded PNG.

🎨 Adjustments

ToolDescription
adjust_brightness_contrastBrightness and contrast
adjust_curvesCurves by channel (RGB/R/G/B/A)
adjust_hue_saturationHue, saturation, lightness
adjust_color_balanceShadows/midtones/highlights color balance
auto_levelsAuto-stretch levels
desaturateConvert to grayscale (keep RGB mode)
invert_colorsInvert all channels
sharpenUnsharp mask sharpening
blurGaussian blur
denoiseNoise reduction

🔄 Transforms

ToolDescription
scale_imageScale to exact dimensions
scale_to_fitScale within bounding box (aspect-safe)
crop_to_rectCrop to rectangle
rotate_imageRotate 90/180/270 or arbitrary angle
flip_imageFlip horizontal or vertical
resize_canvasResize canvas without scaling content

✂️ Selections

ToolDescription
select_rectangleRectangular marquee
select_ellipseElliptical marquee
select_by_colorSelect by color (global)
select_all / select_noneSelect all / deselect
invert_selectionInvert selection
modify_selectionGrow, shrink, feather, or border

🗂️ Layers

ToolDescription
create_layerNew empty layer
duplicate_layerDuplicate active layer
delete_layerDelete named layer
rename_layerRename layer
set_layer_propertiesOpacity, blend mode, visibility
reorder_layerMove layer in stack
merge_visible_layersFlatten visible to one layer
flatten_imageFlatten all layers
list_layersList all layers with properties

🖌️ Drawing & Fill

ToolDescription
fill_layerFill entire layer with color
fill_selectionFill selection (foreground/background/transparent)
fill_rectangleFill a rectangle region
fill_ellipseFill an ellipse region
draw_lineDraw a line (pencil or paintbrush)
draw_rectangleDraw a rectangle outline
draw_ellipseDraw an ellipse outline
gradient_fillApply linear or radial gradient
set_colorsSet foreground/background colors

🔤 Text

ToolDescription
add_textAdd a text layer
edit_textEdit existing text layer
list_fontsList available fonts

✨ Filters & Effects

ToolDescription
apply_gaussian_blurGaussian blur filter
apply_pixelatePixelate/mosaic effect
apply_embossEmboss effect
apply_vignetteVignette darkening
apply_noiseAdd noise/grain
apply_drop_shadowDrop shadow effect

📁 File Operations

ToolDescription
open_imageOpen image file
export_imageExport to PNG, JPEG, BMP, TIFF
new_canvasCreate blank canvas
close_imageClose image
list_imagesList open images

🔍 Info & Context

ToolDescription
get_image_metadataImage size, mode, layers, filename
get_gimp_infoGIMP version, platform, capabilities
get_context_stateCurrent colors, brush, opacity, mode
get_pixel_colorColor value at a specific pixel
get_histogramHistogram data for a channel
get_selection_boundsCurrent selection bounds

AI Agent Feedback Loop

The get_state_snapshot tool enables a pattern where the AI loops until a goal is visually confirmed:

text
┌─────────────┐
│  Apply edit │
└──────┬──────┘
       │
       ▼
┌─────────────────┐
│ get_state_      │  ← AI sees live PNG, no disk save needed
│ snapshot()      │
└──────┬──────────┘
       │
       ▼
┌─────────────────┐     ┌──────────────────┐
│ Goal achieved?  │─ No─▶ Adjust & retry   │
└──────┬──────────┘     └──────────────────┘
       │ Yes
       ▼
┌─────────────┐
│   Export    │
└─────────────┘

Example: Iterative Background Removal

See bg_remove_iterative.py for a complete example. The AI:

  1. Removes the background using edge-seeded contiguous select
  2. Takes a snapshot to check the result
  3. Scans for remaining background-colored pixels
  4. Runs targeted removal passes with progressively finer grids (25px → 1px)
  5. Runs a final despeckle pass for isolated pixels
  6. Loops until no background pixels remain

Example Scripts

ScriptDescription
run_tests.py56-test suite — run against your GIMP to verify all tools work
bg_remove_iterative.pyIterative BG removal with snapshot checkpoints
bg_remove.pySimple single-pass background removal
agent_edit_demo.pyFull pipeline: open → remove BG → edit expression → export

Run the test suite to verify your setup:

bash
python run_tests.py
# Expected: 56/56 PASSED

Technical Architecture

Plugin ↔ Server Communication

text
AI Client (Claude, etc.)
      │  MCP (stdio)
      ▼
gimp_mcp_server.py          ← MCP tool definitions
      │  TCP JSON  :9877
      ▼
gimp-mcp-plugin.py          ← Runs inside GIMP process
      │  PyGObject
      ▼
GIMP 3.2 (gi.repository.Gimp)
  • MCP server translates tool calls into JSON commands sent to the plugin over TCP
  • Plugin executes operations directly in the GIMP process via PyGObject
  • Two message formats: {"type": "...", "params": {...}} for named tools, {"cmds": ["python..."]} for arbitrary exec

GIMP 3.2 Compatibility Notes

GIMP 3.x introduced breaking API changes from GIMP 2.x. Key fixes included in this release:

IssueFix
layer.copy(False) → errorlayer.copy() takes no args in GIMP 3.2
Gimp.text_fontname() removedUse PDB gimp-text-fontname
gimp-blend removedUse GEGL gegl:linear-gradient / gegl:radial-gradient
GimpDoubleArray TypeError in curvesUse drawable.curves_spline() directly
Gimp.fonts_get_list() returns Font objectsConvert via .get_name() before JSON serialization
image.select_none() removedUse PDB gimp-selection-none
layer.get_pixel() returns Gegl.ColorUse .get_rgba() to extract float components

Troubleshooting

"Could not connect to GIMP"

  • GIMP must be running with an image open
  • Start the MCP server: Tools > Start MCP Server
  • Check port 9877 is not blocked by firewall

Plugin Not Visible in GIMP

  • Look under Tools > MCP (the plugin adds an MCP submenu, not a top-level Tools entry)
  • Confirm the plugin file is in the correct directory (see install steps above)
  • Upgraded GIMP recently? A minor upgrade (e.g. 3.0 → 3.2) moves the per-user config folder to a new version directory; reinstall the plugin into the new version's plug-ins folder. Verify the active path via Edit > Preferences > Folders > Plug-ins.
  • On Linux/macOS: ensure the file has execute permission (chmod +x)
  • Restart GIMP after installation
  • Check Filters > Script-Fu > Console for error messages

Tests Failing

Run the test suite and check the failure list:

bash
python run_tests.py

Each failure includes the tool name and error — most issues on GIMP 3.2 are covered by the fixes above.

Debug Mode

bash
GIMP_MCP_DEBUG=1 uv run --directory /path/to/gimp-mcp gimp_mcp_server.py

Example Output

"Draw me a face and a sheep" — generated entirely through natural language via GIMP MCP


Future Enhancements

  • 📚 Recipe Collection: Reusable workflow templates (portrait cleanup, product photo, etc.)
  • ↩️ Undo System: History management and rollback via MCP
  • 🚀 Dynamic Discovery: Auto-generate MCP tools from GIMP's full PDB procedure database
  • 🔒 Security: Sandboxed execution for untrusted command inputs
  • ⚡ Performance: Optimized bitmap transfer for large images
  • 🌐 Remote Access: Network-accessible GIMP instances

Contributing

Contributions are welcome — bug fixes, new tools, documentation, or example scripts. Open a PR or issue on GitHub.

Development Setup

Install dev dependencies and activate the pre-commit hook so ruff runs on every commit:

bash
uv sync
uv run pre-commit install

After this, ruff checks staged files on each git commit (with --fix applied automatically). The same check runs in CI, so the hook is just a fast local safety net.

To bump the pinned hook versions later:

bash
uv run pre-commit autoupdate

Installation

TypingMind
Voraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "maorcc-gimp-mcp": {
      "command": "",
      "args": []
    }
  }
}

GIMP MCP MCP mit mehreren KI-Modellen nutzen

TypingMind bindet MCP-Tools auf Arbeitsbereichsebene ein. Sobald GIMP MCP verbunden ist, können Sie die Integration mit verschiedenen KI-Modellen in TypingMind verwenden, statt sie für jedes Modell separat einzurichten. Diese MCP-Integration läuft lokal über den TypingMind-MCP-Konnektor auf Ihrem Gerät.

Einrichtungsanleitung für den lokalen Konnektor

Nutzen Sie diese Option, wenn der MCP-Server Zugriff auf lokale Dateien, Apps oder private Ressourcen auf Ihrem Computer benötigt.

1

MCP-Einstellungen öffnen

Gehen Sie in TypingMind zu „Einstellungen“, „Erweiterte Einstellungen“ und dann „Model Context Protocol“ und wählen Sie „Konnektor-Setup“.

  1. Öffnen Sie TypingMind in Ihrem Browser.
  2. Klicken Sie auf das Symbol „Optionen“.
  3. Gehen Sie zu „Erweiterte Einstellungen“.
  4. Öffnen Sie den Abschnitt „Model Context Protocol“.
  5. Klicken Sie auf „Konnektor-Setup“ und wählen Sie „Dieses Gerät“.
Einrichtungsbildschirm des TypingMind-MCP-Konnektors mit ausgewählter Option „Dieses Gerät“
2

Konnektor-Befehl ausführen

Wählen Sie „Dieses Gerät“, kopieren Sie den Befehl aus TypingMind und führen Sie ihn im Terminal aus. Lassen Sie den Prozess laufen, solange Sie MCP verwenden.

  1. Kopieren Sie den in TypingMind angezeigten Einrichtungsbefehl.
  2. Öffnen Sie unter macOS Terminal bzw. unter Windows Windows Terminal.
  3. Fügen Sie den Befehl ein und führen Sie ihn aus.
  4. Bestätigen Sie die Paketinstallation, wenn Sie im Terminal zum Fortfahren aufgefordert werden.
  5. Lassen Sie das Terminalfenster geöffnet und den Prozess darin laufen, solange Sie MCP-Tools verwenden.
3

GIMP MCP als Server hinzufügen

Wenn der Konnektorstatus „Bereit“ anzeigt, klicken Sie auf „Server ändern“ und fügen Sie die MCP-Server-Konfiguration ein.

  1. Warten Sie, bis der Konnektorstatus „Bereit“ anzeigt.
  2. Klicken Sie auf „Server ändern“.
  3. Fügen Sie die MCP-Server-Konfiguration für GIMP MCP ein.
  4. Speichern Sie die Serverliste.
  5. Aktualisieren Sie die Ansicht, um bei Bedarf zu prüfen, ob der Konnektor weiterhin bereit ist.
MCP-Einstellungen in TypingMind mit aktivem Server und der Schaltfläche „Server ändern“
{
  "mcpServers": {
    "maorcc-gimp-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "gimp-mcp"
      ]
    }
  }
}
4

Verbindung modellübergreifend nutzen

Speichern Sie die Serverliste, öffnen Sie „Plugins“ und aktivieren Sie die MCP-Tools von GIMP MCP. Wählen Sie dann ein beliebiges unterstütztes KI-Modell in TypingMind und verwenden Sie die Tools im Chat oder weisen Sie sie einem KI-Agenten zu.

  1. Öffnen Sie die Seite „Plugins“ in TypingMind.
  2. Aktivieren Sie die MCP-Tools von GIMP MCP.
  3. Starten Sie einen Chat und wählen Sie das KI-Modell, das Sie verwenden möchten.
  4. Nutzen Sie die MCP-Tools im Chat oder weisen Sie sie einem KI-Agenten zu.
  5. Wechseln Sie bei Bedarf zu einem anderen KI-Modell, ohne die MCP-Verbindung erneut herzustellen.
TypingMind-Chat mit aktivierten MCP-Tools und einem ausgewählten KI-Modell
Können Sie mir mit GIMP MCP bei dieser Aufgabe helfen?
GIMP MCP
Gerne. Ich habe es gelesen.
Das habe ich mit GIMP MCP gefunden.

Häufig gestellte Fragen

Wofür wird der MCP-Server GIMP MCP verwendet?

GIMP MCP ist ein MCP-Server, über den kompatible KI-Clients auf externe Tools und Kontext zugreifen können. In TypingMind können Sie diesen MCP-Server einmal hinzufügen und seine Tools in Ihrem KI-Arbeitsbereich verfügbar machen.

Kann ich GIMP MCP MCP mit mehreren KI-Modellen in TypingMind verwenden?

Ja. TypingMind bindet MCP-Tools auf Arbeitsbereichsebene ein. So können Sie GIMP MCP mit verschiedenen KI-Modellen wie Claude, ChatGPT, Gemini oder anderen in TypingMind konfigurierten Modellen verwenden, ohne den MCP-Server für jedes Modell separat einzurichten.

Warum GIMP MCP MCP mit TypingMind nutzen?

TypingMind ist eine der besten Oberflächen für LLM-Chats, da es mehrere KI-Modelle, Prompts, Plugins, KI-Agenten, API-Schlüssel und MCP-Tools in einem Arbeitsbereich vereint. Sobald GIMP MCP verbunden ist, können Sie die zugehörigen MCP-Tools mit Ihren bevorzugten Modellen nutzen und Ihre Chat-Abläufe in TypingMind übersichtlich organisieren.

Wie verbinde ich GIMP MCP MCP mit TypingMind?

GIMP MCP wird über den lokalen MCP-Konnektor von TypingMind angebunden. Das ist die beste Wahl, wenn der MCP-Server auf lokale Dateien, Desktop-Apps, Befehlszeilentools oder private Ressourcen auf Ihrem Computer zugreifen muss.

Welche Tools stellt GIMP MCP MCP in TypingMind bereit?

GIMP MCP stellt MCP-Funktionen bereit, die Sie auf der Plugins-Seite in TypingMind aktivieren und im Chat verwenden oder KI-Agenten zuweisen können.

Muss ich meine API-Schlüssel mit TypingMind teilen, um GIMP MCP MCP zu verwenden?

Nein. TypingMind arbeitet vorrangig lokal, sodass Sie die Kontrolle über Ihre Modellanbieter, API-Schlüssel, Prompts und MCP-Konfiguration behalten. Falls GIMP MCP eine Authentifizierung erfordert, fügen Sie beim Erstellen der Verbindung die erforderlichen Header, OAuth-Einstellungen oder die lokale Konfiguration für diesen MCP-Server hinzu.

Ähnliche MCP-Server

Alle

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇