seconv: add seconv mcp, a Model Context Protocol server over stdio - #14129
Open
ivandrofly wants to merge 1 commit into
Open
seconv: add seconv mcp, a Model Context Protocol server over stdio#14129ivandrofly wants to merge 1 commit into
seconv mcp, a Model Context Protocol server over stdio#14129ivandrofly wants to merge 1 commit into
Conversation
Exposes the conversion engine to MCP clients (Claude Desktop/Code, Cursor, ...) as seven tools - list_formats, subtitle_info, read_subtitle, lint_subtitle, convert_subtitle, list_fix_common_errors_rules, list_remove_formatting_rules - each a thin adapter over the Core helpers the CLI subcommands already use, so behaviour cannot drift between the two entry points. Stdout is reserved for JSON-RPC: Console.Out is redirected to stderr and the converter runs quiet. Tool failures return isError with the real message (unknown operation, missing file, ...) instead of the SDK's generic placeholder; unknown operations are hard errors rather than silent no-ops, like the CLI. Listed in --help, --help-json, the README and the command-line reference. Covered by unit tests per tool plus a stdio round-trip through the MCP client SDK against a spawned `seconv mcp` process. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V1UEPy85BqcK2D9dHgfymB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
seconv mcpruns seconv as an MCP server over stdio, so AI clients (Claude Desktop/Code, Cursor, ...) can inspect and convert subtitles without a shell:{"mcpServers":{"seconv":{"command":"seconv","args":["mcp"]}}}.SubtitleInfoGatherer,SubtitleLinter,SubtitleConverter,FixCommonErrorsRunner, ...), so behaviour cannot drift between the two entry points:list_formats(optional substring filter),subtitle_info,read_subtitle(paged paragraphs of any supported format),lint_subtitleconvert_subtitle— format, output folder/name, encoding, overwrite, offset, fps/targetFps, renumber, duration/gap adjustments, delete first/last/contains,operations, FixCommonErrors / RemoveFormatting rule specs, container track numbers, OCR engine/language,timeCodesOnly, resolutionlist_fix_common_errors_rules,list_remove_formatting_rulesConsole.Outis redirected to stderr and the converter runs quiet; logs go to stderr (--verbosefor debug level).isErrorwith the real message (unknown operation, missing file, ...) rather than the SDK's generic placeholder; unknown operations are hard errors, not silent no-ops, matching the CLI's strict parsing.--jsonoutput.mcpis listed in--help,--help-json, the seconv README anddocs/reference/command-line.md.ModelContextProtocol2.2.0,Microsoft.Extensions.Hosting10.0.11 (no trimming/AOT, so reflection-based tool discovery is unaffected by the single-file publish).Test plan
dotnet build src/seconv/SeConv.csproj— clean, no warningsdotnet test tests/seconv/SeConvTests.csproj— 393/393 pass, including 10 newMcpToolsTestcases (one spawnsdotnet seconv.dll mcp, lists tools via the MCP client SDK, callssubtitle_infoon a fixture and on a missing file)claude mcp add seconv -- <path-to>/seconv mcp, then ask it to describe an.srtand convert it to WebVTT with a 1 s offset — the output file appears and its time codes are shiftedseconv --helpandseconv --help-jsonlistmcpmcpcode path)🤖 Generated with Claude Code
https://claude.ai/code/session_01V1UEPy85BqcK2D9dHgfymB