Skip to main content
Glama
SRT Translation MCP Server
by omd0

SRT Translation MCP Server

A Model Context Protocol (MCP) server for processing and translating SRT subtitle files with intelligent conversation detection and context preservation.

Features

  • SRT File Processing: Parse, validate, and manipulate SRT subtitle files

  • Large File Support: Intelligent chunking for processing large SRT files

  • Conversation Detection: Context-aware analysis for better translation quality

  • Style Tag Preservation: Maintain HTML-style formatting during translation

  • Timing Synchronization: Preserve precise timing information

  • MCP Integration: Standardized interface for AI assistant integration

Related MCP server: faster-whisper-mcp

Installation

# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm test

Usage

As an MCP Server

# Start the MCP server
npm start

# Or run directly with npx
npx srt-translation-mcp-server

Available MCP Tools

  • parse_srt: Parse and validate SRT file content

  • write_srt: Write SRT file from parsed data

  • detect_conversations: Detect conversation boundaries in SRT content

  • translate_srt: Translate SRT content with context preservation

  • translate_chunk: Translate a specific chunk of SRT content

Example Usage

// Parse SRT file
const result = await mcpClient.callTool('parse_srt', {
  content: srtFileContent
});

// Detect conversations
const conversations = await mcpClient.callTool('detect_conversations', {
  content: srtFileContent
});

// Translate SRT file
const translated = await mcpClient.callTool('translate_srt', {
  content: srtFileContent,
  targetLanguage: 'es',
  preserveFormatting: true
});

Development

# Development mode with hot reload
npm run dev

# Run tests in watch mode
npm run test:watch

# Lint code
npm run lint

# Fix linting issues
npm run lint:fix

Architecture

Core Components

  • SRT Parser: Handles SRT file parsing and validation

  • Time Parser: Manages SRT time format operations

  • Style Tags: Preserves HTML-style formatting

  • Conversation Detector: Identifies conversation boundaries

  • Translation Service: Context-aware translation processing

  • MCP Server: Protocol implementation for AI integration

Key Features

  1. Intelligent Chunking: Breaks large files at natural conversation boundaries

  2. Context Preservation: Maintains conversation context for better translations

  3. Style Tag Support: Preserves HTML formatting during translation

  4. Timing Validation: Ensures timing sequences are valid and ascending

  5. Error Handling: Comprehensive error reporting and validation

Testing

The project includes comprehensive tests for all core functionality:

  • Time parsing and formatting

  • SRT file parsing and validation

  • Style tag detection and preservation

  • Conversation detection algorithms

  • Translation workflow integration

Run tests with:

npm test

License

MIT License - see LICENSE file for details.

Available Tools

6 tools
detect_conversationsA

๐Ÿš€ CHUNK-BASED TRANSLATION WORKFLOW INSTRUCTIONS ๐Ÿš€

๐Ÿ“‹ OVERVIEW: This tool analyzes SRT files and creates intelligent chunks for efficient translation. It returns METADATA ONLY - use get_next_chunk() and translate_srt() for actual content.

๐Ÿ” WHAT IT DOES:

  • SMART INPUT: Auto-detects file paths vs SRT content

  • Creates small chunks (1-3 subtitles each) optimized for AI processing

  • Detects languages (Arabic, English, Spanish, French) per chunk

  • Identifies speakers and conversation boundaries

  • Provides translation priority rankings (high/medium/low)

  • Stores chunks in memory to avoid context limits

  • Creates individual TODO tasks for tracking progress

๐Ÿ“Š WHAT IT RETURNS (SMALL RESPONSE):

  • chunkCount: Total number of chunks created

  • totalDuration: File duration in milliseconds

  • languageDistribution: Language counts (e.g., {"ar": 45, "en": 12})

  • previewChunk: Preview of first chunk metadata only

  • sessionId: For retrieving chunks later

  • message: Instructions for next steps

  • todos: Individual tasks for each chunk

๐ŸŽฏ RECOMMENDED WORKFLOW:

  1. Call detect_conversations with storeInMemory=true

  2. Review metadata to understand file structure (SMALL RESPONSE)

  3. Use get_next_chunk to process chunks one by one

  4. Use translate_srt() for actual translation

  5. Track progress with todo_management

๐Ÿ’ก EXAMPLES:

File Path Input: {"content": "/path/to/file.srt", "storeInMemory": true, "createTodos": true}

SRT Content Input: {"content": "1\n00:00:02,000 --> 00:00:07,000\nHello world", "storeInMemory": true}

โš ๏ธ IMPORTANT:

  • This returns METADATA ONLY - no actual text content

  • Response is SMALL to avoid context overflow

  • Use get_next_chunk() to retrieve individual chunks

  • Use translate_srt() for actual translation

  • Store chunks in memory for large files to avoid context limits

Inputs: content (required), storeInMemory, sessionId, createTodos.

get_next_chunkA

๐Ÿ“ฆ CHUNK RETRIEVAL FOR TRANSLATION WORKFLOW ๐Ÿ“ฆ

๐ŸŽฏ PURPOSE: Retrieves the next chunk from memory for sequential processing. Use this after detect_conversations with storeInMemory=true.

๐Ÿ”„ HOW IT WORKS:

  • Automatically tracks which chunk to return next

  • Returns actual chunk data with subtitle text content

  • Advances to next chunk automatically

  • Returns null when all chunks processed

๐Ÿ“ฅ PARAMETERS:

  • sessionId: Session ID from detect_conversations response

๐Ÿ“ค RETURNS:

  • chunk: Complete chunk data with subtitle text (or null if done)

  • chunkIndex: Current chunk number (0-based)

  • totalChunks: Total chunks available

  • hasMore: Boolean indicating if more chunks exist

  • message: Status message

๐Ÿ’ก USAGE PATTERN:

  1. Call detect_conversations with storeInMemory=true

  2. Get sessionId from response

  3. Call get_next_chunk repeatedly until hasMore=false

  4. Process each chunk for translation

  5. Use translate_srt() on individual chunks

๐Ÿ“‹ EXAMPLE: {"sessionId": "srt-session-123456789"}

โš ๏ธ NOTE:

  • Each call advances to the next chunk automatically

  • Store sessionId from detect_conversations response

  • Use this for chunk-by-chunk processing of large files

Inputs: sessionId (required).

parse_srtC

Parse SRT file content and return structured data

Inputs: content (required).

todo_managementC

Manage tasks for SRT processing workflows.

WHAT IT DOES:

  • Create, update, and track tasks during SRT processing

  • Monitor progress across different processing stages

  • Manage task priorities and dependencies

ACTIONS:

  • create: Create a new task

  • update: Update task status

  • complete: Mark task as completed

  • list: List all tasks

  • get_status: Get overall task status

TASK TYPES:

  • srt_parse: Parse and validate SRT file

  • conversation_detect: Detect conversation chunks

  • chunk_optimize: Optimize chunks for AI processing

  • ai_process: Process with AI model

  • translate: Translate content

  • quality_check: Quality assurance

  • output_generate: Generate final output

EXAMPLE USAGE:

  1. Create task: {"action": "create", "taskType": "srt_parse", "title": "Parse SRT file", "priority": "high"}

  2. Update status: {"action": "update", "taskId": "task-123", "status": "completed"}

  3. List tasks: {"action": "list"}

  4. Get status: {"action": "get_status"}

Inputs: action (required), taskType, title, description, +4 more.

translate_srtA

๐ŸŒ SRT TRANSLATION HELPER TOOL ๐ŸŒ

๐Ÿšจ CRITICAL: THIS IS A HELPER TOOL ONLY - AI DOES THE TRANSLATION! ๐Ÿšจ

๐ŸŽฏ PURPOSE: This tool helps prepare SRT content for AI translation but DOES NOT translate text itself. The AI assistant must perform the actual translation work.

๐Ÿ“ WHAT IT DOES:

  • Parses SRT content and extracts subtitle text for AI translation

  • Preserves timing and formatting structure

  • Returns structured data for AI to translate

  • Provides context and metadata for better translation

โŒ WHAT IT DOES NOT DO:

  • โŒ Does NOT translate text automatically

  • โŒ Does NOT return translated content

  • โŒ Does NOT perform any AI translation

โœ… WHAT IT RETURNS:

  • Structured SRT data with original text

  • Timing and formatting information

  • Translation context and metadata

  • Ready-to-translate format for AI

๐Ÿ”„ RECOMMENDED WORKFLOW:

  1. Use detect_conversations to analyze file structure

  2. Use get_next_chunk to get individual chunks

  3. Use translate_srt to prepare chunk for AI translation

  4. AI assistant translates the text content

  5. AI assistant combines results into final SRT file

๐Ÿ’ก USAGE PATTERNS:

Prepare Full File for Translation: {"content": "full SRT content", "targetLanguage": "es", "sourceLanguage": "en"}

Prepare Individual Chunk for Translation: {"content": "chunk SRT content", "targetLanguage": "es", "sourceLanguage": "en"}

โš ๏ธ CRITICAL INSTRUCTIONS:

  • This tool ONLY prepares content for AI translation

  • AI assistant must do the actual text translation

  • Use this to get structured data, then translate with AI

  • Return format is ready for AI processing

Inputs: content (required), targetLanguage (required), sourceLanguage.

write_srtC

Write SRT data to file format

Inputs: srtData (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelogโ€ฆ

    TDQS

    A3.7/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool has a distinct, non-overlapping purpose in the SRT translation workflow: detect_conversations analyzes and chunks files, get_next_chunk retrieves chunks sequentially, parse_srt parses SRT content, todo_management manages tasks, translate_srt prepares content for AI translation, and write_srt writes output. The descriptions clearly differentiate their roles, with no ambiguity or overlap in functionality.

    Naming Consistency4/5

    Most tools follow a clear verb_noun pattern (e.g., detect_conversations, get_next_chunk, parse_srt, write_srt), which is consistent and predictable. However, translate_srt and todo_management deviate slightly by using a verb_noun format but with less precise action verbs, and todo_management is more generic. Overall, the naming is highly consistent with only minor deviations.

    Tool Count5/5

    With 6 tools, the server is well-scoped for its purpose of SRT translation. Each tool serves a specific role in the workflow (analysis, chunking, parsing, task management, translation preparation, and output), and none feel redundant or unnecessary. This count is ideal for covering the domain without being overwhelming or insufficient.

    Completeness5/5

    The tool set provides complete coverage for the SRT translation domain, supporting a full workflow from input analysis to output generation. It includes detection, chunking, parsing, task management, translation preparation, and file writing, with no obvious gaps. The descriptions emphasize a cohesive process, ensuring agents can handle all necessary operations without dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables translation of SRT subtitle files from English to Japanese using local LLM servers like LM Studio. Parses SRT format files and returns translated subtitles in proper SRT format through OpenAI-compatible APIs.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables local transcription of audio/video files and YouTube URLs, generation of SRT/VTT subtitles, and analysis of speech pacing and audience retention risk using faster-whisper.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Translate PDF, Word (DOCX), Excel (XLSX) and PowerPoint (PPTX) files, images, subtitles and text. Turn audio and video into transcripts or translated subtitles. Preserve layout where supported. Requires an Equalang API key and credits.
      8
      78 npm
      22
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Enables an AI agent to inspect, repair, retime, convert, merge/split, and search SRT, WebVTT, and ASS subtitle files entirely offline, with exact-fraction resync, dry-run fixes, and honest encoding detection. Translation is handled by the agent itself through a chunk/apply contract that preserves timing and flags lost tags.
      10
      MIT