fix: compatibility with mcp>=2 / fastmcp>=3 (fixes #25) - #27
Open
LelouchOTR wants to merge 1 commit into
Open
Conversation
Upstream issue MiniMax-AI#25 breaks the package on mcp>=2.0.0 because that release removed the `mcp.server.fastmcp` module. Changes: * Replace the broken `from mcp.server.fastmcp import FastMCP` import with `from fastmcp import FastMCP` (the high-level API was extracted into the standalone fastmcp PyPI package as of fastmcp 2.0). * Add `fastmcp>=3.0` as a runtime dependency (it was previously only in the optional dev extras, which is the actual root cause). * Drop the `log_level=` kwarg from the `FastMCP` constructor (removed in fastmcp>=3; the `FASTMCP_LOG_LEVEL` env var is still honoured by fastmcp directly). * Drop the now-unused `fastmcp_log_level` local. * Bump `[project] version` and `__version__` to 0.1.0. Diff vs upstream is +6/-7 across 3 files. End-to-end verified: `web_search` returns organic results, `understand_image` describes a real test image, MCP `initialize` and `tools/list` succeed without timeout.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes #25 — the package crashes on startup with
ModuleNotFoundError: No module named 'mcp.server.fastmcp'when installedvia
uvxagainstmcp>=2.0.0(released 2026-07-28).Why
mcp==2.0.0removed themcp.server.fastmcpsubmodule. The high-levelFastMCPdecorator API (@mcp.tool(...)) was extracted out ofmcpandinto the standalone
fastmcpPyPIpackage as of fastmcp 2.x. The repo's
pyproject.tomlaccidentallylisted
fastmcpas a dev extra only, so the runtime import had nofallback on
mcp>=2— that is the actual root cause, not just a missingupper bound.
Diff
minimax_mcp/server.pypyproject.tomlminimax_mcp/__init__.pybumps__version__to0.1.0.Total: +6 / -7 across 3 files.
Verification
End-to-end against the live MiniMax API with a fresh uvx-resolved env:
MCP initialize→server='Minimax' version='3.4.6' protocol='2025-11-25'tools/list→['understand_image', 'web_search']web_search('MiniMax M3 model release date')→ 9 organic results,base_resp.status_code=0understand_image('https://httpbin.org/image/png')→ correctly described as "round, pink cartoon pig face"Resolved env:
mcp==1.29.0,fastmcp==3.4.6.Pinning note
Pinning
fastmcp>=3.0raises the effective floor above what 0.0.4required (
fastmcpwas a dev-only extra so effectively zero). This isintentional: the alternative — keeping
from mcp.server.fastmcp import FastMCP— is literally impossible, since that module was deleted inmcp==2.0.0. If you'd prefer a lower floor, I can targetfastmcp>=2,<3instead; that line still accepts the legacylog_level=constructor kwarg, soserver.pybecomes a single-linechange and the dropped-kwarg part of the diff goes away.
Version bump is
0.0.4 → 0.1.0; happy to mark it0.0.5if you'dprefer semver-strict.
Reported-by: @LelouchOTR
Tested-by: @LelouchOTR
Refs: #25
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.