Kokoro Text to Speech MCP Server
Servidor MCP de texto a voz (TTS) de Kokoro
Servidor MCP de texto a voz Kokoro que genera archivos .mp3 con opción de cargar a S3.
Usos: https://huggingface.co/spaces/hexgrad/Kokoro-TTS
Related MCP server: MCP Voice Soundboard
Configuración
Clonar a un repositorio local.
Descargue los pesos Kokoro Onnx para kokoro-v1.0.onnx y voices-v1.0.bin y guárdelos en el mismo repositorio.
Agregue lo siguiente a sus configuraciones de MCP. Actualícelo con sus propios valores.
"kokoro-tts-mcp": {
"command": "uv",
"args": [
"--directory",
"/path/toyourlocal/kokoro-tts-mcp",
"run",
"mcp-tts.py"
],
"env": {
"TTS_VOICE": "af_heart",
"TTS_SPEED": "1.0",
"TTS_LANGUAGE": "en-us",
"AWS_ACCESS_KEY_ID": "",
"AWS_SECRET_ACCESS_KEY": "",
"AWS_REGION": "us-east-1",
"AWS_S3_FOLDER": "mp3",
"S3_ENABLED": "true",
"MP3_FOLDER": "/path/to/mp3"
}
}Instalar ffmmeg
Esto es necesario para convertir archivos .wav a .mp3
Para Mac:
brew install ffmpegPara ejecutar localmente, agréguelos a su archivo .env. Consulte env.example, cópielos a .env y modifíquelos con sus propios valores.
Variables de entorno admitidas
AWS_ACCESS_KEY_ID: Su ID de clave de acceso de AWSAWS_SECRET_ACCESS_KEY: Su clave de acceso secreta de AWSAWS_S3_BUCKET_NAME: nombre del depósito S3AWS_S3_REGION: región S3 (por ejemplo, us-east-1)AWS_S3_FOLDER: Ruta de la carpeta dentro del depósito S3AWS_S3_ENDPOINT_URL: URL de punto final personalizada opcional para almacenamiento compatible con S3MCP_HOST: Host al que vincular el servidor (predeterminado: 0.0.0.0)MCP_PORT: Puerto para escuchar (predeterminado: 9876)MCP_CLIENT_HOST: Nombre de host para las conexiones del cliente al servidor (predeterminado: localhost)DEBUG: Habilitar el modo de depuración (establecido en "verdadero" o "1")S3_ENABLED: Habilitar cargas S3 (establecido en "verdadero" o "1")MP3_FOLDER: Ruta para almacenar archivos MP3 (el valor predeterminado es la carpeta 'mp3' en el directorio de scripts)MP3_RETENTION_DAYS: Número de días que se conservarán los archivos MP3 antes de su eliminación automáticaDELETE_LOCAL_AFTER_S3_UPLOAD: Si se deben eliminar los archivos MP3 locales después de una carga S3 exitosa (establecido en "verdadero" o "1")TTS_VOICE: Voz predeterminada para el cliente TTS (predeterminado: af_heart)TTS_SPEED: Velocidad predeterminada para el cliente TTS (valor predeterminado: 1.0)TTS_LANGUAGE: idioma predeterminado para el cliente TTS (predeterminado: en-us)
Ejecución del servidor local
El método preferido es utilizar UV.
uv run mcp-tts.pyUso del cliente TTS
El script mcp_client.py permite enviar solicitudes TTS al servidor. Se puede usar de la siguiente manera:
Configuración de conexión
Al ejecutar el servidor y el cliente en la misma máquina:
El servidor debe vincularse a
0.0.0.0(todas las interfaces) o127.0.0.1(solo localhost)El cliente debe conectarse al
localhosto127.0.0.1
Uso básico
python mcp_client.py --text "Hello, world!"Leer texto de un archivo
python mcp_client.py --file my_text.txtPersonalización de la voz y la velocidad
python mcp_client.py --text "Hello, world!" --voice "en_female" --speed 1.2Deshabilitar la carga de S3
python mcp_client.py --text "Hello, world!" --no-s3Opciones de la línea de comandos
python mcp_client.py --helpGestión de archivos MP3
El servidor TTS genera archivos MP3 que se almacenan localmente y, opcionalmente, se suben a S3. Puede configurar la gestión de estos archivos:
Almacenamiento local
Establezca
MP3_FOLDERen su archivo.envpara especificar dónde se almacenan los archivos MP3Los archivos se guardan en esta carpeta a menos que se eliminen automáticamente
Limpieza automática
Establezca
MP3_RETENTION_DAYS=30(o cualquier número) para eliminar automáticamente los archivos con más días de antigüedadEstablezca
DELETE_LOCAL_AFTER_S3_UPLOAD=truepara eliminar archivos locales inmediatamente después de una carga S3 exitosa
Integración S3
Habilitar o deshabilitar las cargas S3 con
S3_ENABLED=trueoDISABLE_S3=trueConfigurar las credenciales de AWS y la configuración del depósito en el archivo
.envLas cargas S3 se pueden deshabilitar por solicitud utilizando la opción
--no-s3del cliente
Available Tools
1 tooltext_to_speechB
Convert text to speech using the Kokoro TTS service.
Args:
text: The text to convert to speech
voice: Voice ID to use (default: af_heart)
speed: Speech speed (default: 1.0)
lang: Language code (default: en-us)
filename: Optional filename for the MP3 (default: auto-generated UUID)
upload_to_s3: Whether to upload to S3 if enabled (default: True)
Returns:
A dictionary with information about the generated audio file
Inputs: text (required), voice, speed, lang, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool has a clearly defined purpose of converting text to speech, which cannot be confused with any other functionality.
The single tool name 'text_to_speech' follows a clear verb_noun pattern and uses snake_case consistently. With only one tool, naming consistency is inherently perfect as there are no other tools to compare against.
A single tool is too few for a server's apparent scope of text-to-speech functionality. While the tool itself is well-defined, a complete TTS service would typically include additional tools such as listing available voices, managing audio files, or configuring settings, making this server feel thin and incomplete.
The server is severely incomplete for a text-to-speech domain. It lacks essential operations such as listing available voices, checking service status, managing generated audio files (beyond the single generation tool), or handling configuration. This creates significant gaps that will limit agent workflows and cause failures in more complex tasks.
Maintenance
Related MCP Connectors
Hosted text-to-speech MCP server: 66 voices in 9 languages, long-form narration, podcasts.
Turn text into speech, browse voices, and get MP3 audio with optional SRT or WebVTT captions.
Text to speech MCP server: send articles or AI-written text to a private podcast RSS feed.
MCP server for Text-to-Speech
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol server that provides text-to-speech capabilities using the Kokoro TTS model, offering multiple voice options and customizable speech parameters.642MIT
- AlicenseNot gradedqualityBmaintenanceA text-to-speech MCP server with 48 voices across 9 languages, supporting emotion spans, SFX tags, and multi-speaker dialogue. Deployable via a single npx command with built-in guardrails and swappable backends.MIT
- AlicenseNot gradedqualityDmaintenanceAn OpenAI-compatible text-to-speech API server that enables voice cloning, long-form generation, and can be used as a Claude Code tool for speech synthesis.MIT
- AlicenseNot gradedqualityDmaintenanceHeadless text-to-speech and speech-to-text server with REST and MCP API, supporting Kokoro TTS and Whisper STT.MIT