Skip to main content
Glama
elevenlabs

ElevenLabs MCP Server

Official
by elevenlabs

speech_to_speech

Convert audio files to different voices using ElevenLabs' voice transformation technology. Saves the modified audio to your computer for flexible voice customization.

Instructions

Transform audio from one voice to another using provided audio files. Saves output file to directory (default: $HOME/Desktop).

⚠️ COST WARNING: This tool makes an API call to ElevenLabs which may incur costs. Only use when explicitly requested by the user.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
input_file_pathYes
voice_nameNoAdam
output_directoryNo

Implementation Reference

  • The @mcp.tool decorator registers the speech_to_speech tool and defines its handler function, which converts input audio to speech in a target voice using the ElevenLabs speech_to_speech.convert API.
    @mcp.tool( description=f"""Transform audio from one voice to another using provided audio files. {get_output_mode_description(output_mode)}. ⚠️ COST WARNING: This tool makes an API call to ElevenLabs which may incur costs. Only use when explicitly requested by the user. """ ) def speech_to_speech( input_file_path: str, voice_name: str = "Adam", output_directory: str | None = None, ) -> Union[TextContent, EmbeddedResource]: voices = client.voices.search(search=voice_name) if len(voices.voices) == 0: make_error("No voice found with that name.") voice = next((v for v in voices.voices if v.name == voice_name), None) if voice is None: make_error(f"Voice with name: {voice_name} does not exist.") assert voice is not None # Type assertion for type checker file_path = handle_input_file(input_file_path) output_path = make_output_path(output_directory, base_path) output_file_name = make_output_file("sts", file_path.name, "mp3") with file_path.open("rb") as f: audio_bytes = f.read() audio_data = client.speech_to_speech.convert( model_id="eleven_multilingual_sts_v2", voice_id=voice.voice_id, audio=audio_bytes, ) audio_bytes = b"".join(audio_data) # Handle different output modes return handle_output_mode(audio_bytes, output_path, output_file_name, output_mode)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/elevenlabs/elevenlabs-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server