Skip to content

Commit 01a0a87

Browse files
feat: add help info for all commands
1 parent 35141e2 commit 01a0a87

File tree

11 files changed

+54
-14
lines changed

11 files changed

+54
-14
lines changed

src/mcpm/cli.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,10 @@ def main(ctx, help_flag):
126126
commands_table.add_row("[yellow]server[/]")
127127
commands_table.add_row(" [cyan]search[/]", "Search available MCP servers.")
128128
commands_table.add_row(" [cyan]add[/]", "Add an MCP server directly to a client.")
129-
commands_table.add_row(" [cyan]cp[/]")
130-
commands_table.add_row(" [cyan]copy[/]", "Copy a server from one client/profile to another.")
131-
commands_table.add_row(" [cyan]mv[/]")
132-
commands_table.add_row(" [cyan]move[/]", "Move a server from one client/profile to another.")
133-
commands_table.add_row(" [cyan]rm[/]")
134-
commands_table.add_row(" [cyan]remove[/]", "Remove an installed MCP server.")
135-
commands_table.add_row(" [cyan]ls[/]")
136-
commands_table.add_row(" [cyan]list[/]", "List all installed MCP servers.")
129+
commands_table.add_row(" [cyan]cp[/]", "Copy a server from one client/profile to another.")
130+
commands_table.add_row(" [cyan]mv[/]", "Move a server from one client/profile to another.")
131+
commands_table.add_row(" [cyan]rm[/]", "Remove an installed MCP server.")
132+
commands_table.add_row(" [cyan]ls[/]", "List all installed MCP servers.")
137133
commands_table.add_row(" [cyan]stash[/]", "Temporarily store a server configuration aside.")
138134
commands_table.add_row(" [cyan]pop[/]", "Restore a previously stashed server configuration.")
139135

@@ -152,15 +148,13 @@ def main(ctx, help_flag):
152148

153149
# Additional helpful information
154150
console.print("")
155-
console.print("[italic]Run [bold]mcpm -h[/] for more information on a command.[/]")
151+
console.print("[italic]Run [bold]mcpm COMMAND -h[/] for more information on a command.[/]")
156152

157153

158154
# Register commands
159155
main.add_command(search.search)
160-
main.add_command(remove.remove)
161156
main.add_command(remove.remove, name="rm")
162157
main.add_command(add.add)
163-
main.add_command(list.list)
164158
main.add_command(list.list, name="ls")
165159

166160
main.add_command(stash.stash)
@@ -170,9 +164,7 @@ def main(ctx, help_flag):
170164
main.add_command(config.config)
171165
main.add_command(inspector.inspector, name="inspector")
172166
main.add_command(profile.profile, name="profile")
173-
main.add_command(transfer.move)
174167
main.add_command(transfer.move, name="mv")
175-
main.add_command(transfer.copy)
176168
main.add_command(transfer.copy, name="cp")
177169
main.add_command(profile.activate)
178170
main.add_command(profile.deactivate)

src/mcpm/commands/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313

1414
@click.group()
15+
@click.help_option("-h", "--help")
1516
def config():
1617
"""Manage MCPM configuration.
1718
@@ -21,6 +22,7 @@ def config():
2122

2223

2324
@config.command()
25+
@click.help_option("-h", "--help")
2426
def clear_cache():
2527
"""Clear the local repository cache.
2628

src/mcpm/commands/list.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@
1919

2020
@click.command(name="list")
2121
@click.option("--target", "-t", help="Target to list servers from")
22+
@click.help_option("-h", "--help")
2223
def list(target: str | None = None):
2324
"""List all installed MCP servers.
2425
2526
Examples:
27+
28+
\b
2629
mcpm list
27-
mcpm list -t <scope>
30+
mcpm list -t @cursor
2831
"""
2932
if target is None:
3033
target = ClientRegistry.determine_active_scope()

src/mcpm/commands/profile.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212

1313
@click.group()
14+
@click.help_option("-h", "--help")
1415
def profile():
1516
"""Manage MCPM profiles."""
1617
pass
@@ -19,6 +20,7 @@ def profile():
1920
@click.command()
2021
@click.argument("profile_name")
2122
@click.option("--client", "-c", default="client", help="Client of the profile")
23+
@click.help_option("-h", "--help")
2224
def activate(profile_name, client):
2325
"""Activate a profile.
2426
@@ -41,6 +43,7 @@ def activate(profile_name, client):
4143

4244
@click.command()
4345
@click.option("--client", "-c", default="client", help="Client of the profile")
46+
@click.help_option("-h", "--help")
4447
def deactivate(client):
4548
"""Deactivate a profile.
4649
@@ -63,6 +66,7 @@ def deactivate(client):
6366

6467
@profile.command(name="ls")
6568
@click.option("--verbose", "-v", is_flag=True, help="Show detailed server information")
69+
@click.help_option("-h", "--help")
6670
def list(verbose=False):
6771
"""List all MCPM profiles."""
6872
profiles = profile_config_manager.list_profiles()
@@ -93,6 +97,7 @@ def list(verbose=False):
9397
@profile.command()
9498
@click.argument("profile")
9599
@click.option("--force", is_flag=True, help="Force add even if profile already exists")
100+
@click.help_option("-h", "--help")
96101
def add(profile, force=False):
97102
"""Add a new MCPM profile."""
98103
if profile_config_manager.get_profile(profile) is not None and not force:
@@ -112,6 +117,7 @@ def add(profile, force=False):
112117
@profile.command()
113118
@click.argument("profile")
114119
@click.option("--server", "-s", required=True, help="Server to apply config to")
120+
@click.help_option("-h", "--help")
115121
def apply(profile, server):
116122
"""Apply an existing MCPM config to a profile."""
117123
client_manager = ClientRegistry.get_active_client_manager()
@@ -147,6 +153,7 @@ def apply(profile, server):
147153

148154
@profile.command()
149155
@click.argument("profile_name")
156+
@click.help_option("-h", "--help")
150157
def remove(profile_name):
151158
"""Delete an MCPM profile."""
152159
if not profile_config_manager.delete_profile(profile_name):
@@ -157,6 +164,7 @@ def remove(profile_name):
157164

158165
@profile.command()
159166
@click.argument("profile_name")
167+
@click.help_option("-h", "--help")
160168
def rename(profile_name):
161169
"""Rename an MCPM profile."""
162170
new_profile_name = click.prompt("Enter new profile name", type=str)

src/mcpm/commands/router.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,20 @@ def remove_pid_file():
121121

122122

123123
@click.group(name="router")
124+
@click.help_option("-h", "--help")
124125
def router():
125126
"""Manage MCP router service."""
126127
pass
127128

128129

129130
@router.command(name="on")
131+
@click.help_option("-h", "--help")
130132
def start_router():
131133
"""Start MCPRouter as a daemon process.
132134
133135
Example:
136+
137+
\b
134138
mcpm router on
135139
"""
136140
# check if there is a router already running
@@ -190,6 +194,7 @@ def start_router():
190194
@router.command(name="set")
191195
@click.option("-H", "--host", type=str, help="Host to bind the SSE server to")
192196
@click.option("-p", "--port", type=int, help="Port to bind the SSE server to")
197+
@click.help_option("-h", "--help")
193198
def set_router_config(host, port):
194199
"""Set MCPRouter global configuration.
195200
@@ -224,10 +229,13 @@ def set_router_config(host, port):
224229

225230

226231
@router.command(name="off")
232+
@click.help_option("-h", "--help")
227233
def stop_router():
228234
"""Stop the running MCPRouter daemon process.
229235
230236
Example:
237+
238+
\b
231239
mcpm router off
232240
"""
233241
# check if there is a router already running
@@ -253,10 +261,13 @@ def stop_router():
253261

254262

255263
@router.command(name="status")
264+
@click.help_option("-h", "--help")
256265
def router_status():
257266
"""Check the status of the MCPRouter daemon process.
258267
259268
Example:
269+
270+
\b
260271
mcpm router status
261272
"""
262273
# get router config

src/mcpm/commands/search.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@
1515
@click.command()
1616
@click.argument("query", required=False)
1717
@click.option("--detailed", is_flag=True, help="Show detailed server information")
18+
@click.help_option("-h", "--help")
1819
def search(query, detailed=False):
1920
"""Search available MCP servers.
2021
2122
Searches the MCP registry for available servers. Without arguments, lists all available servers.
2223
2324
Examples:
25+
26+
\b
2427
mcpm search # List all available servers
2528
mcpm search github # Search for github server
2629
mcpm search --detailed # Show detailed information

src/mcpm/commands/server_operations/add.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,13 @@
2929
@click.option("--force", is_flag=True, help="Force reinstall if server is already installed")
3030
@click.option("--alias", help="Alias for the server", required=False)
3131
@click.option("--target", "-t", help="Target to add server to", required=False)
32+
@click.help_option("-h", "--help")
3233
def add(server_name, force=False, alias=None, target: str | None = None):
3334
"""Add an MCP server to a client configuration.
3435
3536
Examples:
37+
38+
\b
3639
mcpm add time
3740
mcpm add everything --force
3841
mcpm add youtube --alias yt

src/mcpm/commands/server_operations/pop.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,18 @@
2020

2121
@click.command()
2222
@click.argument("server_name")
23+
@click.help_option("-h", "--help")
2324
def pop(server_name):
2425
"""Restore a previously stashed server configuration.
2526
2627
This command re-enables a previously stashed (disabled) server,
2728
restoring it to active status.
2829
2930
Examples:
31+
32+
\b
3033
mcpm pop memory
34+
mcpm pop %profile/memory
3135
"""
3236
scope_type, scope, server_name = determine_target(server_name)
3337
if not scope_type or not scope or not server_name:

src/mcpm/commands/server_operations/remove.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@
2222
@click.command()
2323
@click.argument("server_name")
2424
@click.option("--force", is_flag=True, help="Force removal without confirmation")
25+
@click.help_option("-h", "--help")
2526
def remove(server_name, force):
2627
"""Remove an installed MCP server.
2728
2829
Examples:
30+
31+
\b
2932
mcpm rm filesystem
3033
mcpm rm @cursor/filesystem
3134
mcpm rm %profile/filesystem

src/mcpm/commands/server_operations/stash.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,19 @@
2222

2323
@click.command()
2424
@click.argument("server_name")
25+
@click.help_option("-h", "--help")
2526
def stash(server_name):
2627
"""Temporarily store a server configuration aside.
2728
2829
This command disables an active server without removing it, storing its
2930
configuration for later use. You can restore it with the 'pop' command.
3031
3132
Examples:
33+
34+
\b
3235
mcpm stash memory
36+
mcpm stash @cursor/memory
37+
mcpm stash %profile/memory
3338
"""
3439
scope_type, scope, server_name = determine_target(server_name)
3540
if not scope_type or not scope or not server_name:

0 commit comments

Comments
 (0)