Skip to main content

better-tts-mcp

PyPI version Python Version License: MIT MCP Edge TTS

English | 中文

A feature-rich MCP (Model Context Protocol) server for Microsoft Edge Text-to-Speech. No API key required. 300+ voices in 50+ languages. Zero configuration.


Features

  • List Voices — Browse 300+ voices in 50+ languages, filter by language and gender
  • Text-to-Speech — Convert text to MP3 with customizable rate, volume, and pitch
  • Subtitles — Generate SRT subtitle files alongside audio
  • Batch Processing — Synthesize multiple texts in one call
  • Multi-Voice Synthesis — Mix multiple voices in one output MP3 using [voice]text markers

Quick Start

Installation

# Using uvx (recommended)
uvx better-tts-mcp

# Or install via pip
pip install better-tts-mcp

Claude Code

claude mcp add edge-tts -- uvx better-tts-mcp

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "edge-tts": {
      "command": "uvx",
      "args": ["better-tts-mcp"]
    }
  }
}

Available Tools

list_voices

List available Edge TTS voices with optional filtering.

Parameter Type Required Description
language string No Filter by language code, e.g. "zh", "en"
gender string No Filter by gender: "Male" or "Female"

text_to_speech

Convert text to speech and save as MP3.

Parameter Type Required Default Description
text string Yes — Text to convert
voice string No zh-CN-XiaoxiaoNeural Voice name
rate string No — Speed, e.g. "+50%", "-30%"
volume string No — Volume, e.g. "+20%", "-50%"
pitch string No — Pitch, e.g. "+10Hz", "-5Hz"
output_dir string No . (current directory) Output directory

text_to_speech_with_subtitles

Same parameters as text_to_speech. Generates both MP3 and SRT files.

batch_text_to_speech

Convert multiple texts to speech, each saved as a separate MP3 file.

Parameter Type Required Default Description
texts string[] Yes — List of texts to convert
voice string No zh-CN-XiaoxiaoNeural Voice name (shared for all texts)
rate string No — Speed (shared)
volume string No — Volume (shared)
pitch string No — Pitch (shared)
output_dir string No . (current directory) Output directory

text_to_speech_multi_voice

Convert text with voice markers into one merged MP3 file.

Format example:

[zh-CN-XiaoxiaoNeural]你好。[en-US-AriaNeural]Hello.
Parameter Type Required Default Description
text string Yes — Input text with optional [voice] markers
default_voice string No zh-CN-XiaoxiaoNeural Voice used when no marker is present
rate string No — Speed adjustment
volume string No — Volume adjustment
pitch string No — Pitch adjustment
output_dir string No . (current directory) Output directory

MCP Integration Contract (for external callers)

This server follows the MCP tool-call flow used by standard MCP clients:

  • initialize -> capability negotiation
  • tools/list -> discover tool names and JSON schemas
  • tools/call -> invoke a tool by name with arguments

Transport:

  • Default transport is stdio (entrypoint: better-tts-mcp)

Tool call example (tools/call)

{
  "method": "tools/call",
  "params": {
    "name": "text_to_speech",
    "arguments": {
      "text": "Hello from MCP",
      "voice": "en-US-AriaNeural",
      "rate": "+0%",
      "volume": "+0%",
      "pitch": "+0Hz",
      "output_dir": "./outputs"
    }
  }
}

Typical successful result text:

Audio saved to: /absolute/path/to/outputs/20260307_123456_Hello_from_MCP.mp3

Return-value conventions

  • All tools return human-readable text in content.
  • All tools also return machine-readable structuredContent with stable fields (ok, message, etc.) for robust LLM/tooling integration.
  • Paths returned by synthesis tools are absolute paths.
  • text_to_speech_with_subtitles returns two lines (audio path + subtitle path).
  • batch_text_to_speech returns a summary header plus one output path per item.

Error behavior

  • Malformed requests (JSON-RPC or schema-level) are protocol errors.
  • Input validation and business/runtime failures are returned as tool execution errors with isError: true, so LLM clients can self-correct and retry.
  • Error payloads include error_code, error_message, and retryable in structuredContent.

Common error codes:

  • EMPTY_TEXT
  • EMPTY_TEXTS
  • EMPTY_TEXT_ITEM
  • EMPTY_TEXT_SEGMENTS
  • INVALID_RATE
  • INVALID_VOLUME
  • INVALID_PITCH
  • SYNTHESIS_FAILED

Stability notes for API consumers

  • Tool names are treated as stable API surface:
    • list_voices
    • text_to_speech
    • text_to_speech_with_subtitles
    • batch_text_to_speech
    • text_to_speech_multi_voice
  • New optional parameters may be added in future versions without breaking existing callers.

Requirements

  • Python >= 3.10
  • Internet connection (for accessing Microsoft Edge TTS service)

License

MIT

Metadata

Release files for better-tts-mcp 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for better-tts-mcp 0.2.0
File Size Uploaded Provenance
better_tts_mcp-0.2.0.tar.gz 11.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for better-tts-mcp 0.2.0
File Interpreter ABI Platform
better_tts_mcp-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.1 kB

Release files / better_tts_mcp-0.2.0.tar.gz

Download URL better_tts_mcp-0.2.0.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0365af282521a788c1d17290ce11901c8b7a2e8ef3be7899d4aa6633f24cd45a
BLAKE2b-256 checksum
How to use checksums
74475b25243a0c25eaa0a627f73ebce5f815d8fffd74abe73e5c048673ac08f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.1

Release files / better_tts_mcp-0.2.0-py3-none-any.whl

Download URL better_tts_mcp-0.2.0-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
632747e8cead504827ee7a7e682fdde06b79db1f8a48561e82bc79c4e1c5ecdc
BLAKE2b-256 checksum
How to use checksums
16b33c65c10697bef92293be6c3ce6a74273a9b83daa2a088a2c6ced9cf917c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.1

Security for better-tts-mcp 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page