Skip to main content
Glama

Servidor MCP de voz

Un servidor de protocolo de contexto de modelo que proporciona capacidades de conversión de texto a voz utilizando el modelo Kokoro TTS.

Configuración

El servidor se puede configurar utilizando las siguientes variables de entorno:

Variable

Descripción

Por defecto

Rango válido

MCP_DEFAULT_SPEECH_SPEED

Multiplicador de velocidad predeterminado para texto a voz

1.1

0,5 a 2,0

En el cursor:

{
  "mcpServers": {
    "speech": {
      "command": "npx",
      "args": [
        "-y",
        "speech-mcp-server"
      ],
      "env": {
        MCP_DEFAULT_SPEECH_SPEED: 1.3
      }
    }
  }
}

Related MCP server: TTS-MCP

Características

  • 🎯 Texto a voz de alta calidad con el modelo Kokoro TTS

  • 🗣️ Múltiples opciones de voz disponibles

  • 🎛️ Parámetros de voz personalizables (voz, velocidad)

  • 🔌 Interfaz compatible con MCP

  • 📦 Fácil instalación y configuración

  • 🚀 No se requiere clave API

Instalación

# Using npm
npm install speech-mcp-server

# Using pnpm (recommended)
pnpm add speech-mcp-server

# Using yarn
yarn add speech-mcp-server

Uso

Ejecutar el servidor:

# Using default configuration
npm start

# With custom speech speed
MCP_DEFAULT_SPEECH_SPEED=1.5 npm start

El servidor proporciona las siguientes herramientas MCP:

  • text_to_speech : Conversión básica de texto a voz

  • text_to_speech_with_options : Conversión de texto a voz con velocidad personalizable

  • list_voices : Lista todas las voces disponibles

  • get_model_status : verifica el estado de inicialización del modelo TTS

Desarrollo

# Clone the repository
git clone <your-repo-url>
cd speech-mcp-server

# Install dependencies
pnpm install

# Start development server with auto-reload
pnpm dev

# Build the project
pnpm build

# Run linting
pnpm lint

# Format code
pnpm format

# Test with MCP Inspector
pnpm inspector

Herramientas disponibles

1. texto a voz

Convierte texto en voz utilizando la configuración predeterminada.

{
  "type": "request",
  "id": "1",
  "method": "call_tool",
  "params": {
    "name": "text_to_speech",
    "arguments": {
      "text": "Hello world",
      "voice": "af_bella"  // optional
    }
  }
}

2. texto a voz con opciones

Convierte texto en voz con parámetros personalizables.

{
  "type": "request",
  "id": "1",
  "method": "call_tool",
  "params": {
    "name": "text_to_speech_with_options",
    "arguments": {
      "text": "Hello world",
      "voice": "af_bella",  // optional
      "speed": 1.0,         // optional (0.5 to 2.0)
    }
  }
}

3. lista_voces

Enumera todas las voces disponibles para la conversión de texto a voz.

{
  "type": "request",
  "id": "1",
  "method": "list_voices",
  "params": {}
}

4. obtener_estado_del_modelo

Verifique el estado actual de la inicialización del modelo TTS. Esto es especialmente útil al iniciar el servidor por primera vez, ya que es necesario descargar e inicializar el modelo.

{
  "type": "request",
  "id": "1",
  "method": "call_tool",
  "params": {
    "name": "get_model_status",
    "arguments": {}
  }
}

Ejemplo de respuesta:

{
  "content": [{
    "type": "text",
    "text": "Model status: initializing (5s elapsed)"
  }]
}

Posibles valores de estado:

  • uninitialized : la inicialización del modelo no ha comenzado

  • initializing : el modelo se está descargando e inicializando

  • ready : El modelo está listo para usar.

  • error : Se produjo un error durante la inicialización

Pruebas

Puede probar el servidor utilizando el Inspector MCP o enviando mensajes JSON sin procesar:

# List available tools
echo '{"type":"request","id":"1","method":"list_tools","params":{}}' | node dist/index.js

# List available voices
echo '{"type":"request","id":"2","method":"list_voices","params":{}}' | node dist/index.js

# Convert text to speech
echo '{"type":"request","id":"3","method":"call_tool","params":{"name":"text_to_speech","arguments":{"text":"Hello world","voice":"af_bella"}}}' | node dist/index.js

Integración con Claude Desktop

Para utilizar este servidor con Claude Desktop, agregue lo siguiente a su archivo de configuración de Claude Desktop ( ~/Library/Application Support/Claude/claude_desktop_config.json ):

{
  "servers": {
    "speech": {
      "command": "npx",
      "args": ["@decodershq/speech-mcp-server"]
    }
  }
}

Contribuyendo

¡Agradecemos sus contribuciones! No dude en enviar una solicitud de incorporación de cambios.

Licencia

Licencia MIT: consulte el archivo LICENCIA para obtener más detalles.

Solución de problemas

Problemas de inicialización del modelo

El servidor intenta descargar e inicializar automáticamente el modelo TTS al iniciarse. Si se producen errores de inicialización:

  1. El servidor lo intentará nuevamente automáticamente hasta 3 veces con una limpieza entre intentos.

  2. Utilice la herramienta get_model_status para supervisar el progreso de la inicialización y cualquier error

  3. Si la inicialización falla después de todos los reintentos, intente eliminar manualmente los archivos del modelo:

# Remove model files (MacOS/Linux)
rm -rf ~/.npm/_npx/**/node_modules/@huggingface/transformers/.cache/onnx-community/Kokoro-82M-v1.0-ONNX/onnx/model_quantized.onnx
rm -rf ~/.cache/huggingface/transformers/onnx-community/Kokoro-82M-v1.0-ONNX/onnx/model_quantized.onnx

# Then restart the server
npm start

La herramienta get_model_status ahora incluirá información de reintento en su respuesta:

{
  "content": [{
    "type": "text",
    "text": "Model status: initializing (5s elapsed, retry 1/3)"
  }]
}

Available Tools

4 tools
get_model_statusB

Get the current status of the TTS model initialization

Inputs: no named parameters.

list_voicesB

List all available voices for text-to-speech

Inputs: no named parameters.

text_to_speechB

Convert text to speech and play it through system audio

Inputs: text (required), voice.

text_to_speech_with_optionsC

Convert text to speech with customizable speed

Inputs: text (required), voice, speed.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 4 tools

    Disambiguation4/5

    The tools are mostly distinct, but 'text_to_speech' and 'text_to_speech_with_options' could cause confusion as they overlap in core functionality. The other tools ('get_model_status' and 'list_voices') have clear, unique purposes related to system status and voice selection.

    Naming Consistency5/5

    All tool names follow a consistent snake_case pattern with clear verb_noun structures (e.g., 'get_model_status', 'list_voices', 'text_to_speech'). There are no deviations in naming conventions across the set.

    Tool Count4/5

    Four tools is a reasonable count for a speech-focused server, though it feels slightly minimal. The tools cover key aspects like status, voice listing, and speech generation, but could potentially benefit from one or two more operations (e.g., stop speech or adjust volume) for better scope.

    Completeness3/5

    The server provides core text-to-speech functionality with status and voice listing, but lacks operations for managing speech playback (e.g., pause, stop, or volume control) and advanced customization beyond speed. This creates minor gaps that agents might need to work around for full speech interaction.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that integrates high-quality text-to-speech capabilities with Claude Desktop and other MCP-compatible clients, supporting multiple voice options and audio formats.
      1
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that provides text-to-speech functionality for AI agents using Microsoft Edge's text-to-speech technology, supporting multiple voices, languages, and voice customization.
      2
      8
      MIT