mcp-server-git fails to start: 'Server' object has no attribute 'list_tools'
After a fresh install, mcp-server-git crashes on startup with
AttributeError: 'Server' object has no attribute 'list_tools'(Python 3.13, macOS). It happens when runninguvx -n mcp-server-git, which installs the latest MCP Python SDK. The break appeared after the MCP SDK v2 release — how do you pin it to v1 or fix the server?Originally asked on GitHub: https://github.com/modelcontextprotocol/servers/issues/4580
4 answers
No fixed release is mentioned in the thread; the issue is closed as completed after the root cause was explained and a workaround was confirmed. The crash happens because
mcp-server-gitdeclares its dependency asmcp>=1.0.0, so a fresh install resolves MCP Python SDK v2, which removed the decorator-based handler API (@server.list_tools(),@server.call_tool()) thatmcp_server_git/server.pystill uses. That is why startup fails withAttributeError: 'Server' object has no attribute 'list_tools'under Python 3.13.Confirmed workaround from comment 1: force uvx to install the v1 SDK by adding a
--withconstraint in your MCP client config for the server:json"args": ["--with", "mcp<2", "mcp-server-git"]The thread reports this worked (
IT WORKED FOR ME). Two permanent fixes are suggested for the package maintainers:- Quick fix: pin the dependency, e.g. change
mcp>=1.0.0tomcp~=1.0.0(compatible-release specifier, per the Python packaging documentation) so only v1 point releases are allowed. - Proper fix: migrate
server.pyto the SDK v2 API, which useson_*constructor parameters instead of decorators.
General advice: if you maintain any MCP server, pin the MCP SDK with a compatible-release constraint so an upstream v2 release does not break your server on the next fresh install.
Did this work for you?- Quick fix: pin the dependency, e.g. change
What @prasadsamudralavss tried on GitHub (Worked)
Pin the MCP SDK to v1 by configuring the server args as
["--with", "mcp<2", "mcp-server-git"]so uvx installs a compatible SDK. The commenter reported it worked.Did this work for you?What a GitHub user tried on GitHub (Didn't work)
Reproduced the failure on a fresh install with
uvx -n mcp-server-git; the server crashed at startup withAttributeError: 'Server' object has no attribute 'list_tools'.Source: https://github.com/modelcontextprotocol/servers/issues/4580 (opens external site)
Did this work for you?What @AaronAsAChimp tried on GitHub (Outcome unclear)
Suggested changing the package's dependency from
mcp>=1.0.0tomcp~=1.0.0(compatible-release specifier) to prevent the upstream v2 break. Not tested in the thread, since it requires a package-side change.Did this work for you?
Related questions
- mcp-server-fetch: 'AnyUrl' object has no attribute 'decode' error
- Does the official MCP Postgres example validate SQL before executing it?
- How to fix UTF-8 Japanese text corruption/crash in mcp-server-sqlite with Claude Desktop on Windows?
- MCP Knowledge Graph Memory Server fails with ${workspaceFolder} in MEMORY_FILE_PATH
- npx @modelcontextprotocol/server-filesystem: ERR_MODULE_NOT_FOUND for zod-to-json-schema