Moving AnkusDrive to mcp 2.x, tested on four versions
Working as a Claude tool meant supporting mcp 2.x, without dropping 1.x users.Why we needed it: AnkusDrive had to support mcp 2.x to work as a Claude tool.
Issue #516 asked to move AnkusDrive’s MCP server to the mcp 2.x SDK without dropping 1.x users. It was one of five issues GC handed to parallel Claude Code agents; one agent took #516 and left the merge to GC.
The two SDK lines differ more than the version number suggests:
- Server class:
FastMCPbecameMCPServer. - Error text: from 2.1 on, a failing tool reaches the client as a bare “Error executing tool X”, without the reason.
- Tool calls:
call_toolnow needs a context argument. - Threading: 2.x runs sync tools in a thread pool, where 1.x ran them on the event loop.
The port added a small compatibility module that picks the right server class, restores the error reason, and keeps per-call workspace pinning working across the thread hop. The dependency became mcp>=1.10,<3, with a contract test enforcing that ceiling.
Verification ran on mcp 1.10.0, 1.30.0, 2.0.0 and 2.3.0. tools/list returned the same 287 tools byte for byte on all four, the 35 MCP-related test files gave identical results, and a new stdio test fails on 2.3.0 if the error-text fix is removed. The automated review flagged one unused helper; GC said “Clean up, then merge,” and PR #524 closed the issue.