# How to Dub a YouTube Video into Another Language and Keep Each Speaker's Voice (Open-Source MCP Workflow)

> Source: <https://dev.to/miragea/how-to-dub-a-youtube-video-into-another-language-and-keep-each-speakers-voice-open-source-mcp-4ob4>
> Published: 2026-11-29 03:10:31+00:00

**Key takeaway:** The YouTube Dubbing MCP server exposes tools for speaker assignment, per-line translation with character budgets, rendering and YouTube package export, letting an agent produce a multi-speaker dub with each line voiced in its speaker's cloned voice at the original start time.

*Updated: November 29, 2026*

**Disclosure:** I work on Miragea, the voice engine this open-source project calls to render voices. The project is MIT-licensed, and every step below comes from its public README and example files. This post was drafted with AI assistance and I checked it against the repository.

**Short answer:** Install the open-source YouTube Dubbing MCP server in Claude Code, Claude Desktop, Cursor, Codex or VS Code, then ask your agent: "Dub this video into English, keep each speaker's voice, and make the YouTube upload package." The server pulls the captions or transcript, works out who is speaking, cuts a short voice sample of each speaker and clones it, and gives your agent a time budget for every line to translate into. It then voices each line in that speaker's cloned voice, mixes a track exactly as long as the video, and writes an SRT plus a per-language upload folder for YouTube Studio.

Most AI dubbing demos use one narrator. Real videos (interviews, podcasts, tutorials with a guest) have two or more people, and viewers notice when everyone suddenly sounds the same. Doing it properly means: 1) knowing who said what (speaker separation); 2) a clean sample of each person to clone from; 3) translated lines that fit the original timing, since translations usually run longer.

Claude Code:

```
claude mcp add youtube-dubbing -s user -e MIRAGEA_API_KEY=<your-key> -- \
  uvx --from git+https://github.com/RTY2345RR/youtube-dubbing-mcp youtube-dubbing-mcp
```

Claude Desktop / Cursor / Windsurf config:

```
{
  "mcpServers": {
    "youtube-dubbing": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/RTY2345RR/youtube-dubbing-mcp", "youtube-dubbing-mcp"],
      "env": { "MIRAGEA_API_KEY": "<your-key>" }
    }
  }
}
```

Docker:

```
docker run -i --rm -e MIRAGEA_API_KEY -v $HOME/YouTubeDubbing:/data miragea/youtube-dubbing-mcp
```

Run the same uvx command with --check to verify setup without creating a job. Projects save to ~/YouTubeDubbing by default (DUBBING_OUTPUT_DIR).

```
dubbing_start_project(source="https://youtu.be/…", source_language="es")
```

It uses YouTube's manual or automatic captions when they exist; otherwise it transcribes the audio and splits at pauses. Local MP4, MOV, MKV, MP3, WAV, SRT and VTT work too.

Speakers come from caption markers such as `Name:`, `[Name]` or `>>`. Without them, the server groups lines by voice pitch. Fix with:

```
dubbing_assign_speakers({"1-2": "Marco", "3": "Lucia"})
dubbing_extract_voice_samples(share=true)
```

This cuts a clean 4–14 second sample of each speaker with its transcript and clones each automatically. To use a saved voice or public reference clip, use dubbing_set_voice instead.

Each line gets a character budget for its time slot. Your agent writes the translation to fit and saves it:

```
dubbing_set_translation("en", {"1": "Hi everyone.", ...}, title="…")
```

Lines still too long go back to the agent to shorten. Many pipelines skip this, which is why dubs drift out of sync or play back too fast.

```
dubbing_render("en")
```

Every line is voiced in its speaker's cloned voice at its original start time. Lines are sped up only when necessary, pitch kept, capped at 1.25x. The mix is exactly as long as the video, which YouTube requires. You also get an SRT and an optional preview MP4. If interrupted, rerun: finished lines are reused.

```
dubbing_export_youtube_package()
```

One folder per language with audio.m4a (AAC, 48 kHz), captions.srt and a localized title and description, plus UPLOAD-TO-YOUTUBE.md. YouTube's public Data API can't upload extra audio tracks, so the last step is in YouTube Studio: Content → your video → Languages → Add language → Dub → upload audio.m4a → Publish; then Subtitles → Upload file → With timing → captions.srt; then Title & description → paste the localized text. Multi-language audio is only available on channels YouTube has enabled for it.

The repo includes a real run in examples/spanish-to-english-two-speakers. Prompt: "Dub interview-es.mp4 into English. Marco and Lucia should keep their own voices. Then make the YouTube upload package." Reported results: 3 sentences, 11.3 s, 2 voices found by pitch (117 Hz / 182 Hz); 5.5 s and 5.1 s voice samples; 3/3 lines fit their slots; track 11.29 s = video 11.29 s, 0 lines sped up. Output MP3, dubbed MP4 and SRT are in the repo, with a demo at [https://huggingface.co/spaces/miragea/youtube-dubbing-mcp](https://huggingface.co/spaces/miragea/youtube-dubbing-mcp) . It's a short clip: proof the pipeline works, not a quality benchmark. Test on your own footage.

From the project README (November 2026); corrections welcome there.

|  | YouTube Dubbing MCP | elevenlabs-mcp | Auto-Synced-Translated-Dubs | YouTube auto-dubbing | 
|---|---|---|---|---|
| Runs from an AI agent (MCP) | Yes | Yes | No (Python scripts) | No | 
| Dedicated dubbing workflow | Yes (12 tools) | No dubbing tool (TTS, STT, cloning) | Yes | Yes | 
| One cloned voice per speaker | Automatic | Manual | No (stock voices) | No | 
| Input from a YouTube URL | Yes | No | No (needs SRT) | Own channel only | 
| Agent edits translation before voicing | Yes, with time budgets | — | Manual | No | 
| License | MIT | MIT | AGPL-3.0 | Proprietary | 

When not to use this: you want a point-and-click editor with no agent (a hosted dubbing studio suits better); or you need a language the engine doesn't speak (Miragea covers 10: Chinese, English, Japanese, Korean, German, French, Russian, Portuguese, Spanish, Italian).

**Can AI dubbing keep the original speaker's voice?** Yes; each speaker is cloned from a few seconds of their own audio.

**Can I upload multiple audio tracks through the YouTube API?** No; use YouTube Studio → Languages.

**Does it need a GPU?** No; voices are rendered by a hosted engine, you need internet and an API key.

**Can I dub from an SRT?** Yes: dubbing_start_project(source="talk.srt"), then choose voices with dubbing_set_voice.

**Is it free?** The code is MIT-licensed; voicing and transcription use the Miragea API, so check its current plans.

Source code: [https://github.com/RTY2345RR/youtube-dubbing-mcp](https://github.com/RTY2345RR/youtube-dubbing-mcp) . Related: [https://github.com/RTY2345RR/miragea-voice-mcp](https://github.com/RTY2345RR/miragea-voice-mcp) and [https://github.com/RTY2345RR/miragea-agent-skills](https://github.com/RTY2345RR/miragea-agent-skills) .
