Skip to content

Commit f8115e0

Browse files
committed
feat: add 'new' command as alias for creating server configs
This commit introduces the `mcpm new` command, which functions as a convenient alias for `mcpm edit --new`. This provides a more intuitive and user-friendly way to create new server configurations from scratch. The implementation includes: - A new `new.py` command module. - Integration into the main CLI application (`cli.py`). - Updates to command registration and configuration. Additionally, this commit updates the `GEMINI.md` to consolidate project conventions into `CLAUDE.md`.
1 parent 3692bb8 commit f8115e0

File tree

6 files changed

+30
-10
lines changed

6 files changed

+30
-10
lines changed

GEMINI.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
# Gemini Project Conventions
2-
3-
This file contains conventions that Gemini should follow when working on this project.
4-
5-
- **Formatting:** Always format Python code with `ruff`.
6-
- **Dependency Management:** Use `uv` for all Python dependency management.
7-
- **Committing:** Always double-check with the user before committing changes to git.
1+
Reference `CLAUDE.md` for project conventions.

src/mcpm/cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
install,
2020
list,
2121
migrate,
22+
new,
2223
profile,
2324
run,
2425
search,
@@ -123,6 +124,7 @@ def main(ctx, version, help_flag):
123124
main.add_command(install.install)
124125
main.add_command(uninstall.uninstall)
125126
main.add_command(edit.edit)
127+
main.add_command(new.new)
126128
main.add_command(run.run)
127129
main.add_command(inspect.inspect)
128130
main.add_command(profile.profile, name="profile")

src/mcpm/clients/managers/gemini_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def _get_empty_config(self) -> Dict[str, Any]:
4141
# Include other default settings that Gemini CLI expects
4242
"contextFileName": "GEMINI.md",
4343
"autoAccept": False,
44-
"theme": "Default"
44+
"theme": "Default",
4545
}
4646

4747
def is_client_installed(self) -> bool:

src/mcpm/commands/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"install",
1212
"list",
1313
"migrate",
14+
"new",
1415
"profile",
1516
"run",
1617
"search",
@@ -30,6 +31,7 @@
3031
install,
3132
list,
3233
migrate,
34+
new,
3335
profile,
3436
run,
3537
search,

src/mcpm/commands/new.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""
2+
New command - alias for 'edit -N' to create new server configurations
3+
"""
4+
5+
from mcpm.commands.edit import _create_new_server
6+
from mcpm.utils.rich_click_config import click
7+
8+
9+
@click.command(name="new", context_settings=dict(help_option_names=["-h", "--help"]))
10+
def new():
11+
"""Create a new server configuration.
12+
13+
This is an alias for 'mcpm edit -N' that opens an interactive form to create
14+
a new MCP server configuration. You can create either STDIO servers (local
15+
commands) or remote servers (HTTP/SSE).
16+
17+
Examples:
18+
19+
mcpm new # Create new server interactively
20+
mcpm edit -N # Equivalent command
21+
"""
22+
return _create_new_server()

src/mcpm/utils/rich_click_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def get_header_text():
9292
"main": [ # This matches the function name
9393
{
9494
"name": "Server Management",
95-
"commands": ["search", "info", "install", "uninstall", "ls", "edit", "inspect"],
95+
"commands": ["search", "info", "install", "uninstall", "ls", "edit", "new", "inspect"],
9696
},
9797
{
9898
"name": "Server Execution",
@@ -114,7 +114,7 @@ def get_header_text():
114114
"mcpm": [ # Also support this context name
115115
{
116116
"name": "Server Management",
117-
"commands": ["search", "info", "install", "uninstall", "ls", "edit", "inspect"],
117+
"commands": ["search", "info", "install", "uninstall", "ls", "edit", "new", "inspect"],
118118
},
119119
{
120120
"name": "Server Execution",

0 commit comments

Comments
 (0)