Skip to content
This repository was archived by the owner on Oct 7, 2026. It is now read-only.
This repository was archived by the owner on Oct 7, 2026. It is now read-only.

mcp-cli cmd fails with "Unknown command: cmd" #226

Description

@axisrow

Description

mcp-cli cmd is registered as a typer subcommand (@app.command("cmd") in main.py:1491), but fails at runtime with:

✗ Unknown command: cmd

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

Activity

  1. added a commit that references this issue on Feb 28, 2026
    0ac45be
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions