Support mcp SDK 2.0, which renamed FastMCP to MCPServer - #23
Open
erikgaas wants to merge 1 commit into
Open
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HEzsvsrhD291xoipP6X9KC
This was referenced Jul 29, 2026
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.
Fixes #21. The MCP python SDK 2.0.0 (released 2026-07-28 alongside the new spec) renamed
FastMCPtoMCPServerand moved it tomcp.server.mcpserver, soclikernel-mcpfails at import on any environment resolving the unpinnedmcpdep to 2.x (hit in the wild on a solveit instance image built after the release). Everything else clikernel uses (run_stdio_async,tool(structured_output=...), theinstructions=kwarg) is unchanged in 2.0.0, so the fix is a dual import (2.x path first, 1.x fallback; the alias keeps the diff minimal) plus flooring the dep atmcp>=1.2so pre-FastMCP versions fail at resolve time instead of import time.Verification: red-green against real
mcp 2.0.0in a clean venv (reproduced the exactModuleNotFoundError, then a v2ClientSessionover stdio: all three tools listed, state persists acrossexecutecalls); the same client test passes onmcp 1.29.0via the fallback branch;pytest tests -q24/24 after rebasing onto current main.An earlier revision of this PR also migrated
llmsurgery.dlgskillimports toaidialog(#22), but current main already has that change, so the PR is rebased down to the mcp fix only.