You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In mcp SDK v2.0+, mcp.server.fastmcp was deprecated/renamed to mcp.server.mcpserver.MCPServer. Because pyproject.toml specifies mcp>=0.1.0 without an upper pin, environments running mcp 2.x fail on from mcp.server.fastmcp import FastMCP with ModuleNotFoundError.
Changes
Wrapped from mcp.server.fastmcp import FastMCP in a try/except that falls back to from mcp.server.mcpserver import MCPServer as FastMCP for seamless forward/backward compatibility.
Added test coverage in tests/test_mcp_server.py verifying server instantiation across MCP SDK versions.
Thank you — this was a real catch, and a well-diagnosed one.
I verified it from first principles before merging: installed mcp 2.1.1 in a clean venv, reproduced the ModuleNotFoundError, and confirmed mcp/server/fastmcp.py in 2.x is a deliberate tombstone that raises on import. Your reading of the rename was exactly right.
It is worse than the PR describes, too: with mcp>=0.1.0 unpinned, every fresh pip install projectmem since mcp 2.0.0 landed on 2026-07-28 got an MCP server that died at import — markdown mode kept working, all the tools did not. Five weeks of new users hit that silently. Your fix is the thing that unbreaks them.
Two additions on top of your change, both shipping in 0.3.0:
pyproject.toml now declares mcp>=1.0,<3. The open upper bound is what let a major release break us quietly; the alias handles 2.x, the bound stops the next major doing the same.
A test that actually exercises the fallback — it poisons mcp.server.fastmcp in sys.modules and loads a fresh copy of the module, so the 2.x path runs even on a machine with mcp 1.x installed.
Checked both directions after applying: 15 tools register on mcp 2.1.1, full suite green on 1.27.1.
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
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.
Summary
In
mcpSDK v2.0+,mcp.server.fastmcpwas deprecated/renamed tomcp.server.mcpserver.MCPServer. Becausepyproject.tomlspecifiesmcp>=0.1.0without an upper pin, environments runningmcp2.x fail onfrom mcp.server.fastmcp import FastMCPwithModuleNotFoundError.Changes
from mcp.server.fastmcp import FastMCPin a try/except that falls back tofrom mcp.server.mcpserver import MCPServer as FastMCPfor seamless forward/backward compatibility.tests/test_mcp_server.pyverifying server instantiation across MCP SDK versions.pytest.