subtitle-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@subtitle-mcp Movie.srt is 3 seconds late, fix the timing"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
subtitle-mcp
Everyday subtitle work for your AI agent: look inside, fix timing, repair, convert and translate SRT, WebVTT and ASS files. Offline, no API keys, nothing to install beyond mcp.
What is different about it: the other subtitle MCP servers I found (mcp-subtitle for AI transcription and Google-Cloud translation, tvsub-mcp for a macOS Apple TV overlay) are built around calling a transcription or translation service. subtitle-mcp is the opposite: it never calls anything. It is the toolbox for the files themselves, with exact arithmetic (a resync is an exact least-squares line over fractions, 29.97 fps really is 30000/1001), a repair tool that shows every change as a dry run first, an explicit encoding heuristic that is honest about what it cannot tell (Turkish cp1254 works), and a translation contract where your agent is the translator and the server guarantees nothing is lost on the way back in.
What it looks like
Real output on a deliberately damaged file (BOM, mixed CRLF/LF, duplicate and missing indices, a blank line inside a cue, an unreadably fast cue, one cue past hour 99):
> fix_common_problems messy.srt
Would apply 8 kind(s) of fix to messy.srt (8 cues -> 8):
- [bom] byte order mark will not be written (output is UTF-8 without BOM by default)
- [mixed_newlines] all line endings normalised to LF (the most common one in the file)
- [blank_line_in_cue] removed blank lines inside 1 cue(s)
cue 4
- [out_of_order] re-sorted cues by start time (1 cue(s) were out of order)
cue 3 started before the cue above it
- [bad_duration] gave 1 zero/negative-length cue(s) a readable duration (1-7 s at 15 chars/s, never past the next cue)
cue 2: end 00:00:03,500 -> 00:00:04,633
- [overlap] trimmed 3 cue(s) that overlapped the next one
cue 1: end 00:00:03,000 -> 00:00:02,000 (cue 3 starts)
...
- [long_line] re-wrapped 2 cue(s) to at most 42 characters per line
- [renumber] cues renumbered 1..N (missing, duplicate indices)
Flagged, not changed:
- [reading_speed] 2 cue(s) read faster than 25 chars/s (not changed; shorten the text or extend the timing)
cue 7: 110.0 chars/s
Dry run: nothing written. Call again with apply=true to write messy.fixed.srt.A subtitle that drifts (1.001x too slow) and starts 2.5 s late, fixed with two anchors:
> resync bad.srt anchors=[{"cue": 1, "to": "00:00:12,510"}, {"cue": 4, "to": "01:40:08,500"}]
Fitted new = 1.001000000 * old + 2500.000 ms (exact: a = 1001/1000, b = 2500 ms)
Two anchors define the line exactly.
Error at each anchor after rounding to whole ms (applied - wanted): +0 ms, +0 ms; largest 0 ms.
Retimed 4 cue(s): first start 00:00:10,000 -> 00:00:12,510, last end 01:40:01,000 -> 01:40:09,501.Related MCP server: whisper-mcp
Install
Needs uv. Point --dir at the folder with your videos and subtitles.
Claude Code
claude mcp add subtitle -- uvx subtitle-mcp --dir "/path/to/your/videos"Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"subtitle": {
"command": "uvx",
"args": ["subtitle-mcp", "--dir", "C:\\Users\\you\\Videos"]
}
}
}Or pip install subtitle-mcp and use the subtitle-mcp command.
Try asking
"What's wrong with
Movie.srt? Show me the problems and the reading speed.""The subtitles in
Movie.srtare 3 seconds late. Fix them.""They start in sync but drift: the line 'We have to go back' (cue 12) should be at 00:06:41,300 and 'It was never about the money' (cue 1304) at 01:48:12,900. Resync it."
"This Turkish file looks garbled. Detect the encoding and convert it to UTF-8."
"Convert
episode.assto SRT.""Clean up
old.srt: show me what you would fix first, then do it and strip the font tags.""Find every cue where someone says 'password' and give me the timestamps."
"Join
CD1.srtandCD2.srtinto one file, and split the result at 01:12:00.""Translate
Movie.srtinto Turkish." (the agent callschunk_for_translation, translates each chunk itself, thenapply_translation)"My video is 23.976 fps and this subtitle was made for 25 fps. Convert it."
Tools
Tool | What it does |
| Format, detected encoding (with the reason), line endings, cue count, time span, overlaps, gaps, longest line, reading speed (chars/sec min/mean/median/p95/max), and a problem list with cue numbers. |
| Show cues by number range or time window, with a cap. |
| Find cues by text or regex, with cue numbers and timestamps. Matches across line breaks. |
| Constant offset in ms, or in frames at a frame rate (29.97 is exact). Optionally only from a given cue on. |
| Two or more anchors fix offset and drift (exact least squares, residual reported); or |
| srt, vtt, and ass-to-either; also re-encodes (cp1254 to UTF-8, to UTF-16, ...). Lists what could not be carried over. |
| Dry run by default. Overlaps, zero/negative durations, ordering, indices, blank lines in cues, BOM, mixed line endings, long lines (balanced re-wrap), optional tag stripping. Reading-speed outliers are flagged, never changed. |
| Merge two files with an offset (default: second after first), or split at a time with re-zeroing. |
| Numbered cue batches with stable IDs. |
| Takes |
Cue numbers everywhere are the 1-based position of the cue in the file.
The translation contract
The server never translates. chunk_for_translation(path, max_chars) returns
{"id": "12", "text": "..."} records (one chunk per call; chunk=2, 3, ...). Your agent
translates and sends one mapping {"12": "..."} to apply_translation. Missing or unknown IDs
fail with the list of offenders; partial=true keeps untranslated cues as they are. Timing is
never touched, and tags such as <i> and {\an8} that appear in the source but not in the
translation are reported.
Formats and limits (read this)
SRT and WebVTT are read and written fully. The parser is tolerant (missing, duplicate or out-of-order indices; index separated from timing by a blank line; blank lines inside cues;
.or,milliseconds; hours over 99; cues glued together; SRTX1:..coordinates; WebVTT header metadata, NOTE/STYLE/REGION blocks, identifiers, cue settings). Everything it had to guess is listed underparse_warningsinsubtitle_info.ASS/SSA is read-only: timing and text are extracted (tags stripped,
\Nbecomes a line break) and can be converted to SRT/VTT. Styling is dropped: fonts, colours, positions, effects, karaoke, drawings. The tools say so. Editing tools refuse ASS and tell you to convert first.Converting SRT to WebVTT drops SRT coordinates; WebVTT to SRT drops cue settings and NOTE/STYLE/REGION blocks. Blank lines inside a cue are removed on write, because both formats end a cue at a blank line.
Encoding detection is a heuristic, and an honest one (the full rules are in
src/subtitle_mcp/encoding.py): BOMs and UTF-16 are certain; valid UTF-8 is trusted; otherwise Turkish letters (Ğ İ Ş ğ ı ş) select cp1254, letters between letters in the 0xA1-0xBF range select iso-8859-2, and anything else is cp1252. It will not guess between Cyrillic/Greek code pages (it errors and asks forencoding=), cannot tell iso-8859-1 from -15, and a Turkish file with none of its six special letters is read as cp1252, which decodes identically. If text looks wrong, passencoding=to any tool. Output is UTF-8 unless you chooseoutput_encoding; characters the target cannot hold are an error, not?.Resync assumes a straight line (constant offset plus constant speed ratio). A film cut with a scene removed in the middle needs
merge_or_splitplus two resyncs.Line wrapping counts visible characters (tags excluded) and never splits a word, so a word longer than the limit stays on its own over-long line (and is flagged).
Security
Local files only, no network access, no subprocesses, no dependency beyond
mcp.--dir DIR(repeatable) confines every read and write to those folders;..and symlinks are resolved before checking. Relative paths resolve against the first--dir. Without--dirany path the user account can reach is allowed, so set it.Only
.srt .vtt .ass .ssafiles can be read and only.srt .vttwritten, so the tools cannot be steered into overwriting other files.Nothing is overwritten unless
overwrite=true; edits go to a new sibling file by default (movie.shifted.srt,movie.fixed.srt, ...). Writes are atomic (temp file in the same folder, then replace), and a failed write leaves the destination untouched.Input is capped at 64 MiB. A pathological regular expression passed to
search_subtitlesruns unguarded (Pythonre), as with any local tool.
Tests
pip install ".[test]" "ruff==0.16.0" "mypy==2.3.0"
ruff check src tests && mypy --strict src
pytest testsReal-world-like messy fixtures (including cp1254 Turkish, UTF-16, iso-8859-2) with exact expected output, 2,400 generated parse/write round-trips, hand-checked resync math, a real MCP stdio session against the installed server, and ffmpeg as an independent oracle (it produces ASS for the parser, and re-reads the files we write). The oracle tests skip when ffmpeg is not installed.
Want to learn how it works? subtitle-mcp-the-hard-way rebuilds a minimal version in seven runnable modules.
License
MIT
Available Tools
10 toolsapply_translationA
Step 2 of translating a subtitle: write the translated file. Timing, cue order, WebVTT
identifiers/settings/notes are kept exactly; only the text changes. Every id of the file
must be present in mapping (otherwise the call fails and lists the missing ids; partial=true
keeps untranslated cues as they are). Warnings are reported for translations that are
empty, much longer or shorter than the source, that lose or change formatting tags, or that
would read too fast.
Args: path: the SAME file given to chunk_for_translation. mapping: {"1": "translated text", "2": "..."}; keys are the ids from chunk_for_translation. output: where to write (default: .translated.). overwrite: allow replacing an existing output file (default false). partial: allow a mapping that does not cover every cue. encoding: force the input text encoding. output_encoding: encoding of the written file (default utf-8; use utf-8 for non-Latin target languages).
Inputs: path (required), mapping (required), output, partial, +3 more. Returns: result
chunk_for_translationA
Step 1 of translating a subtitle. Returns one batch of cues as JSON: each cue has a stable
id (its 1-based position in the file) and its text (line breaks as \n, tags included).
The server never translates: YOU translate the texts, then call apply_translation with a
mapping {"": ""} covering every id of the file.
Rules for the translation: keep every id; keep formatting tags such as and {\an8} exactly; keep line breaks (\n) where they make sense; keep it about as long as the original (subtitles are read against a clock). The response says how many chunks exist; call again with chunk=2, 3, ... until all are done, then send ONE mapping with all ids.
Args: path: .srt or .vtt file. max_chars: approximate size of a batch in characters of cue text (default 1500, min 200). chunk: which batch to return, starting at 1. encoding: force the input text encoding.
Inputs: path (required), chunk, encoding, max_chars. Returns: result
convertA
Convert between SRT and WebVTT, turn an ASS/SSA file into SRT or VTT, or just re-encode a file (same format in and out, for example cp1254 Turkish -> UTF-8). Timing and text are kept. What cannot be carried over is listed in the answer: ASS styling (fonts, colours, positions, effects) is always dropped, WebVTT cue settings and NOTE/STYLE/REGION blocks do not exist in SRT, and blank lines inside a cue are removed because both formats end a cue at a blank line.
Args: path: .srt, .vtt, .ass or .ssa file. to_format: 'srt' or 'vtt'. output: where to write (default: .converted.). overwrite: allow replacing an existing output file (default false). encoding: force the input text encoding. output_encoding: encoding of the written file: utf-8 (default), utf-8-sig, utf-16, cp1254, cp1252, iso-8859-9, ...
Inputs: path (required), to_format (required), output, encoding, +2 more. Returns: result
fix_common_problemsA
Repair the usual damage in SRT/WebVTT files. DRY RUN BY DEFAULT: it lists every fix it would make (with cue numbers and before/after times) and writes nothing until you call again with apply=true.
Fixes: out-of-order cues are re-sorted; cues with end <= start get a readable duration (never past the next cue); overlapping cues are trimmed to the next cue's start; empty cues and blank lines inside cues are removed; missing/duplicate/wrong SRT index numbers are renumbered; lines longer than max_line_length are re-wrapped (balanced; dialogue dashes keep one speaker per line); the BOM and mixed CR/LF line endings are normalised. With strip_tags=true, HTML/font/WebVTT/ASS tags are removed from the text.
Flagged but never changed: reading-speed outliers (more than max_cps characters per second) and cues on screen for over 10 seconds; overlapping cues that start together.
Args: path: .srt or .vtt file. apply: false (default) = report only; true = write the repaired file. strip_tags: also remove , , <font ...>, <v ...>, {\an8} etc. (default false). max_line_length: wrap lines longer than this many visible characters (default 42). max_cps: reading-speed flag threshold in characters per second (default 25). output: where to write when apply=true (default: .fixed.). overwrite: allow replacing an existing output file (default false). encoding: force the input text encoding. output_encoding: encoding of the written file (default utf-8).
Inputs: path (required), apply, output, max_cps, +5 more. Returns: result
merge_or_splitA
Join two subtitle files or cut one in two. SRT and WebVTT only.
mode='merge': the cues of path2 are moved by offset_ms and combined with those of path (result sorted by start time, in the format of the first file). If offset_ms is omitted, the second file is placed right after the last cue of the first (typical for CD1 + CD2 rips). Use offset_ms=0 to overlay two files, such as two languages.
mode='split': cut at time at. Part 1 holds everything that starts before at; part 2
holds everything from at on, re-zeroed so at becomes 00:00:00. A cue that straddles the cut
appears in both parts (clipped to the cut in part 1).
Args: path: first (or only) file. mode: 'merge' or 'split'. path2: second file (merge only). offset_ms: milliseconds added to every cue of path2 (merge only; may be negative). at: split time such as 00:45:10,000 (split only). output: merged file / first part (default .merged. or .part1.). output2: second part (split only, default .part2.). overwrite: allow replacing existing output files (default false). encoding: force the input text encoding (applies to both inputs). output_encoding: encoding of the written files (default utf-8).
Inputs: mode (required), path (required), at, path2, +6 more. Returns: result
read_cuesA
Show cues, selected either by number or by time. Cue numbers are 1-based positions in the file (the same numbers every other tool uses).
Args: path: subtitle file. start_cue: first cue number (inclusive). Use with end_cue. end_cue: last cue number (inclusive). from_time: show cues that overlap [from_time, to_time). Format 00:01:02,500 or 62.5. to_time: end of the time window (default: end of file). limit: maximum cues to return (default 100, at most 500). encoding: force a text encoding.
Inputs: path (required), limit, end_cue, to_time, +3 more. Returns: result
resyncA
Fix a subtitle that is out of sync by an amount that CHANGES through the film (drift) as well as a constant offset. Give anchor points: a line in the file and the time it should really appear. Two anchors (one near the start, one near the end) define the straight line new = a*old + b exactly; with three or more a least-squares line is fitted. The tool applies it to every start and end time and reports the error left at each anchor.
Find anchors with search_subtitles / read_cues: take a distinctive line near the start and one near the end, play the video to find when each is really spoken.
Alternatively give fps_from and fps_to (no anchors) when the subtitle was timed for a video at one frame rate and your video runs at another (for example fps_from=25, fps_to=23.976).
Args: path: .srt or .vtt file. anchors: list of {"cue": 12, "to": "00:03:10,400"} (cue = cue number, its START is moved) or {"at": "00:03:05,000", "to": "00:03:10,400"} (at = the current wrong time). fps_from: frame rate the subtitle was made for. fps_to: frame rate of the video you have. output: where to write (default: .resynced.). overwrite: allow replacing an existing output file (default false). encoding: force the input text encoding. output_encoding: encoding of the written file (default utf-8).
Inputs: path (required), fps_to, output, anchors, +4 more. Returns: result
search_subtitlesA
Find cues whose text contains a phrase (or matches a regular expression), with cue number and timestamps. Matching ignores line breaks inside a cue (they count as a space), so a phrase split over two lines is still found. Markup tags are searched too.
Args: path: subtitle file. query: text to find, or a Python regular expression when regex=true. regex: treat query as a regular expression. case_sensitive: default is case-insensitive. limit: maximum matches to show (default 50). encoding: force a text encoding.
Inputs: path (required), query (required), limit, regex, +2 more. Returns: result
shiftA
Move cues later (positive) or earlier (negative) by a constant amount, either in milliseconds or in frames at a frame rate (frames=24, fps=29.97 is exact: 29.97 means 30000/1001). Optionally only from a given cue to the end of the file. Fails instead of producing a time before 00:00:00. SRT and WebVTT only; writes a new file.
For a subtitle that is early/late by a different amount at the start and the end, use resync instead.
Args: path: .srt or .vtt file. offset_ms: milliseconds to add (negative = earlier). Give this OR frames+fps. frames: number of frames to add (negative = earlier); needs fps. fps: frame rate for frames, e.g. 23.976, 24, 25, 29.97. from_cue: 1-based cue number to start shifting from (default: every cue). output: where to write (default: .shifted. next to the input). overwrite: allow replacing an existing output file (default false). encoding: force the input text encoding. output_encoding: encoding of the written file (default utf-8).
Inputs: path (required), fps, frames, output, +5 more. Returns: result
subtitle_infoA
Inspect a subtitle file: format, detected encoding, line endings, cue count, time span, overlaps, gaps, longest line, reading speed (characters per second: min/mean/median/p95/max) and a list of problems with the cue numbers affected. Read-only. Run this first.
The encoding is detected (UTF-8/16/32 by byte order mark or structure; Turkish cp1254,
Western cp1252 and Central European iso-8859-2 by letter evidence) and the reason and
confidence are reported. If the text looks garbled, pass the right encoding and rerun.
Args: path: .srt, .vtt, .ass or .ssa file. encoding: Python codec name to force (for example 'cp1254'); default is auto-detect.
Inputs: path (required), encoding. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool has a clearly distinct purpose: inspection, reading, searching, repair, constant shifting, drift resync, format conversion, merge/split, and the two-step translation workflow. The only potentially overlapping pair, shift and resync, is explicitly differentiated by constant offset versus drift/frame-rate correction, and the descriptions point to each other. search_subtitles and read_cues also target different needs (text matching versus positional/time-based listing).
All names use consistent snake_case, and most are readable verb_noun or verb_object forms such as search_subtitles, fix_common_problems, read_cues, and merge_or_split. However, several tools use single verbs (shift, resync, convert) or a noun-first name (subtitle_info), so the pattern is not uniformly verb_noun.
Ten tools is well within the ideal range for a focused subtitle-processing server. Each tool covers a meaningful, non-redundant operation in the workflow, from inspection and repair through timing adjustment, conversion, merging, and translation.
The surface covers the core subtitle lifecycle: inspect, read, search, repair, shift/resync timing, convert formats, merge/split, and translate text. Minor gaps remain, such as direct cue-level text editing outside the translation flow or explicit cue addition/deletion, but most practical workflows can be handled with the existing tools.
Maintenance
Related MCP Connectors
Subtitle engine for AI agents: one upload gives a written track and a translation, timings exact.
Convert, clean, retime and validate SRT, WebVTT, ASS/SSA, SBV and TTML subtitles. 8 tools.
Generate SRT and VTT subtitles for any video or audio file, 99 languages.
Convert subtitles, transcripts, broadcast captions (SCC/MCC/STL), EDLs, and Premiere files.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables LLM agents to process local videos into timestamped, citable text documents and then query them through tools for listing videos, retrieving transcripts, and fetching specific segments, all fully offline.MIT
- AlicenseAqualityDmaintenanceEnables MCP clients to transcribe audio/video files locally, generate SRT subtitles, and burn captions into videos via tool calls, without a cloud API.3MIT
- AlicenseNot gradedqualityBmaintenanceProvides local, offline transcription, keyframe extraction, OCR, and pre-publish review of audio, video, and image files, enabling AI agents to see and hear media without cloud or API keys.52 npmApache 2.0
- AlicenseAqualityBmaintenanceEnables AI agents to analyze videos by producing timestamped transcripts, keyframe contact sheets, and metadata reports from local files or online URLs, fully offline and without API keys.6MIT