From 0bce9b4dc1bd2814308c0952b2bb356c04fef893 Mon Sep 17 00:00:00 2001 From: Alpamys Date: Sat, 4 Jul 2026 19:30:18 +0500 Subject: [PATCH] fix(mcp): ASCII-safe help/docstring text across the mcp command Replace em-dashes with hyphens in the mcp module docstring, Typer help, --allow-mutating help, and serve console output; add an ASCII-safety note. Completes the v0.71.28 MCP ASCII cleanup so 'soup mcp --help' also stays cp1252-safe (companion to a108c81). --- src/soup_cli/commands/mcp.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/soup_cli/commands/mcp.py b/src/soup_cli/commands/mcp.py index d11e748..500e446 100644 --- a/src/soup_cli/commands/mcp.py +++ b/src/soup_cli/commands/mcp.py @@ -1,9 +1,12 @@ -"""soup mcp — Model Context Protocol server (v0.71.28). +"""soup mcp - Model Context Protocol server (v0.71.28). ``soup mcp serve`` exposes Soup's read-only commands (plus two plan-only mutating tools) to any MCP client (Claude Code / Cursor / Cline / Continue) over stdio. The heavy ``mcp`` SDK is behind the ``[mcp]`` extra and imported lazily, so this command errors friendly-ly when the extra is missing. + +All user-facing help text stays ASCII (Windows terminal / cp1252 safety; +mirrors the ``test_help_output_is_ascii_safe`` guard). """ from __future__ import annotations @@ -12,7 +15,7 @@ import typer app = typer.Typer( no_args_is_help=True, - help="Model Context Protocol server — drive Soup from any MCP client.", + help="Model Context Protocol server - drive Soup from any MCP client.", ) @@ -23,7 +26,7 @@ def serve( "--allow-mutating", help=( "Enable the plan-only mutating tools (train_start / export). Even " - "when enabled they only render the command that would run — v1 " + "when enabled they only render the command that would run - v1 " "never executes training or export. Off by default: those tools " "refuse." ), @@ -31,7 +34,7 @@ def serve( ) -> None: """Start the stdio MCP server (read-only tools by default). - stdout is the JSON-RPC channel — all human-facing output goes to stderr. + stdout is the JSON-RPC channel - all human-facing output goes to stderr. Wire it into a client, e.g. `.mcp.json`: {"mcpServers": {"soup": {"command": "soup", "args": ["mcp", "serve"]}}} @@ -51,5 +54,7 @@ def serve( raise typer.Exit(1) from None mode = "mutating tools ENABLED (plan-only)" if allow_mutating else "read-only" - console.print(f"[dim]soup mcp serve — stdio transport — {mode}. Waiting for a client...[/]") + console.print( + f"[dim]soup mcp serve - stdio transport - {mode}. Waiting for a client...[/]" + ) run_stdio_server(allow_mutating=allow_mutating)