Skip to content

Support mcp SDK 2.0, which renamed FastMCP to MCPServer - #23

Open
erikgaas wants to merge 1 commit into
mainfrom
mcp2-support
Open

Support mcp SDK 2.0, which renamed FastMCP to MCPServer#23
erikgaas wants to merge 1 commit into
mainfrom
mcp2-support

Conversation

@erikgaas

@erikgaas erikgaas commented Jul 29, 2026

Copy link
Copy Markdown

Fixes #21. The MCP python SDK 2.0.0 (released 2026-07-28 alongside the new spec) renamed FastMCP to MCPServer and moved it to mcp.server.mcpserver, so clikernel-mcp fails at import on any environment resolving the unpinned mcp dep 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=...), the instructions= 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 at mcp>=1.2 so pre-FastMCP versions fail at resolve time instead of import time.

Verification: red-green against real mcp 2.0.0 in a clean venv (reproduced the exact ModuleNotFoundError, then a v2 ClientSession over stdio: all three tools listed, state persists across execute calls); the same client test passes on mcp 1.29.0 via the fallback branch; pytest tests -q 24/24 after rebasing onto current main.

An earlier revision of this PR also migrated llmsurgery.dlgskill imports to aidialog (#22), but current main already has that change, so the PR is rebased down to the mcp fix only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HEzsvsrhD291xoipP6X9KC
@erikgaas erikgaas changed the title Support mcp SDK 2.0 and the aidialog dlgskill migration Support mcp SDK 2.0, which renamed FastMCP to MCPServer Jul 29, 2026
@erikgaas
erikgaas requested a review from jph00 July 29, 2026 18:39
@erikgaas erikgaas added the enhancement New feature or request label Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support mcp SDK 2.0, which renamed FastMCP to MCPServer

1 participant