Repository navigation
Commit 916cdc9
feat(git): build the git server on MCPServer; unknown tool is -32602
The git server moves from the SDK's low-level Server, with its SDK v1
compatibility wrapper (hand-rolled jsonschema validation, every exception
folded into an isError result), to the high-level MCPServer (modelcontextprotocol#5174). Each
tool is a typed function registered with @server.tool; its name,
description, arguments, defaults, descriptions and annotations are
unchanged. Only each input schema's top-level title differs, now derived
from the function name.
- An unknown tool is a JSON-RPC -32602 protocol error in both eras, as
the spec requires. MCPServer still answers one with isError
(python-sdk#3659), so a middleware rejects it before the lookup, which
also keeps modelcontextprotocol#4994's rule that the name is checked before repo_path.
- Anticipated failures (the guards, GitError, gitdb's ODBError, and the
builtins GitPython raises for failed lookups) are raised as ToolError,
so the model still reads their message, now prefixed by MCPServer with
"Error executing tool <name>: ". Anything else is a crash, reported
generically.
- subscriptions=False: the tool list never changes, so the 2026-07-28
capabilities advertise no listChanged. MCPServer always serves empty
prompt and resource lists, so those capabilities now appear.
- Argument validation errors are pydantic's, from MCPServer.
- jsonschema is no longer a direct dependency.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: cliffhall <[email protected]>1 parent 50c6823 commit 916cdc9
10 files changed
Lines changed: 511 additions & 486 deletions
File tree
- src/git
- src/mcp_server_git
- tests
- snapshots
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
109 | 114 | | |
110 | 115 | | |
111 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
0 commit comments