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).
This commit is contained in:
Alpamys 2026-07-04 19:30:18 +05:00
parent a108c8183b
commit 0bce9b4dc1
1 changed files with 10 additions and 5 deletions

View File

@ -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)