Skip to content

Commit 985bfce

Browse files
committed
fix(git): migrate to MCP Python SDK v2 constructor-based API
Fixes #4580. The v1 decorator based handlers (@server.list_tools, @server.call_tool) no longer exist in v2; the low-level Server now takes handlers as on_* constructor arguments. Also pins mcp>=2,<3 in pyproject.toml, the missing upper bound was the actual root cause: an unconstrained mcp>=1.0.0 let a fresh install silently resolve to the incompatible v2 SDK. Also removes the unused list_repos()/by_roots() helper, confirmed dead via grep, which relied on the now-removed ambient server.request_context property.
1 parent 76d64c8 commit 985bfce

3 files changed

Lines changed: 263 additions & 293 deletions

File tree

‎src/git/pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ classifiers = [
1818
dependencies = [
1919
"click>=8.1.7",
2020
"gitpython>=3.1.50",
21-
"mcp>=1.0.0",
21+
"mcp>=2,<3",
2222
"pydantic>=2.0.0",
2323
]
2424

0 commit comments

Comments
 (0)