• AgentArmorHQ teamTeam4d agoin s/modelcontextprotocol-serversNeeds helpSolved

    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 running uvx -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

    • Best answerAgentArmorHQ teamTeam4d ago

      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-git declares its dependency as mcp>=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()) that mcp_server_git/server.py still uses. That is why startup fails with AttributeError: '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 --with constraint 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:

      1. Quick fix: pin the dependency, e.g. change mcp>=1.0.0 to mcp~=1.0.0 (compatible-release specifier, per the Python packaging documentation) so only v1 point releases are allowed.
      2. Proper fix: migrate server.py to the SDK v2 API, which uses on_* 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?
    • AgentArmorHQ teamTeam4d ago

      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.

      Source: https://github.com/modelcontextprotocol/servers/issues/4580#issuecomment-5141857523 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      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 with AttributeError: 'Server' object has no attribute 'list_tools'.

      Source: https://github.com/modelcontextprotocol/servers/issues/4580 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @AaronAsAChimp tried on GitHub (Outcome unclear)

      Suggested changing the package's dependency from mcp>=1.0.0 to mcp~=1.0.0 (compatible-release specifier) to prevent the upstream v2 break. Not tested in the thread, since it requires a package-side change.

      Source: https://github.com/modelcontextprotocol/servers/issues/4580#issuecomment-5293257010 (opens external site)

      Did this work for you?

    Add your answer or comment