8000 Fix gimp_mcp_server import crash on mcp >= 1.13 (#45) by serrade · Pull Request #46 · gimp-mcp/gimp-mcp · GitHub
[go: up one dir, main page]

Skip to content

Fix gimp_mcp_server import crash on mcp >= 1.13 (#45) - #46

Merged
tomerkon merged 2 commits into
gimp-mcp:mainfrom
serrade:fix/fastmcp-instructions-kwarg
Nov 1, 2026
Merged

tomerkon merged 2 commits into
gimp-mcp:mainfrom
serrade:fix/fastmcp-instructions-kwarg

Conversation

@serrade
@serrade serrade commented Aug 31, 2026 •
Copy link
Copy Markdown
Contributor

Fixes #45.

Summary

gimp_mcp_server.py currently cannot be imported on any mcp release that a fresh resolve produces, so the MCP server process exits before serving a single tool. This fixes that and closes the two ways a user ends up broken today.

The in-GIMP socket plugin is not involved here - it works fine. This is purely the client-side server process.

Root cause

FastMCP.__init__ used to end with **settings: Any, which silently absorbed unknown keywords, so description= never actually applied - it was a no-op from the day it was added. That catch-all was removed in mcp 1.13.0, turning the same call into a hard TypeError at import time.

Measured per release, calling FastMCP('x', description='d') against FastMCP('x', instructions='i'):

mcp description= instructions=
1.10.1 (old lock) accepted, ignored works
1.11.0, 1.12.0 accepted, ignored works
1.13.0 - 1.29.1 TypeError works
2.x n/a mcp.server.fastmcp removed

Separately, the committed lock pinned pydantic-core 2.33.2, which has no cp314 wheel, so uv sync could only succeed on Python 3.13 or older. Between the two, keeping the old lock broke 3.14 and refreshing it broke every Python.

Changes

  • instructions= instead of description=. This is the supported field for this text and is compatible from 1.10.1 through 1.29.1, so it does not force anyone to upgrade. Worth flagging that it is not a pure rename: description= was discarded entirely, whereas instructions is actually sent to clients, so the string becomes visible in client handshakes for the first time. That seems to be the intent of the original line, but happy to drop the argument instead if you would rather not surface it.
  • mcp>=1.28.1,<2. The floor clears CVE-2025-66416, CVE-2026-52869 and CVE-2026-59950; the ceiling keeps this v1-API code off the 2.x FastMCP -> MCPServer rename, which the SDK's own error message recommends pinning against.
  • Dropped fastmcp. Nothing imports it. The only usage is from mcp.server.fastmcp import ..., which is a submodule of mcp itself. Removing it also drops authlib and friends from the lock, taking it from 86 packages to 41.
  • Refreshed uv.lock to match, which brings in pydantic-core 2.46.5 and its 3.14 wheels.

Test plan

  • uv sync and import gimp_mcp_server verified on Python 3.11, 3.12, 3.13 and 3.14 (3.14 previously failed at the pydantic-core build)
  • run_tests.py against live GIMP 3.2.4 on macOS: 59/59 PASSED
  • ruff check clean at the version CI pins (0.15.11); pre-commit run --all-files passes
  • Driven interactively end to end through an MCP client - open_image, auto_levels, adjust_curves, adjust_hue_saturation, sharpen, get_state_snapshot with region zoom, new_canvas, get_histogram
  • Dependency scan of the regenerated lock reports no known vulnerabilities, against 45 findings (2 critical, 21 high) for the previous lock

Prepared with AI assistance; every result above was executed and verified against a real GIMP 3.2.4 install rather than inferred.

Summary by CodeRabbit

  • Bug Fixes

    • Improved compatibility when starting the GIMP integration server by updating its server configuration.
  • Chores

    • Updated the integration’s server tooling configuration to use a compatible version range. This keeps the server setup aligned with the supported tooling while preserving its existing instructions and behavior.

FastMCP stopped accepting arbitrary **settings kwargs in mcp 1.13.0, so
description= -- which older releases silently swallowed and ignored -- now
raises TypeError while gimp_mcp_server is being imported, taking the whole
server down before it can serve a single tool. instructions= is the supported
field for this text and works on every release from 1.10.1 through 1.29.1.

Dependency metadata was unbounded, which left two ways to end up broken:

- mcp>=1.28.1 clears CVE-2025-66416, CVE-2026-52869 and CVE-2026-59950
- mcp<2 because 2.x renames FastMCP to MCPServer and drops
  mcp.server.fastmcp altogether
- fastmcp is dropped because nothing imports it; the code uses
  mcp.server.fastmcp, which ships inside mcp

uv.lock is refreshed to match. The previous lock pinned pydantic-core 2.33.2,
which publishes no cp314 wheel and fails its Rust build on Python 3.14, so
uv sync could only succeed on 3.13 or older.
@coderabbitai
coderabbitai Bot commented Aug 31, 2026 •
Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 9858d73 and 340ab65.

Files ignored due to path filters: 1
  • uv.lock is excluded by !**/*.lock
Files selected for processing: 2
  • gimp_mcp_server.py
  • pyproject.toml

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Walkthrough

The MCP server now passes its integration description through instructions. The project dependency configuration now requires MCP versions from 1.28.1 up to, but not including, 2.

Changes

MCP compatibility

Layer / File(s) Summary
MCP API and dependency update
gimp_mcp_server.py, pyproject.toml
The FastMCP constructor now uses instructions. The project replaces separate mcp and fastmcp dependencies with mcp>=1.28.1,<2.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: Minimal · up to 340ab

No actionable merge-blocking risk was identified in the dependency or MCP API update.

Architecture risk: Low · up to 340ab

The change affects 2 systems.

Changed systems: gimp_mcp_server.py, pyproject.toml

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — gimp_mcp_server.py (service) was modified; 1 changed file maps to changed impact.
  • observed — pyproject.toml (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in gimp_mcp_server.py: FastMCP now receives the integration text through instructions instead of description.
  • observed — Modified behavior in pyproject.toml: The dependency list replaces mcp and fastmcp with mcp constrained to versions >=1.28.1 and <2.
Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Linked Issues check Inconclusive The changed source and pyproject.toml implement the instructions= change, the mcp>=1.28.1,<2 bound, and removal of the unused fastmcp dependency required by #45. The PR description reports a r… Provide reviewable evidence that the committed dependency lock resolves successfully on Python 3.14 and permits import gimp_mcp_server.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the main change: fixing the gimp_mcp_server import crash caused by MCP version compatibility. It is concise and related to the changeset.
Out of Scope Changes check Passed The reviewed source and dependency changes address the client-side import failure described in #45. The dependency cleanup and lock refresh support that fix. No unrelated change is shown, and the in-G…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Out of Scope Changes check

Explanation

The reviewed source and dependency changes address the client-side import failure described in #45. The dependency cleanup and lock refresh support that fix. No unrelated change is shown, and the in-GIMP socket plugin is not changed.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files. (1 skipped: 1 unsupported.)

Full details: Linked Issues check

Explanation

The changed source and pyproject.toml implement the instructions= change, the mcp&gt;=1.28.1,&lt;2 bound, and removal of the unused fastmcp dependency required by #45. The PR description reports a refreshed uv.lock and successful Python 3.14 import testing. However, uv.lock is excluded from review, so the lock refresh and the resulting Python 3.14 dependency resolution cannot be independently established.

Resolution

Provide reviewable evidence that the committed dependency lock resolves successfully on Python 3.14 and permits import gimp_mcp_server.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@maorcc maorcc added the bug Something isn't working label Oct 19, 2026
@tomerkon
tomerkon merged commit 824966a into gimp-mcp:main Nov 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gimp_mcp_server.py fails at import on mcp >= 1.13: FastMCP() got an unexpected keyword argument 'description'

3 participants

0