Skip to main content
Glama
MCPGeneration-for-ElevenLabs

MCPGeneration-for-ElevenLabs

MCPGeneration-for-ElevenLabs

Servidor MCP local por stdio para usar APIs oficiais da ElevenLabs com validação de pedidos, controlo de custos, armazenamento local e exportação de áudio para Godot. O código deste repositório foi desenvolvido de raiz; não depende de outro MCP.

Estado

  • Node.js 24+, TypeScript 6, MCP TypeScript SDK v2, SDK JavaScript oficial ElevenLabs e SQLite.

  • DRY_RUN=true e ALLOW_PAID_GENERATIONS=false por padrão. Nenhuma ferramenta de geração envia pedidos pagos sem a política local e a autorização por chamada.

  • Os pedidos HTTP são validados contra o snapshot OpenAPI oficial incluído em src/schemas/elevenlabs-openapi.json.

  • O servidor inicia sem uma chave API para permitir descobrir as ferramentas e usar operações locais; chamadas remotas falham com missing_api_key.

  • Suporte parcial e itens em falta estão detalhados em docs/API_MATRIX.md e docs/IMPLEMENTATION_REPORT.md.

Related MCP server: ElevenLabs MCP Server

Requisitos

  • Node.js 24 ou superior e npm.

  • FFmpeg e FFprobe no PATH para conversão, corte, loops, mistura e exportação Godot.

  • Chave de API ElevenLabs para operações remotas. A disponibilidade depende da conta, permissões, plano e modelo; o servidor não presume acesso Starter.

O ambiente de desenvolvimento usado para esta implementação não tem FFmpeg/FFprobe. O servidor e os testes offline não dependem deles, mas as transformações locais requerem a instalação dos binários.

Instalação

npm ci
cp .env.example .env.local

Edite .env.local e defina ELEVENLABS_API_KEY. O arquivo é ignorado pelo Git. Por segurança, mantenha DRY_RUN=true até estar pronto para autorizar geração paga.

npm run build
npm run doctor
npm start

npm start comunica apenas pelo protocolo MCP em stdio; não o execute num terminal interativo como se fosse uma CLI. Use npm run dev durante o desenvolvimento.

Custos e autorização

Leia docs/COST_MANAGEMENT.md. Para ativar gerações pagas, defina DRY_RUN=false e ALLOW_PAID_GENERATIONS=true; cada chamada de geração também exige allow_paid=true. Como a API não fornece um custo de pré-validação confiável para todas as famílias, o custo desconhecido requer allow_unknown_cost=true para cada pedido. Estes controlos são uma barreira local, não uma estimativa de preço ou substituto dos limites da conta ElevenLabs.

create_composition_plan é documentado pela ElevenLabs como sem consumo de créditos, mas continua sujeito a autenticação e rate limits. Consultas e downloads de resultados existentes são operações de leitura.

Ferramentas

As ferramentas estão agrupadas em conta/capacidades, TTS, diálogo, efeitos sonoros, música, vozes, transcrição/alinhamento, dobragem, imagens/vídeo, Flows/assets, histórico, orçamento e gestão local de mídia. Para schemas e parâmetros, consulte docs/TOOL_REFERENCE.md.

Exemplos de ferramentas locais:

  • get_budget_status, estimate_cost, set_local_budget

  • inspect_media, convert_audio, normalize_audio, trim_audio, loop_audio, split_audio, merge_audio

  • export_to_godot, extract_music_stems, get_sound_effect_presets

Exemplos de geração (pagamento bloqueado por padrão):

  • generate_speech, generate_speech_with_timestamps, generate_dialogue

  • generate_sound_effect, generate_ambient_audio

  • generate_music, generate_music_detailed, generate_music_from_video, separate_music_stems

  • design_voice, clone_voice, transcribe_audio, align_audio_to_text, isolate_voice

Armazenamento e segurança

  • Saídas em generated/; SQLite e eventos locais em data/.

  • Caminhos de entrada limitados a GENERATED_DIR e ALLOWED_ROOTS.

  • Escritas atómicas, verificação de assinaturas, limites de bytes, prevenção de symlink/traversal e download restrito a URLs assinadas da ElevenLabs no domínio esperado.

  • Clonagem e finetunes exigem confirmação de direitos; exclusões remotas exigem confirmação explícita.

  • Logs vão para stderr; stdout fica reservado ao MCP.

Mais detalhes em docs/SECURITY.md.

Integrar com Codex ou Claude Code

Compile primeiro. Copie e adapte os exemplos sem colocar a chave API em ficheiros de configuração versionados:

As instruções atuais dos clientes estão em Codex MCP e Claude Code MCP. Nenhuma configuração global do utilizador é alterada por este repositório.

Godot

export_to_godot recebe explicitamente a pasta autorizada do projeto, converte conforme o perfil escolhido, escreve o áudio e atualiza .mcp-generation/assets.json. Consulte docs/GODOT_INTEGRATION.md e o exemplo em examples/godot/.

Desenvolvimento e verificações

npm run dev
npm run typecheck
npm run lint
npm run format:check
npm test
npm run check

npm run smoke:real é opt-in e não é incluído em check, testes ou CI. Sem --paid, consulta apenas a conta e os modelos. Uma chamada de geração requer --paid --confirm-paid-call --allow-unknown-cost, as duas autorizações de execução e ELEVENLABS_SMOKE_VOICE_ID. Consulte docs/IMPLEMENTATION_REPORT.md para os resultados realmente obtidos nesta máquina.

Fontes oficiais

Licença MIT. Consulte LICENSE.

Available Tools

89 tools
add_dubbing_languageB

Add one target-language job to a dubbing project. A language target may incur separate charges.

Inputs: project_id (required), target_language (required), allow_paid, allow_unknown_cost.

align_audio_to_textC

Align supplied text to a local audio file using the documented forced-alignment endpoint.

Inputs: text (required), input_path (required), filename, allow_paid, +1 more.

change_voiceC

Transform a local recording into a target voice through the documented speech-to-speech endpoint.

Inputs: filename (required), voice_id (required), input_path (required), model_id, +4 more.

clone_voiceA

Create an instant voice clone from local audio samples. Requires explicit rights/consent confirmation, up to three sample files, and both paid authorization gates.

Inputs: name (required), sample_paths (required), labels, allow_paid, +4 more.

convert_audioC

Convert a local audio file with FFmpeg. The requested output format is encoded and verified; changing an extension alone is not used.

Inputs: format (required), filename (required), input_path (required), overwrite.

create_async_speechC

Create speech through the separate ElevenCreative async flow API. The request is validated against the checked-in current OpenAPI contract.

Inputs: parameters (required), allow_paid, allow_unknown_cost.

create_audio_loopB

Repeat an audio file to a requested duration. The output is not claimed to have a seamless boundary.

Inputs: filename (required), input_path (required), duration_seconds (required), format, +1 more.

create_composition_planC

Ask the documented music planning endpoint to produce a structured plan. Official docs state this endpoint consumes no credits, but rate limits apply.

Inputs: prompt (required), model_id, music_length_ms.

create_dubbing_projectB

Create a dubbing project from a local audio/video file. This operation may charge before an output is produced and requires both paid authorization gates.

Inputs: input_path (required), model_id, reference, allow_paid, +3 more.

create_music_finetuneB

Create an optional music finetune from audio samples. Requires local enablement, rights confirmation, and both paid-operation gates.

Inputs: name (required), sample_paths (required), primary_genre (required), tags, +5 more.

create_voice_from_previewB

Save one previously generated preview as a reusable voice. Requires confirm_save=true and both paid-operation gates.

Inputs: voice_name (required), voice_description (required), generated_voice_id (required), allow_paid, +2 more.

delete_assetA

Permanently delete an asset from the ElevenLabs workspace. Requires explicit confirm_delete=true.

Inputs: asset_id (required), confirm_delete.

delete_dubbing_projectA

Permanently delete a dubbing project. Requires explicit confirm_delete=true.

Inputs: project_id (required), confirm_delete.

delete_history_itemA

Permanently delete one ElevenLabs history item. Requires explicit confirm_delete=true.

Inputs: history_item_id (required), confirm_delete.

delete_music_finetuneA

Permanently delete one music finetune. Requires explicit confirmation and local module enablement.

Inputs: finetune_id (required), confirm_delete.

delete_voiceA

Permanently delete a voice from the account. Requires explicit confirm_delete=true.

Inputs: voice_id (required), confirm_delete.

design_voiceB

Generate voice previews from a description. The API returns multiple sample audios; they are saved to local files and omitted from the tool response. This may consume credits.

Inputs: voice_description (required), seed, text, loudness, +6 more.

download_dubbed_mediaA

Download one completed dubbing language output to a local file. The output is saved only after the API responds successfully and its audio signature is checked.

Inputs: filename (required), project_id (required), language_id (required).

download_history_audioC

Download the audio for one history item to local storage.

Inputs: filename (required), history_item_id (required).

download_imageA

Download completed image output from the official signed generation URL, validate the URL host and file signature, then save it locally.

Inputs: filename (required), generation_id (required).

download_videoA

Download completed video output from the official signed generation URL, validate the URL host and file signature, then save it locally.

Inputs: filename (required), generation_id (required).

estimate_costC

Return an official estimate only when one is available. This local implementation does not invent per-character, per-second or per-generation prices.

Inputs: operation (required), text, model_id, duration_seconds.

export_to_godotB

Export one local audio asset to an explicitly supplied and authorized Godot project root. Requires that project root to be within ALLOWED_ROOTS.

Inputs: profile (required), input_path (required), project_root (required), relative_path (required), +1 more.

extract_music_stemsB

Safely extract supported audio tracks from a generated ZIP. Rejects traversal, symlinks, non-audio entries, and oversized expansions.

Inputs: zip_path (required), filename_prefix (required).

generate_ambient_audioC

Generate an ambient sound loop using the documented loop flag. The API does not guarantee a seamless loop beyond its own generation behavior.

Inputs: text (required), filename (required), loop, model_id, +5 more.

generate_dialogueC

Generate a multi-voice dialogue in input order. Enforces the documented unique voice and length limits. Paid authorization is required.

Inputs: inputs (required), filename (required), model_id, allow_paid, +5 more.

generate_dialogue_streamC

Call the documented streaming endpoint for a multi-voice dialogue and save the completed response locally.

Inputs: inputs (required), filename (required), model_id, allow_paid, +5 more.

generate_dialogue_stream_with_timestampsC

Call the streaming dialogue endpoint with the documented alignment response and save audio plus timing metadata.

Inputs: inputs (required), filename (required), model_id, allow_paid, +5 more.

generate_dialogue_with_timestampsC

Generate multi-voice dialogue with segment timing data. Paid authorization is required.

Inputs: inputs (required), filename (required), model_id, allow_paid, +5 more.

generate_imageB

Queue an ElevenCreative image generation. Pass model-specific parameters; the checked-in OpenAPI discriminator schema validates the model and its fields before any remote call. Disabled by default.

Inputs: prompt (required), model_id (required), allow_paid, parameters, +1 more.

generate_musicB

Compose music from either a prompt or a chunk-based plan. The request is checked against current documented constraints and remains behind both paid-operation gates.

Inputs: filename (required), seed, prompt, model_id, +5 more.

generate_music_detailedC

Generate music using the detailed endpoint, which returns audio and structured JSON metadata in a multipart response.

Inputs: filename (required), seed, prompt, model_id, +17 more.

generate_music_detailed_streamD

Call the detailed streaming music endpoint and save its multipart audio and metadata result locally.

Inputs: filename (required), seed, prompt, model_id, +17 more.

generate_music_from_videoC

Generate music from one or more local videos using the documented video-to-music endpoint. Paid authorization is required.

Inputs: filename (required), video_paths (required), tags, add_sfx, +7 more.

generate_music_streamC

Call the documented streaming music endpoint, then save the completed result locally behind both paid-operation gates.

Inputs: filename (required), seed, prompt, model_id, +5 more.

generate_sound_effectB

Generate one sound effect from a text prompt. Official maximum duration is 30 seconds. Cost is not estimated by this MCP; explicit authorization is required.

Inputs: text (required), filename (required), loop, model_id, +5 more.

generate_speechC

Generate and save speech audio. This may consume credits and is blocked by dry_run or either missing paid authorization gate.

Inputs: text (required), filename (required), voice_id (required), model_id, +5 more.

generate_speech_streamC

Call the documented streaming TTS endpoint and save its resulting audio. Streaming does not bypass the paid-operation gates.

Inputs: text (required), filename (required), voice_id (required), model_id, +5 more.

generate_speech_stream_with_timestampsC

Call streaming TTS with the documented alignment response. Audio and timing metadata are saved separately behind paid-operation gates.

Inputs: text (required), filename (required), voice_id (required), model_id, +5 more.

generate_speech_with_timestampsC

Generate speech with the documented alignment response. Audio and timing metadata are saved separately.

Inputs: text (required), filename (required), voice_id (required), model_id, +5 more.

generate_videoB

Queue an ElevenCreative video generation. Pass model-specific text, image, video or audio references; the official OpenAPI discriminator validates fields. Disabled by default.

Inputs: prompt (required), model_id (required), allow_paid, parameters, +1 more.

get_account_infoB

Read the authenticated ElevenLabs account profile. Makes a read-only API call.

Inputs: no named parameters.

get_api_request_historyB

Query the workspace API request log. This is a read-only analytics query despite using POST.

Inputs: sort, limit, search, end_time, +1 more.

get_assetC

Read metadata for one remote asset.

Inputs: asset_id (required).

get_async_speechB

Read the status and result of one ElevenCreative async speech generation and reconcile terminal state locally.

Inputs: generation_id (required).

get_budget_statusB

Read local generation policy, observed local usage and unsettled reservations.

Inputs: no named parameters.

get_capabilitiesB

Combine local implementation flags with read-only account and model information. Plan access remains unknown unless the API reports it.

Inputs: no named parameters.

get_dubbing_statusB

Read the current state and metadata of a dubbing project, reconciling a terminal job state with the local budget reservation.

Inputs: project_id (required).

get_flow_runC

Read a template run's status and reconcile its terminal state locally.

Inputs: run_id (required), template_id (required).

get_flow_templateC

Read a template definition and its input schema.

Inputs: template_id (required).

get_generation_history_itemB

Read metadata for one ElevenLabs history item.

Inputs: history_item_id (required).

get_image_generationC

Read the status of one image generation.

Inputs: generation_id (required).

get_music_finetuneB

Get metadata for one music finetune. The optional finetune module is disabled by default.

Inputs: finetune_id (required).

get_remote_usage_reportB

Query official workspace product usage between Unix millisecond timestamps. The endpoint may require workspace permissions.

Inputs: end_time (required), start_time (required), group_by, interval_seconds.

get_sound_effect_presetsA

Return editable local starter prompts for common game-audio categories. This is local guidance and does not contact ElevenLabs.

Inputs: category.

get_subscriptionB

Read the account subscription and documented usage fields. This does not estimate generation cost.

Inputs: no named parameters.

get_transcriptionC

Read an existing transcription job/result by its remote transcription ID.

Inputs: transcription_id (required).

get_usage_reportB

Read local operation counts and explicit usage values returned by the API. Character counts are not converted into credits.

Inputs: no named parameters.

get_video_generationC

Read the status of one video generation.

Inputs: generation_id (required).

get_voiceC

Read a single voice by ID.

Inputs: voice_id (required).

get_voice_previewB

Download an existing generated voice preview to a local MP3 file without generating a new sample.

Inputs: filename (required), generated_voice_id (required).

get_voice_settingsC

Read the saved settings for an ElevenLabs voice.

Inputs: voice_id (required).

inspect_mediaB

Inspect one local media file's size, hash, container, codec and duration when locally available.

Inputs: path (required).

isolate_voiceA

Isolate speech from a local audio recording. This is not a music stem separator.

Inputs: filename (required), input_path (required), allow_paid, allow_unknown_cost.

list_assetsC

List uploaded assets in the authenticated ElevenLabs workspace.

Inputs: cursor, page_size.

list_audio_effectsB

Read the documented audio effects catalog.

Inputs: no named parameters.

list_dubbing_projectsC

List dubbing projects using the documented page-size, cursor and status filters.

Inputs: cursor, status, page_size, sort_direction.

list_flow_templatesB

List published ElevenCreative templates.

Inputs: cursor, page_size.

list_generated_assetsC

List local files recorded in the asset registry.

Inputs: no named parameters.

list_generation_historyC

List ElevenLabs speech generation history with documented filters.

Inputs: search, source, model_id, voice_id, +5 more.

list_image_generationsC

List image generations from the ElevenCreative API.

Inputs: cursor, page_size.

list_modelsB

List models returned by ElevenLabs GET /v1/models.

Inputs: no named parameters.

list_music_finetunesC

List music finetunes in the workspace. This optional module is disabled by default.

Inputs: sort, cursor, page_size, created_by, +2 more.

list_video_generationsC

List video generations from the ElevenCreative API.

Inputs: cursor, page_size.

list_voicesC

Search the authenticated voice catalog through ElevenLabs GET /v2/voices.

Inputs: search, page_size, next_page_token.

merge_audioC

Concatenate local audio files through FFmpeg's audio concat filter.

Inputs: format (required), filename (required), input_paths (required), overwrite.

normalize_audioC

Normalize local audio loudness using the FFmpeg loudnorm filter.

Inputs: filename (required), input_path (required), format, overwrite.

remix_voiceB

Create new voice previews from one of your saved voices. Preview generation may consume credits and requires both paid-operation gates.

Inputs: voice_id (required), voice_description (required), seed, text, +11 more.

run_flow_templateB

Run a published template. Because its internal steps can generate media, cost is treated as unknown and both paid-operation gates are required.

Inputs: inputs (required), template_id (required), allow_paid, version_id, +1 more.

separate_music_stemsC

Separate an uploaded music file, retain the returned ZIP, and extract each verified audio stem into GENERATED_DIR.

Inputs: filename (required), input_path (required), allow_paid, stem_variation_id, +1 more.

set_local_budgetC

Change local request, monthly and concurrency policy limits. This does not enable paid calls.

Inputs: max_monthly_credits, max_credits_per_request, max_concurrent_generations.

split_audioC

Split local audio into segments of the requested maximum duration using FFmpeg.

Inputs: input_path (required), filename_prefix (required), segment_seconds (required).

transcribe_audioC

Transcribe a local audio or video file. Supports the API's model, diarization and timestamp controls. Cost is not estimated locally.

Inputs: input_path (required), diarize, filename, model_id, +6 more.

transcript_to_subtitlesB

Convert a local JSON transcript with word timestamps into SRT or WebVTT. Writes one caption per timed word to preserve source alignment.

Inputs: format (required), filename (required), input_path (required).

trim_audioC

Trim local audio using a start offset and duration in seconds.

Inputs: filename (required), input_path (required), start_seconds (required), duration_seconds (required), +2 more.

update_music_finetuneC

Update documented metadata fields for a music finetune. The optional module is disabled by default.

Inputs: finetune_id (required), name, tags, visibility, +1 more.

update_voice_settingsC

Update stored settings for one voice using the documented voice settings endpoint.

Inputs: settings (required), voice_id (required).

upload_assetB

Upload a local media file to the ElevenLabs Assets API. Requires rights confirmation and unknown-cost authorization because asset pricing is not estimated here.

Inputs: name (required), input_path (required), allow_paid, rights_confirmed, +1 more.

upload_musicC

Upload music for the documented later inpainting workflow. The official endpoint charges the same as song generation, so both paid gates apply.

Inputs: input_path (required), allow_paid, allow_unknown_cost, extract_composition_plan.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    C2.7/5.0

    Scored across 89 tools

    Disambiguation3/5

    The server has many intentionally parallel tools, especially non-streaming vs streaming vs timestamped variants for speech, dialogue, and music, plus several usage/budget/history read tools. Descriptions usually clarify boundaries, but the sheer number of near-duplicate generation paths makes misselection likely for an agent.

    Naming Consistency5/5

    Tool names consistently use snake_case verb_noun patterns such as generate_speech, list_voices, get_asset, delete_asset, and update_voice_settings. Minor suffixes like _stream and _with_timestamps are predictable and coherent.

    Tool Count1/5

    Eighty-nine tools is an extreme mismatch for a single MCP server, even one covering a broad media API. It far exceeds the practical 3-15 range and creates a large selection burden, duplicate pathways, and cognitive overhead.

    Completeness4/5

    The surface covers a very wide domain: TTS, dialogue, sound effects, music, dubbing, voices, history, assets, image/video generation, flows, and local FFmpeg operations. There are only minor lifecycle gaps, such as limited update operations for some resources, but no major dead ends.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers