Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ElevenLabs MCP TTS Server

A Model Context Protocol (MCP) server that integrates ElevenLabs Text-to-Speech with OpenCode, allowing the assistant to speak its responses aloud.

Features

  • Native integration with OpenCode through MCP
  • Support for all ElevenLabs voices
  • Automatic audio playback on Linux (PulseAudio)
  • Simple and secure configuration
  • Clean and documented code

Requirements

  • Node.js 16+
  • ElevenLabs API key
  • PulseAudio (for audio playback on Linux)
  • OpenCode with MCP support

Installation

  1. Clone the repository:
git clone https://github.com/kurojs/elevenlabs-mcp-tts.git
cd elevenlabs-mcp-tts
  1. Install dependencies:
npm install
  1. Configure your API key in the server file:
nano src/server.js

Update line 64 with your ElevenLabs API key.

Configuration with OpenCode

  1. Edit OpenCode configuration file:
nano ~/.config/opencode/opencode.json
  1. Add the MCP server:
{
  "mcp": {
    "elevenlabs-tts": {
      "type": "local",
      "command": ["node", "/home/kuro/mcp-tts/server.js"],
      "enabled": true
    }
  }
}
  1. Restart OpenCode

Usage

Once configured, you can use the tool in OpenCode:

use text_to_speech to say "hello world"

Or for automatic responses:

from now on, use text_to_speech for all your responses

Parameters

The text_to_speech tool accepts these parameters:

  • text (required): Text to convert
  • voice_id (optional): Voice ID (default: 01Sca6E8phd1rq7mKoii)
  • model_id (optional): Model (default: eleven_multilingual_v2)

Popular Voices

  • CwhRBWXzGAHq8TQ4Fs17 - Roger (English, widely available)
  • EXAVITQu4vr4xnSDxMaL - Sarah (English)
  • FGY2WhTYpPnrIDTdsKH5 - Laura (English)
  • IKne3meq5aSn9XLyUdCD - Charlie (English)

Troubleshooting

Audio not playing:

  • Check that PulseAudio is working: pactl info
  • Make sure you have audio drivers installed
  • Check system volume

API key error:

  • Verify the API key in server.js is valid
  • Make sure you have credits in ElevenLabs
  • Check that the API key is correctly configured in the server file

OpenCode can't find the server:

  • Verify the path in the configuration file
  • Make sure the server.js file is executable
  • Check directory permissions

Testing

To test the MCP server manually:

echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {}}' | node src/server.js

Development

For development with auto-reload:

npm run dev

Contributing

  1. Fork the project
  2. Create a branch: git checkout -b feature/new-feature
  3. Commit: git commit -am 'Add new feature'
  4. Push: git push origin feature/new-feature
  5. Pull Request

License

MIT License - see LICENSE file for details.

Useful Links

Acknowledgments

  • ElevenLabs for the amazing TTS API
  • OpenCode for MCP support
  • The open source community

About

MCP server that gives AI assistants (OpenCode/Claude) a voice. ElevenLabs Text-to-Speech with 30+ AI voices, voice cloning, SSML, and automatic audio playback via PulseAudio — for any MCP host.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages