[General]: `mcpm add` with `@claude-desktop` as the active client raises a `TypeError`
Closed this issue · 1 comments
starbased-co commented
Issue Type
Bug Report
Description
Installed mcpm using uv tool install mcpm on Linux. When running mcpm add as described below, the following error occurs:
mcpm add %think
WARNING:mcpm.clients.managers.trae:Trae is not supported on Linux yet.
Working on Active Client: claude-desktop
Add this profile think to claude-desktop? [y/n]: y
Traceback (most recent call last):
File "/home/starbased/.local/bin/mcpm", line 10, in <module>
sys.exit(main())
^^^^^^
File "/home/starbased/.local/share/uv/tools/mcpm/lib/python3.12/site-packages/click/core.py", line 1442,
in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/starbased/.local/share/uv/tools/mcpm/lib/python3.12/site-packages/click/core.py", line 1363,
in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/starbased/.local/share/uv/tools/mcpm/lib/python3.12/site-packages/click/core.py", line 1830,
in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/starbased/.local/share/uv/tools/mcpm/lib/python3.12/site-packages/click/core.py", line 1226,
in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/starbased/.local/share/uv/tools/mcpm/lib/python3.12/site-packages/click/core.py", line 794,
in invoke
return callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/starbased/.local/share/uv/tools/mcpm/lib/python3.12/site-packages/mcpm/commands/target_opera
add_profile_to_client(server_name.lstrip(PROFILE_PREFIX), client, alias, force)
File "/home/starbased/.local/share/uv/tools/mcpm/lib/python3.12/site-packages/mcpm/commands/target_opera
tions/add.py", line 530, in add_profile_to_client
success = client_add_profile(profile_name, client, alias)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/starbased/.local/share/uv/tools/mcpm/lib/python3.12/site-packages/mcpm/commands/target_opera
tions/common.py", line 125, in client_add_profile
success = client_manager.activate_profile(profile_name, router_config, alias_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/starbased/.local/share/uv/tools/mcpm/lib/python3.12/site-packages/mcpm/clients/base.py", lin
e 425, in activate_profile
server_config = self._format_router_server(profile_name, default_base_url, alias_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ClaudeDesktopManager._format_router_server() takes 3 positional arguments but 4 were givenNotably, this only occurs using the mcpm add command. mcpm cp is able to add to modify claude desktop's mcp config successfully
Steps to Reproduce
mcpm target set claude-desktop
mcpm add %profilename @claude-desktopor
mcpm add %think --target @claude-desktopAdditional Information
No response
github-actions commented
Fixed mcpm add crash for the @claude-desktop client.
Key points:
• Root cause
ClaudeDesktopManager._format_router_server()accepted only two parameters, butJSONClientManager.activate_profile()passes three (profile_name,base_url,alias_name). This mismatch raisedTypeError.
• Fix implemented
- Updated the method signature in
src/mcpm/clients/managers/claude_desktop.pyto
_format_router_server(self, profile_name, base_url, alias_name: str | None = None) - Forwarded the optional
alias_nametoformat_server_url_with_proxy_headers.
Result: mcpm add … @claude-desktop now works without raising the TypeError.