TTS MCP Server

io.github.RTY2345RR由 GitHub 账号 RTY2345RR 发布v0.1.1更新于 Nov 8, 2026

Text-to-speech, AI voiceover, voice cloning and SRT/VTT subtitles for AI agents.

已验证STDIO仅桌面媒体与设计AI 与机器学习

概览

AI 生成的概览

本地 MCP 服务器,让助手把文稿转成配音音频并附 SRT/VTT 字幕、克隆声音,或把音视频转写成字幕。

可以做什么
  • 用文本或文本文件生成语音,可选账户中已保存的声音或参考音频克隆的声音,并设置模型、情绪标签、语速和音频格式
  • 一次调用完成文稿到配音:输出音频以及与该音频对齐的 SRT 和 VTT 字幕,字幕保留文稿原文
  • 把本地音频或视频文件转写为 SRT、VTT、TXT 或 JSON 字幕
  • 查询语音引擎的实时能力,并列出账户中保存的声音
  • 按任务 ID 查询、续取或列出生成任务
适用场景
适合让助手在对话中直接为视频、短视频或播客制作旁白和配套字幕,或为已有录音生成字幕。适合已拥有 Miragea 账户、使用 Claude Desktop、Claude Code、Cursor、Codex、VS Code 或 Windsurf 的创作者。
运行要求
通过 uvx、pip 或 Docker 以 stdio 在本地运行,需要 Python 3.10-3.13(或 Docker)。必须在 MIRAGEA_API_KEY 中提供 Miragea API 密钥;可选设置包括 API 根地址、输出目录、等待超时和 HTTP 超时。需要能访问 Miragea API 的网络。
安装前请注意
所有语音生成、克隆和识别都会发送到 Miragea 语音引擎,文稿和上传的媒体会离开本机。API 密钥是可计费账户的凭据,应放在客户端的 env 配置中。声音克隆需要公开的参考音频链接,且只应对你有权使用的声音进行克隆。生成的文件会写入输出目录。

安装

在 SourceWeft 中

  1. 打开 控制台中的 TTS MCP Server,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

TTS MCP Server — text-to-speech, AI voiceover, voice cloning and SRT/VTT subtitles for Claude, Cursor and Codex

[CI] [Release] [PyPI] [Docker] [Python 3.10+] [Hugging Face Space] [License: MIT] [MCP]

tts-mcp-server is an open-source text-to-speech (TTS) MCP server that gives AI agents a voice. It lets Claude Desktop, Claude Code, Cursor, OpenAI Codex, VS Code and Windsurf turn a script into a narration audio file (MP3, WAV, FLAC, Opus, AAC or PCM) plus matching SRT and WebVTT subtitles in one Model Context Protocol tool call. It also clones a voice from a reference audio URL, uses the voices saved in your account, and transcribes any local audio or video file into captions. Text-to-speech, voice cloning and speech recognition run on the Miragea voice engine. Install it with one command, uvx tts-mcp-server; it needs only a MIRAGEA_API_KEY and is MIT licensed.

Install: uvx tts-mcp-server · pip install tts-mcp-server · docker run -i --rm -e MIRAGEA_API_KEY miragea/tts-mcp-server · Try it in the browser: live demo on Hugging Face Spaces · Source: github.com/RTY2345RR/miragea-voice-mcp

Formerly published as miragea-voice-mcp. The miragea-voice-mcp command is still installed as an alias, so existing configs keep working.

[Terminal screenshot: installing the voiceover and captions MCP server with uvx from GitHub, printing the Claude Code config, and listing its 7 MCP tools (text-to-speech, voice cloning, transcription to SRT/VTT)]

text
You:    Turn script.txt into a calm voiceover with captions for a YouTube Short.Agent:  miragea_script_to_voiceover(script_file="script.txt", actor_id="…", tags=["calm"])        → ~/Miragea/my-short.mp3  ~/Miragea/my-short.srt  ~/Miragea/my-short.vtt

Contents

How it works

[Architecture diagram of the voiceover and captions MCP server: an AI agent such as Claude, Cursor or Codex calls tts-mcp-server over MCP stdio; the server calls the Miragea voice engine for text-to-speech, voice cloning and speech recognition, and writes MP3 audio plus SRT and WebVTT captions]

  1. Your AI agent (Claude Desktop, Claude Code, Cursor, OpenAI Codex, VS Code or Windsurf) calls a tool such as miragea_script_to_voiceover over the Model Context Protocol (stdio).
  2. The server checks the request against the live voice-engine capabilities (models, emotion tags, formats, text length) and adds an idempotency key.
  3. The Miragea voice engine generates the narration (or clones a voice from your reference clip), then runs speech recognition on the new audio for timestamps.
  4. The server writes .mp3 + .srt + .vtt side by side, with captions that keep your exact script wording, ready to import into your video editor.

Features

  • Script → voiceover + captions in one call. miragea_script_to_voiceover generates the narration, times captions by running Miragea speech recognition on the new audio, and writes .mp3 + .srt + .vtt side by side, ready for CapCut, Premiere Pro, DaVinci Resolve, YouTube, TikTok, Reels and Shorts.
  • Captions spelled like your script. Recognition can mishear brand names ("Miragea" → "Mirage ear"). By default the server keeps the recognized timing but puts back your exact script wording, snapping cue breaks to sentence ends.
  • Short-form friendly caption lengths. max_caption_chars (default 42 for scripts) splits long cues and shares their time by length, so captions stay readable on vertical video.
  • Two voice sources. Use a voice already saved in your Miragea account (actor_id), or clone from a public reference audio URL (reference_audio_url + optional reference_text).
  • Expressive or standard models, emotion tags, speed 0.25–4×. Options are read live from /capabilities, and every argument is validated before a job is submitted.
  • Subtitles for any audio or video file. miragea_transcribe uploads mp3/wav/m4a/mp4/mov… and saves SRT, VTT, TXT or JSON (text, language, timed segments).
  • No duplicate jobs on retry. Every job carries an Idempotency-Key; network errors and 502/503/504 are retried with the same key, so a retry never creates a second job. Timeouts return the task_id so the agent resumes with miragea_get_task instead of resubmitting.
  • Never overwrites files. Existing outputs get -2, -3… suffixes.
  • Secret-safe. The key is read from the environment, never logged, never echoed in errors, never sent to the audio download host, and API redirects are not followed.
  • Starts without a key. Tool listing works with no key (handy for registries and inspectors); calls return a clear "set MIRAGEA_API_KEY" message.
  • Works on MCP Python SDK 1.x and 2.x, Python 3.10–3.13, macOS, Windows and Linux. Two dependencies: mcp and httpx.

Quickstart (60 seconds)

  1. Get a voice-engine key. The server uses Miragea for voiceover, voice cloning and recognition. Sign in and create an API key at miragea.ai/workspace/api. Setup guide: Install https://miragea.ai/skills/miragea-audio/install.md.
  2. Install uv if you don't have it: curl -LsSf https://astral.sh/uv/install.sh | sh (macOS/Linux) or powershell -c "irm https://astral.sh/uv/install.ps1 | iex" (Windows).
  3. Add the server to your client (Claude Code shown; others below):
bash
claude mcp add tts -s user -e MIRAGEA_API_KEY=<your-miragea-api-key> -- uvx tts-mcp-server
  1. Verify (read-only, creates no job):
bash
MIRAGEA_API_KEY=<your-miragea-api-key> uvx tts-mcp-server --check

Then ask your agent: "List my Miragea voices, then read 'Welcome back to the channel!' in the first English one."

Prefer pip? pip install tts-mcp-server and use "command": "tts-mcp-server" with no args in the snippets below. Prefer Docker? Use "command": "docker" with "args": ["run", "-i", "--rm", "-e", "MIRAGEA_API_KEY", "-v", "/path/to/output:/data", "miragea/tts-mcp-server"].

Client setup

Print any snippet with uvx tts-mcp-server --print-config <client> (claude-desktop, cursor, claude-code, codex, vscode, windsurf). Replace <your-miragea-api-key> and restart the client.

Claude Desktop

Settings → Developer → Edit Config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows):

json
{  "mcpServers": {    "tts": {      "command": "uvx",      "args": ["tts-mcp-server"],      "env": { "MIRAGEA_API_KEY": "<your-miragea-api-key>" }    }  }}

Claude Code

bash
claude mcp add tts -s user -e MIRAGEA_API_KEY=<your-miragea-api-key> -- uvx tts-mcp-server

Cursor

~/.cursor/mcp.json (global) or .cursor/mcp.json (project) — same JSON as Claude Desktop.

OpenAI Codex (CLI and IDE extension)

~/.codex/config.toml:

toml
[mcp_servers.tts]command = "uvx"args = ["tts-mcp-server"]tool_timeout_sec = 900env = { MIRAGEA_API_KEY = "<your-miragea-api-key>" }

tool_timeout_sec matters: voiceover jobs can take longer than Codex's default tool timeout.

VS Code (Copilot agent mode)

.vscode/mcp.json:

json
{  "servers": {    "tts": {      "type": "stdio",      "command": "uvx",      "args": ["tts-mcp-server"],      "env": { "MIRAGEA_API_KEY": "<your-miragea-api-key>" }    }  }}

Windsurf

~/.codeium/windsurf/mcp_config.json — same JSON as Claude Desktop.

Tools reference

ToolWhat it does
miragea_get_capabilitiesLive models (expressive, standard), emotion tags per model, formats, speed range, max characters per request, subtitle formats and upload limits. Call first.
miragea_list_voicesVoices saved in your account (actor_id, name, language), paged; search finds a name across pages.
miragea_text_to_speechText (or text_file) → audio file. Voice via actor_id or reference_audio_url (+ reference_text). Options: model, tags, speed, format, language, output_path, wait.
miragea_transcribeLocal audio/video → subtitles in srt, vtt, txt, json; max_caption_chars for short cues.
miragea_script_to_voiceoverScript → audio + captions (SRT + VTT by default). caption_text="script" (exact wording) or "recognized"; captions=false for audio only; name, output_dir.
miragea_get_taskCheck or resume any job by task_id; with wait=true it saves the audio or subtitles.
miragea_list_tasksRecent jobs, newest first.

Every generation tool returns task_id, status and the idempotency_key it used, plus the saved file paths.

Examples

Real outputs from this server (Miragea voice engine), committed in examples/. Voices are cloned from CMU ARCTIC reference clips (licensed free for any use); the audiobook clip is from LibriSpeech (CC BY 4.0).

ExamplePrompt to your agentToolsOutput
YouTube voiceover with SRT"Read script.txt as a YouTube intro in a clear male voice and give me SRT captions."miragea_text_to_speech → miragea_transcribeMP3 · SRT
Two-voice dialogue"Make a two-line dialogue: one male, one female voice, then join them with captions."miragea_text_to_speech ×2 (voice cloning)MP3 · SRT
Transcribe audio to captions"Create SRT and VTT subtitles for audiobook-clip.flac."miragea_transcribeSRT · VTT

Transcription output (audiobook-clip.srt), with words kept whole across cues:

srt
100:00:00,480 --> 00:00:01,987He hoped there would be stew for
200:00:01,987 --> 00:00:03,987dinner, turnips and carrots, and
300:00:03,987 --> 00:00:06,063bruised potatoes and fat mutton

Example prompts

  • "Make a 30-second product-ad voiceover from ad.txt with my Nova voice, happy tone, 1.1× speed, and give me SRT + VTT with short captions."
  • "Clone the voice at https://example.com/me.wav (it says: 'Hi, I'm Sam and this is my test.') and narrate intro.md as WAV."
  • "Create subtitles for ~/Videos/vlog.mp4 as SRT and VTT."
  • "That voiceover timed out — resume task … and save it to ~/Desktop/episode-3.mp3."
  • "What models and emotion tags does my Miragea account have, and how many characters can I send per request?"

Configuration

VariableDefaultPurpose
MIRAGEA_API_KEY— (required for calls)Your key from miragea.ai/workspace/api.
MIRAGEA_OUTPUT_DIR~/MirageaWhere relative output paths and default file names go. Absolute paths are used as given.
MIRAGEA_BASE_URLhttps://miragea.ai/v1API root including /v1 (for private deployments).
MIRAGEA_WAIT_TIMEOUT600Max seconds a tool waits for a job before returning its task_id.
MIRAGEA_HTTP_TIMEOUT60Per-request HTTP timeout in seconds.

How it compares

Honest snapshot from each project's public README (November 2026). "–" means not offered or not documented.

This serverelevenlabs-mcp (local)AllVoiceLab-MCPbetter-tts-mcp
StatusActiveDeprecated in favor of ElevenLabs' hosted MCPActiveActive
Voice engineMirageaElevenLabs APIAllVoiceLab APIMicrosoft Edge read-aloud (unofficial, no key)
One-command installuvx tts-mcp-serveruvx elevenlabs-mcpuvx allvoicelab-mcpuvx better-tts-mcp
Required config1 env var1 env varKey and matching region domainNone
Ready snippets for Claude Desktop / Claude Code / Cursor / Codex / VS Code / WindsurfAll six + --print-configClaude Desktop + --print helperClaude Desktop, CursorClaude Desktop, Claude Code
Voice cloning from a sampleReference audio URLYes (voice library)Yes–
Subtitles from your own audio/video (speech)SRT, VTT, TXT, JSONSpeech-to-text (text)OCR of burned-in subtitles–
Script → audio + captions in one callYes––Audio + SRT
Captions keep exact script spellingYes––Yes (from TTS)
No duplicate jobs on retry (idempotency keys) + resume by task IDYes–––

Where the others are ahead: ElevenLabs and AllVoiceLab cover more audio tasks (sound effects, voice changer, dubbing, agents), and better-tts-mcp needs no key and offers batch and multi-voice synthesis. This server stays focused on the video-creator loop of script → voiceover → captions and does that one loop end to end.

FAQ

What is a TTS MCP server?

A TTS (text-to-speech) MCP server is a small program that exposes speech synthesis as tools over the Model Context Protocol, so an AI agent such as Claude or Cursor can turn text into an audio file on request. tts-mcp-server adds voice cloning, speech-to-text subtitles and a one-call script → voiceover + SRT/VTT workflow on top.

How do I install a text to speech MCP server in Claude Code?

Run claude mcp add tts -s user -e MIRAGEA_API_KEY=<your-miragea-api-key> -- uvx tts-mcp-server, then ask Claude to "read this paragraph aloud and save it as MP3". Use uvx tts-mcp-server --print-config <client> for Claude Desktop, Cursor, Codex, VS Code or Windsurf.

Is there a free text to speech MCP server?

The server itself is free, open-source software (MIT). Speech is generated by the Miragea voice engine, so you need a Miragea API key. If you need a keyless option, better-tts-mcp uses Microsoft Edge read-aloud, and kokoro-tts-mcp runs a local model; neither does voice cloning or subtitles from your own audio.

Is this an alternative to the ElevenLabs MCP server?

Yes, for the voiceover use case. Like elevenlabs-mcp it installs with uvx and gives agents text-to-speech and voice cloning; unlike it, one tool call returns the audio together with SRT/VTT captions that keep your exact script wording. ElevenLabs covers more audio tasks (sound effects, voice changer, conversational agents); see How it compares.

How do I add text-to-speech to Claude Desktop?

Add the tts block from Claude Desktop to claude_desktop_config.json, put your Miragea API key in env, and restart Claude. Claude can then call miragea_text_to_speech and save MP3 files to ~/Miragea.

How do I generate SRT subtitles from a video with an AI agent?

Ask the agent to run miragea_transcribe on the file (for example, "make SRT and VTT subtitles for ~/Videos/clip.mp4"). The server uploads it to Miragea speech recognition and writes clip.srt / clip.vtt.

Can an MCP server make a voiceover with matching captions for YouTube Shorts or TikTok?

Yes. miragea_script_to_voiceover returns the audio plus SRT/VTT captions timed to that audio, with cues capped at 42 characters by default for vertical video. Import both into CapCut, Premiere Pro or DaVinci Resolve.

Does it support voice cloning?

Yes. Pass reference_audio_url (a public http(s) link to a clean sample) and, ideally, reference_text with the exact words spoken in it. Supplying the exact text gives the most faithful clone; if you omit it, Miragea recognizes it automatically. Only clone voices you have the right to use.

Does it work with Cursor, Claude Code and OpenAI Codex?

Yes, with any MCP client that supports stdio servers. Run uvx tts-mcp-server --print-config cursor (or claude-code, codex, vscode, windsurf, claude-desktop) for a ready snippet.

Which audio formats can I export?

MP3 (default), WAV, FLAC, Opus, AAC and PCM. Subtitles: SRT, WebVTT, plain text, and JSON with timed segments.

Can I use it without an API key or with another TTS engine?

No. Miragea is the only voice engine; there is no hidden fallback. Without a key the server still starts and lists its tools, and every call explains how to add the key.

Is my API key safe?

The key stays in your local MCP config or environment. The server never prints or logs it, redacts it from errors, sends it only to the Miragea API root (redirects are refused), and never sends it to the audio download URL.

What happens if a long voiceover times out?

The job keeps running on Miragea. The tool returns the task_id; ask the agent to call miragea_get_task with wait=true to download the result. Don't resubmit, because that would create a duplicate job.

Can I use it in Python scripts or n8n instead of chat?

Any MCP-capable runtime works. For plain scripts, call the Miragea REST API directly (guide, OpenAPI schema).

Troubleshooting

SymptomFix
MIRAGEA_API_KEY is not setAdd the key to the server's env block (not your shell profile, for GUI clients) and fully restart the client.
HTTP 401 invalid_api_keyThe key is wrong or revoked. Create a new one at miragea.ai/workspace/api. Run uvx tts-mcp-server --check.
HTTP 403The account has no API access right now; check it in your Miragea account. cloudflare_blocked means a proxy or VPN is being challenged; try another network.
HTTP 429Rate-limited or an account limit was reached. Check your Miragea account, or wait and retry.
Text is N characters but this account allows MSplit the script into parts under audio.max_text_length and generate them one by one.
wait_timeoutThe job is still running. Use miragea_get_task with the returned task_id. Raise MIRAGEA_WAIT_TIMEOUT and your client's tool timeout (Codex: tool_timeout_sec).
Client tool call times out firstCall with wait=false, then poll with miragea_get_task.
spawn uvx ENOENTThe GUI app can't find uvx. Use its absolute path (which uvx / where uvx) as command.
Tag(s) … are not availableTags are per model. List them with miragea_get_capabilities.
reference_audio_url must be a public http(s) URLMiragea downloads the sample server-side. Upload it somewhere public (not localhost, not a file path).
Where are my files?~/Miragea by default, or MIRAGEA_OUTPUT_DIR. Each tool returns the exact path.

Logs go to stderr, which your client keeps (Claude Desktop on macOS: ~/Library/Logs/Claude/mcp-server-tts.log).

Companion Agent Skill

skills/miragea-voiceover/SKILL.md is an Agent Skill that teaches Claude a script-to-voiceover workflow on top of these tools: tightening a script for speech, choosing a voice and tone, confirming long jobs first, and delivering audio and captions for each platform. Copy the folder into ~/.claude/skills/ (Claude Code) or upload it as a skill in Claude. It is also published on its own in RTY2345RR/miragea-agent-skills with install steps for Claude Code, Codex and Cursor.

Development

bash
git clone https://github.com/RTY2345RR/miragea-voice-mcp && cd miragea-voice-mcpuv venv && uv pip install -e ".[dev]"pytest                                   # offline; HTTP is mockednpx @modelcontextprotocol/inspector uvx --from . tts-mcp-server

The server wraps only the documented Miragea endpoints: GET /capabilities, GET /actors, POST /audio/generations, POST /subtitles/recognitions, GET /tasks/{id}, GET /tasks (API guide). VTT and short-cue splitting are local formatting of Miragea's timed segments.

Links

License

MIT. "Miragea" is the voice engine this server connects to (voiceover, voice cloning, speech recognition). Use cloned voices only with the speaker's consent.

来源:README.md,提交 685f478

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.1最新Nov 8, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分