MCPcopy Create free account
hub / github.com/IBM/mcp-cli / HelpCommand

Class HelpCommand

src/mcp_cli/commands/core/help.py:19–189  ·  view source on GitHub ↗

Show help information for commands.

Source from the content-addressed store, hash-verified

17
18
19class HelpCommand(UnifiedCommand):
20 """Show help information for commands."""
21
22 @property
23 def name(self) -> str:
24 return "help"
25
26 @property
27 def aliases(self) -> list[str]:
28 return ["h", "?"]
29
30 @property
31 def description(self) -> str:
32 return "Show help information for commands"
33
34 @property
35 def help_text(self) -> str:
36 return """
37Show help information for available commands.
38
39Usage:
40 /help [command] - Show help (chat mode)
41 help [command] - Show help (interactive mode)
42 mcp-cli help - Show help (CLI mode)
43
44Examples:
45 /help - List all commands
46 /help servers - Show detailed help for servers command
47 help tools - Show help for tools command
48"""
49
50 @property
51 def parameters(self) -> list[CommandParameter]:
52 return [
53 CommandParameter(
54 name="command",
55 type=str,
56 required=False,
57 help="Command to get help for",
58 ),
59 ]
60
61 @property
62 def requires_context(self) -> bool:
63 """Help doesn't need tool manager context."""
64 return False
65
66 async def execute(self, **kwargs) -> CommandResult:
67 """Execute the help command."""
68 command_name = kwargs.get("command") or kwargs.get("args")
69
70 # Handle list arguments
71 if isinstance(command_name, list):
72 command_name = command_name[0] if command_name else None
73
74 # Get the registry singleton instance
75 registry = UnifiedCommandRegistry()
76

Callers 7

register_all_commandsFunction · 0.90
help_commandFunction · 0.90
setupMethod · 0.90
commandMethod · 0.90
initialize_commandsFunction · 0.90

Calls

no outgoing calls

Tested by 5

help_commandFunction · 0.72
setupMethod · 0.72
commandMethod · 0.72