subcraft-mcp
# `subcraft-mcp` — Subtitle Reflow, Timecode Healing & FCPXML 1.9 MCP Server + GitHub Action
[](https://glama.ai/mcp/servers/z121245017-ai/subcraft-mcp)
Zero-dependency, local-only **Model Context Protocol (`MCP`) Server**, **CLI**, and **GitHub Action** enabling Claude Desktop, Cursor, Windsurf, Antigravity, and CI pipelines to reflow `.srt` / `.vtt` / OpenAI Whisper `.json` captions for `9:16` vertical and `16:9` cinema screens, repair NLE framerate drift and overlapping timecodes, merge dual-language tracks into `FCPXML 1.9`, extract YouTube `00:00` chapters, and block broken captions in pull requests.
## MCP Tools Exposed (`stdio`)
| Tool | Purpose | Annotations |
| :--- | :--- | :--- |
| `reflow_vertical_subtitles` | Reflows `.srt`, `.vtt`, or Whisper verbose `.json` into balanced `9:16` vertical (`<=13` CJK / `<=26` ASCII) or `16:9` cinema (`<=22` CJK / `<=42` ASCII) `.srt` or `.vtt` cues via dynamic programming without splitting English words, numbers, currencies, ratios, or URLs. | `readOnlyHint: true`, `idempotentHint: true`, `openWorldHint: false` |
| `heal_subtitle_timecodes` | Repairs NLE framerate drift (`23.976` <-> `24` <-> `25` <-> `29.97` <-> `30` fps), shifts global millisecond offsets, enforces minimum duration floors (`600ms`), clamps cue overlaps (`40ms` gap), and flags `>18 CPS` EN / `>9 CPS` ZH reading-speed bursts. | `readOnlyHint: true`, `idempotentHint: true`, `openWorldHint: false` |
| `merge_bilingual_subtitles` | Aligns primary and secondary subtitle tracks by midpoint and temporal overlap into dual-line `.srt`, `.vtt`, or rational-frame Apple Final Cut Pro / DaVinci Resolve `FCPXML 1.9` title lanes. | `readOnlyHint: true`, `idempotentHint: true`, `openWorldHint: false` |
| `extract_video_chapters_and_shownotes` | Generates YouTube-compliant `00:00` timestamp chapters and a speaker-grouped, paragraphized Markdown show-notes transcript while surgically stripping spoken Chinese and English filler words. | `readOnlyHint: true`, `idempotentHint: true`, `openWorldHint: false` |
## Quick Start (MCP Client & Local CLI)
```bash
# Start MCP server over stdio (zero npm install / zero external dependencies)
npx -y github:z121245017-ai/subcraft-mcp
# List MCP tool schemas from terminal
npx -y github:z121245017-ai/subcraft-mcp --list
# Reflow a long caption cue for 9:16 vertical shorts directly from terminal
npx -y github:z121245017-ai/subcraft-mcp --cli reflow_vertical_subtitles '{"input":"1\n00:00:00,000 --> 00:00:04,800\nToday we benchmark 1,250.50 requests per second at https://example.org/spec without cloud uploads.\n","preset":"vertical_9_16"}'
```
### Claude Desktop / Cursor / Windsurf / Antigravity Config
```json
{
"mcpServers": {
"subcraft": {
"command": "npx",
"args": ["-y", "github:z121245017-ai/subcraft-mcp"]
}
}
}
```
### Docker (`node:22-alpine`, non-root `USER node`)
```bash
docker build -t subcraft-mcp .
docker run -i --rm subcraft-mcp
```
## GitHub Action (`z121245017-ai/subcraft-mcp@v1`)
Add `subcraft-mcp@v1` to `.github/workflows/` to automatically lint repository `.srt` and `.vtt` caption files in pull requests for overlapping cues, `>18 CPS` reading-speed bursts, and line-width overflows with inline `::error file=...,line=...::` PR annotations:
```yaml
name: Caption & Timecode Quality Gate
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
subtitle-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check .srt & .vtt captions for overlaps, >18 CPS & width overflows
uses: z121245017-ai/subcraft-mcp@v1
with:
paths: '.'
preset: 'cinema_16_9'
max-en-cps: '18'
max-zh-cps: '9'
fail-on-overlap: 'true'
fail-on-cps: 'true'
fail-on-line-width: 'true'
```
### Action Inputs & Outputs
| Name | Kind | Default | Description |
| :--- | :--- | :--- | :--- |
| `paths` | Input | `.` | Newline-, comma-, or space-separated files or directories to scan for `.srt` and `.vtt` files. |
| `preset` | Input | `cinema_16_9` | Line-width preset: `cinema_16_9` (`42` ASCII / `22` CJK) or `vertical_9_16` (`26` ASCII / `13` CJK). |
| `max-en-cps` | Input | `18` | Maximum allowed English reading speed in characters per second (`CPS`). |
| `max-zh-cps` | Input | `9` | Maximum allowed Chinese reading speed in CJK units per second (`CPS`). |
| `max-ascii-chars` | Input | `''` | Optional explicit ASCII character ceiling per line overriding `preset`. |
| `max-cjk-units` | Input | `''` | Optional explicit CJK unit ceiling per line overriding `preset`. |
| `fail-on-overlap` | Input | `true` | Exit `1` when subtitle cues overlap in time or have non-positive duration. |
| `fail-on-cps` | Input | `true` | Exit `1` when any subtitle cue exceeds the configured reading-speed `CPS` limit. |
| `fail-on-line-width` | Input | `true` | Exit `1` when any subtitle line exceeds the configured CJK or ASCII width ceiling. |
| `ignore` | Input | `node_modules,.git,dist,build,coverage,vendor` | Comma-separated directory names skipped during recursive workspace scan. |
| `scanned-files` | Output | — | Number of `.srt` and `.vtt` caption files inspected. |
| `overlaps-found` | Output | — | Total count of overlapping or inverted cue timecodes detected. |
| `cps-violations-found` | Output | — | Total count of reading-speed (`CPS`) violations detected. |
| `width-violations-found` | Output | — | Total count of line-width overflow violations detected. |
| `report-json` | Output | — | Structured JSON summary of all caption lint findings. |
## Verification
```bash
npm test
```
## License
MIT License — `0` external npm dependencies, `0` network calls, `100%` local execution.
TDQS
Scored across 4 tools
Each tool targets a clearly distinct subtitle-processing operation: reflowing layout, repairing timing, merging bilingual tracks, and extracting chapters/show notes. There is no meaningful overlap in purpose, so an agent can select the right tool from the task alone.
All four tools follow a verb-first snake_case convention (reflow_, heal_, merge_, extract_) with descriptive noun phrases. The pattern is predictable and consistent throughout.
Four tools are well-scoped for a focused subtitle-processing server, and each covers a distinct stage of subtitle cleanup and delivery. Nothing feels redundant or missing from a count perspective.
The surface covers core subtitle workflows: reflow, timing repair, bilingual merging, and chapter/show-notes extraction across common caption formats. Minor gaps exist around general format conversion or subtitle trimming, but these are not central to the stated purpose.