Description
mcp-cli cmd is registered as a typer subcommand (@app.command("cmd") in main.py:1491), but fails at runtime with:
Steps to Reproduce
mcp-cli cmd --server myserver --tool my_tool --tool-args '{"prompt": "Hello"}'
Note: mcp-cli cmd --help works fine (handled by typer before the command body executes).
Root Cause
Inside cmd_command, the function calls cli_execute("cmd", ...) (main.py:1569), which looks up "cmd" in UnifiedCommandRegistry:
# cli.py:187-190
command = cmd_registry.get(command_name, mode=CommandMode.CLI)
if not command:
output.error(f"Unknown command: {command_name}")
return False
The "cmd" command is registered in typer but not in the UnifiedCommandRegistry for CommandMode.CLI, so registry.get("cmd", mode=CommandMode.CLI) returns None.
In main.py:782-789, the code checks if "cmd" exists in the registry but doesn't actually register it — it only logs that it was found:
core_commands = ["cmd", "ping"]
for command_name in core_commands:
cmd = registry.get(command_name, mode=CommandMode.CLI)
if cmd:
registry_registered.append(command_name)
Environment
- mcp-cli version: 0.16
- Python: 3.12
- OS: macOS
Description
mcp-cli cmdis registered as a typer subcommand (@app.command("cmd")inmain.py:1491), but fails at runtime with:Steps to Reproduce
mcp-cli cmd --server myserver --tool my_tool --tool-args '{"prompt": "Hello"}'Note:
mcp-cli cmd --helpworks fine (handled by typer before the command body executes).Root Cause
Inside
cmd_command, the function callscli_execute("cmd", ...)(main.py:1569), which looks up"cmd"inUnifiedCommandRegistry:The
"cmd"command is registered in typer but not in theUnifiedCommandRegistryforCommandMode.CLI, soregistry.get("cmd", mode=CommandMode.CLI)returnsNone.In
main.py:782-789, the code checks if"cmd"exists in the registry but doesn't actually register it — it only logs that it was found:Environment