From dfd8fbdd9673147bd89e1b50ddbfe5d164bb0338 Mon Sep 17 00:00:00 2001 From: LelouchOTR Date: Fri, 7 Aug 2026 00:35:10 +0200 Subject: [PATCH] fix: switch from mcp.server.fastmcp to standalone fastmcp package Upstream issue https://github.com/MiniMax-AI/MiniMax-Coding-Plan-MCP/issues/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. --- minimax_mcp/__init__.py | 2 +- minimax_mcp/server.py | 5 ++--- pyproject.toml | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/minimax_mcp/__init__.py b/minimax_mcp/__init__.py index f9cc663..856fc63 100644 --- a/minimax_mcp/__init__.py +++ b/minimax_mcp/__init__.py @@ -1,3 +1,3 @@ """Minimax Coding Plan MCP Server package.""" -__version__ = "0.0.3" +__version__ = "0.1.0" diff --git a/minimax_mcp/server.py b/minimax_mcp/server.py index 6ad39fb..d5cb7a2 100644 --- a/minimax_mcp/server.py +++ b/minimax_mcp/server.py @@ -14,7 +14,7 @@ import os import json from dotenv import load_dotenv -from mcp.server.fastmcp import FastMCP +from fastmcp import FastMCP from mcp.types import TextContent from minimax_mcp.utils import ( process_image_url, @@ -27,14 +27,13 @@ load_dotenv() api_key = os.getenv(ENV_MINIMAX_API_KEY) api_host = os.getenv(ENV_MINIMAX_API_HOST) -fastmcp_log_level = os.getenv(ENV_FASTMCP_LOG_LEVEL) or "WARNING" if not api_key: raise ValueError("MINIMAX_API_KEY environment variable is required") if not api_host: raise ValueError("MINIMAX_API_HOST environment variable is required") -mcp = FastMCP("Minimax",log_level=fastmcp_log_level) +mcp = FastMCP("Minimax") api_client = MinimaxAPIClient(api_key, api_host) @mcp.tool( diff --git a/pyproject.toml b/pyproject.toml index d084b12..358b572 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "minimax-coding-plan-mcp" -version = "0.0.4" +version = "0.1.0" description = "Specialized MiniMax Model Context Protocol (MCP) server designed for coding-plan users" authors = [ { name = "Roy Wu", email = "zhengyu@minimax.chat" }, @@ -22,7 +22,8 @@ keywords = [ ] requires-python = ">=3.10" dependencies = [ - "mcp[cli]>=1.6.0", + "mcp>=1.6.0", + "fastmcp>=3.0", "python-dotenv>=1.0.1", "requests>=2.31.0", ] @@ -34,7 +35,6 @@ minimax-coding-plan-mcp = "minimax_mcp.server:main" dev = [ "pre-commit>=3.6.2", "ruff>=0.3.0", - "fastmcp>=0.4.1", "pytest>=8.0.0", "pytest-cov>=4.1.0", "twine>=6.1.0",