Skip to content

Commit 3f80c40

Browse files
feat: add help info for all commands
1 parent 53ed4ef commit 3f80c40

File tree

11 files changed

+53
-14
lines changed

11 files changed

+53
-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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def remove_pid_file():
7171

7272

7373
@click.group(name="router")
74+
@click.help_option("-h", "--help")
7475
def router():
7576
"""Manage MCP router service."""
7677
pass
@@ -80,10 +81,13 @@ def router():
8081
@click.option("--host", type=str, default="0.0.0.0", help="Host to bind the SSE server to")
8182
@click.option("--port", type=int, default=8080, help="Port to bind the SSE server to")
8283
@click.option("--cors", type=str, help="Comma-separated list of allowed origins for CORS")
84+
@click.help_option("-h", "--help")
8385
def start_router(host, port, cors):
8486
"""Start MCPRouter as a daemon process.
8587
8688
Example:
89+
90+
\b
8791
mcpm router on
8892
mcpm router on --port 8888
8993
mcpm router on --host 0.0.0.0 --port 9000
@@ -143,10 +147,13 @@ def start_router(host, port, cors):
143147

144148

145149
@router.command(name="off")
150+
@click.help_option("-h", "--help")
146151
def stop_router():
147152
"""Stop the running MCPRouter daemon process.
148153
149154
Example:
155+
156+
\b
150157
mcpm router off
151158
"""
152159
# check if there is a router already running
@@ -172,10 +179,13 @@ def stop_router():
172179

173180

174181
@router.command(name="status")
182+
@click.help_option("-h", "--help")
175183
def router_status():
176184
"""Check the status of the MCPRouter daemon process.
177185
178186
Example:
187+
188+
\b
179189
mcpm router status
180190
"""
181191
pid = read_pid_file()

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)