Skip to content

Commit 4c14c1b

Browse files
niechenclaude
andcommitted
feat: change mcpm edit arguments from CSV to space-separated format
- Updated argument parsing from comma-separated to space-separated - Changed prompts from "Arguments (comma-separated)" to "Arguments (space-separated)" - Modified parsing logic from .split(",") to .split() - Updated table display format to show space-separated arguments - Updated tests to expect space-separated output Fixes #212 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 5d015df commit 4c14c1b

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

src/mcpm/commands/edit.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def edit(server_name, new, editor):
8080

8181
if isinstance(server_config, STDIOServerConfig):
8282
table.add_row("Command", server_config.command)
83-
table.add_row("Arguments", ", ".join(server_config.args) if server_config.args else "[dim]None[/]")
83+
table.add_row("Arguments", " ".join(server_config.args) if server_config.args else "[dim]None[/]")
8484
table.add_row(
8585
"Environment",
8686
", ".join(f"{k}={v}" for k, v in server_config.env.items()) if server_config.env else "[dim]None[/]",
@@ -187,10 +187,10 @@ def interactive_server_edit(server_config) -> Optional[Dict[str, Any]]:
187187
keybindings={"interrupt": [{"key": "escape"}]},
188188
).execute()
189189

190-
# Arguments as comma-separated string
191-
current_args = ", ".join(server_config.args) if server_config.args else ""
190+
# Arguments as space-separated string
191+
current_args = " ".join(server_config.args) if server_config.args else ""
192192
answers["args"] = inquirer.text(
193-
message="Arguments (comma-separated):",
193+
message="Arguments (space-separated):",
194194
default=current_args,
195195
instruction="(Leave empty for no arguments)",
196196
keybindings={"interrupt": [{"key": "escape"}]},
@@ -237,7 +237,7 @@ def interactive_server_edit(server_config) -> Optional[Dict[str, Any]]:
237237

238238
if isinstance(server_config, STDIOServerConfig):
239239
console.print(f"Command: [cyan]{server_config.command}[/] → [cyan]{answers['command']}[/]")
240-
new_args = [arg.strip() for arg in answers["args"].split(",") if arg.strip()] if answers["args"] else []
240+
new_args = answers["args"].split() if answers["args"] else []
241241
console.print(f"Arguments: [cyan]{server_config.args}[/] → [cyan]{new_args}[/]")
242242

243243
new_env = {}
@@ -298,7 +298,7 @@ def apply_interactive_changes(server_config, interactive_result):
298298

299299
# Parse arguments
300300
if answers["args"].strip():
301-
server_config.args = [arg.strip() for arg in answers["args"].split(",") if arg.strip()]
301+
server_config.args = answers["args"].split()
302302
else:
303303
server_config.args = []
304304

@@ -381,9 +381,7 @@ def _create_new_server():
381381
server_config = STDIOServerConfig(
382382
name=server_name,
383383
command=result["answers"]["command"],
384-
args=[arg.strip() for arg in result["answers"]["args"].split(",") if arg.strip()]
385-
if result["answers"]["args"]
386-
else [],
384+
args=result["answers"]["args"].split() if result["answers"]["args"] else [],
387385
env={},
388386
)
389387

@@ -462,7 +460,7 @@ def _interactive_new_server_form() -> Optional[Dict[str, Any]]:
462460
).execute()
463461

464462
answers["args"] = inquirer.text(
465-
message="Arguments (comma-separated):",
463+
message="Arguments (space-separated):",
466464
instruction="(Leave empty for no arguments)",
467465
keybindings={"interrupt": [{"key": "escape"}]},
468466
).execute()
@@ -497,7 +495,7 @@ def _interactive_new_server_form() -> Optional[Dict[str, Any]]:
497495

498496
if answers["type"] == "stdio":
499497
console.print(f"Command: [cyan]{answers['command']}[/]")
500-
new_args = [arg.strip() for arg in answers["args"].split(",") if arg.strip()] if answers["args"] else []
498+
new_args = answers["args"].split() if answers["args"] else []
501499
console.print(f"Arguments: [cyan]{new_args}[/]")
502500

503501
new_env = {}

tests/test_edit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_edit_server_interactive_fallback(monkeypatch):
4444
assert result.exit_code == 0 # CliRunner may not properly handle our return codes
4545
assert "Current Configuration for 'test-server'" in result.output
4646
assert "test-cmd" in result.output
47-
assert "arg1, arg2" in result.output
47+
assert "arg1 arg2" in result.output
4848
assert "KEY=value" in result.output
4949
assert "test-profile" in result.output
5050
assert "Interactive editing not available" in result.output

0 commit comments

Comments
 (0)