Add hardened seconv MCP stdio server - #110
Conversation
7a691fc to
dbca266
Compare
dbca266 to
946a7f0
Compare
Blackspirits
left a comment
There was a problem hiding this comment.
Independent adversarial re-check: this branch is exactly one MCP/docs/tests commit on the final #109 cancellation/concurrency base. The stdio transport uses Console.OpenStandardOutput directly, so redirecting incidental Console.Out writes to stderr does not corrupt JSON-RPC. Pre-dispatch bootstrap/HarfBuzz initialization does not write stdout. Client-visible tools/list annotations, cancellation-token schema exclusion, sanitized missing-file errors, cancellation-before-write and an end-to-end stdio tool call are covered by tests. Full CI #34795072886 passed restore, build and the complete suite on the first run; SeConvTests reported 498 passed, 2 skipped, 0 failed and UITests 5,151 passed, 9 skipped, 0 failed. Retry was not used. No blocker identified. Keep draft; no merge performed.
Purpose
Current-base audited port of upstream PR SubtitleEdit#14129 (
seconv mcp), stacked on draft #109.The original PR was based on
adbc446a...and is now more than 1,000 upstream commits behind. Its MCP surface still maps cleanly onto current seconv, but a literal port would miss important long-lived-server concerns and would overstate parity with the much-expanded current CLI.What this PR adds
seconv mcpstdio server usingModelContextProtocol2.2.0;Microsoft.Extensions.Hosting10.0.12;list_formatssubtitle_inforead_subtitlelint_subtitleconvert_subtitlelist_fix_common_errors_ruleslist_remove_formatting_rules--help-json, README and current command-line reference updated.Hardening vs. SubtitleEdit#14129
CancellationTokenis accepted explicitly and is therefore bound by the SDK without appearing in tool input schemas;ReadOnly=true,Destructive=false,Idempotent=true,OpenWorld=false;convert_subtitleexplicitly advertisesReadOnly=false,Destructive=true,Idempotent=false,OpenWorld=false;--json;Filesystem boundary
The server operates on explicit local filesystem paths and does not add a second sandbox. Access remains limited by the OS permissions of the
seconvprocess and by the MCP client's own approval/sandbox policy. MCP roots were considered, but roots are deprecated in the 2026-07-28 protocol revision, so this port does not build a security contract on that retiring mechanism.Tests
The original functional coverage is retained and extended to verify:
tools/list;CancellationTokenis absent from generated input schemas;Stack / validation
f83e30793665214f054f411feb0c2254b8b68d8a946a7f00f19a91fcd4303a224ff169d4b771b75eAI assistance: ChatGPT was used to audit and port the stale MCP proposal, reconcile it with current seconv behavior, and add cancellation, concurrency, metadata and error-boundary hardening.