From 3886159d0cbd53e2884c51eff32533face180ef4 Mon Sep 17 00:00:00 2001 From: epolat Date: Fri, 3 Jul 2026 23:49:37 +0300 Subject: [PATCH] fix(git): handle JSON-RPC errors gracefully instead of crashing mcp-server-git passed raise_exceptions=True to server.run(), so a malformed or deeply-nested JSON-RPC message (e.g. params nested past pydantic-core's recursion limit) crashed the process with exit code 1 instead of returning a JSON-RPC error and continuing to serve. Set raise_exceptions=False to match the SDK default and the other reference servers (fetch, time, sqlite). This is the identical fix already merged for mcp-server-fetch in #3515. Fixes #4213. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/git/src/mcp_server_git/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/git/src/mcp_server_git/server.py b/src/git/src/mcp_server_git/server.py index 84188d8fd7..bef4b21734 100644 --- a/src/git/src/mcp_server_git/server.py +++ b/src/git/src/mcp_server_git/server.py @@ -599,4 +599,4 @@ async def call_tool(name: str, arguments: dict) -> list[TextContent]: options = server.create_initialization_options() async with stdio_server() as (read_stream, write_stream): - await server.run(read_stream, write_stream, options, raise_exceptions=True) + await server.run(read_stream, write_stream, options, raise_exceptions=False)