# How to integrate Elevenlabs MCP with LlamaIndex

```json
{
  "title": "How to integrate Elevenlabs MCP with LlamaIndex",
  "toolkit": "Elevenlabs",
  "toolkit_slug": "elevenlabs",
  "framework": "LlamaIndex",
  "framework_slug": "llama-index",
  "url": "https://composio.dev/toolkits/elevenlabs/framework/llama-index",
  "markdown_url": "https://composio.dev/toolkits/elevenlabs/framework/llama-index.md",
  "updated_at": "2026-05-12T10:10:08.201Z"
}
```

## Introduction

This guide walks you through connecting Elevenlabs to LlamaIndex using the Composio tool router. By the end, you'll have a working Elevenlabs agent that can convert this chapter text to audio, create a custom project for your audiobook, add a new pronunciation rule for this word through natural language commands.
This guide will help you understand how to give your LlamaIndex agent real control over a Elevenlabs account through Composio's Elevenlabs MCP server.
Before we dive in, let's take a quick look at the key ideas and tools involved.

## Also integrate Elevenlabs with

- [ChatGPT](https://composio.dev/toolkits/elevenlabs/framework/chatgpt)
- [OpenAI Agents SDK](https://composio.dev/toolkits/elevenlabs/framework/open-ai-agents-sdk)
- [Claude Agent SDK](https://composio.dev/toolkits/elevenlabs/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/elevenlabs/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/elevenlabs/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/elevenlabs/framework/codex)
- [Cursor](https://composio.dev/toolkits/elevenlabs/framework/cursor)
- [VS Code](https://composio.dev/toolkits/elevenlabs/framework/vscode)
- [OpenCode](https://composio.dev/toolkits/elevenlabs/framework/opencode)
- [OpenClaw](https://composio.dev/toolkits/elevenlabs/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/elevenlabs/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/elevenlabs/framework/cli)
- [Google ADK](https://composio.dev/toolkits/elevenlabs/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/elevenlabs/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/elevenlabs/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/elevenlabs/framework/mastra-ai)
- [CrewAI](https://composio.dev/toolkits/elevenlabs/framework/crew-ai)

## TL;DR

Here's what you'll learn:
- Set your OpenAI and Composio API keys
- Install LlamaIndex and Composio packages
- Create a Composio Tool Router session for Elevenlabs
- Connect LlamaIndex to the Elevenlabs MCP server
- Build a Elevenlabs-powered agent using LlamaIndex
- Interact with Elevenlabs through natural language

## What is LlamaIndex?

LlamaIndex is a data framework for building LLM applications. It provides tools for connecting LLMs to external data sources and services through agents and tools.
Key features include:
- ReAct Agent: Reasoning and acting pattern for tool-using agents
- MCP Tools: Native support for Model Context Protocol
- Context Management: Maintain conversation context across interactions
- Async Support: Built for async/await patterns

## What is the Elevenlabs MCP server, and what's possible with it?

The Elevenlabs MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Elevenlabs account. It provides structured and secure access to your voice synthesis projects and tools, so your agent can perform actions like generating audio from text, managing custom voices, organizing projects, and fine-tuning pronunciation on your behalf.
- Project and chapter audio conversion: Instantly convert text content from chapters or entire projects into high-quality, natural-sounding audio files.
- Custom voice creation and management: Guide your agent to add, finalize, or share custom voices—either by uploading new samples or assembling voices from existing data.
- Pronunciation dictionary and rule management: Improve the accuracy of speech outputs by adding pronunciation dictionaries or custom pronunciation rules directly from files or specific aliases/phonemes.
- Project organization and automation: Let your agent create new projects, add or remove chapters, and automate speech synthesis workflows for audiobooks, podcasts, or media production.
- Embeddable audio player generation: Enable your agent to generate AudioNative projects, creating customizable and embeddable audio players from your content with just a prompt.

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `ELEVENLABS_ADD_A_PRONUNCIATION_DICTIONARY` | Add a pronunciation dictionary from file | Adds a new pronunciation dictionary from a lexicon file to improve speech synthesis accuracy. |
| `ELEVENLABS_ADD_OUTBOUND_PHONE_NUMBER` | Add outbound phone number | Tool to import/register a Twilio phone number or SIP trunk into ElevenLabs Agents Platform. Use when you need to provision a phone number for outbound calls and ELEVENLABS_GET_AGENT_DETAILS returns empty phone_numbers. This does NOT purchase a new number; it imports an existing provider configuration into your ElevenLabs workspace. |
| `ELEVENLABS_ADD_PROJECT` | Add new project with attributes | Use to create a new ElevenLabs project for text-to-speech synthesis (e.g., audiobooks); a project `name` is required by the API for creation, and content can be initialized using `from_url` or `from_document`. |
| `ELEVENLABS_ADD_PRONUNCIATION_DICTIONARY_FROM_RULES` | Add pronunciation dictionary from rules | Tool to create a new pronunciation dictionary from provided rules for ElevenLabs text-to-speech. Use when you need to define custom pronunciations for specific words or phrases to improve speech accuracy. Supports both alias rules (simple text replacements) and phoneme rules (IPA phonetic notation). |
| `ELEVENLABS_ADD_RULES_TO_THE_PRONUNCIATION_DICTIONARY` | Add rules to the pronunciation dictionary | Adds one or more custom pronunciation rules (alias or phoneme) to an existing pronunciation dictionary. |
| `ELEVENLABS_ADD_SHARING_VOICE` | Add sharing voice | Adds an existing, shareable voice to a specified user's ElevenLabs account library under a new custom name, requiring the user's public ID and the voice ID. |
| `ELEVENLABS_ADD_VOICE` | Add a voice | Adds a custom voice by uploading audio samples for voice cloning. Requires a name and at least one audio file. Recommended: 1-2 minutes of clear audio without background noise. Supported formats: mp3, wav, ogg. Returns a voice_id that can be used for text-to-speech after processing completes. |
| `ELEVENLABS_ATTACH_PHONE_NUMBER_TO_AGENT` | Attach phone number to agent | Tool to assign or unassign an existing imported phone number to an agent by updating the phone number's assigned agent. Use when you need to programmatically route inbound calls to a specific agent or change agent assignment for a phone number. |
| `ELEVENLABS_CALCULATE_CONVAI_AGENT_LLM_USAGE` | Calculate ConvAI Agent LLM Usage | Tool to calculate expected number of LLM tokens needed for a conversational AI agent. Use when estimating costs for an agent based on knowledge base size, prompt length, and RAG configuration. |
| `ELEVENLABS_CALCULATE_CONVAI_LLM_USAGE` | Calculate ConvAI LLM Usage | Tool to calculate expected LLM usage costs for conversational AI agents. Use when you need to estimate pricing for different LLM models based on prompt length, knowledge base size, and RAG configuration. |
| `ELEVENLABS_CANCEL_CONVAI_BATCH_CALL` | Cancel Batch Call | Tool to cancel a running batch call and set all recipients to cancelled status. Use when you need to stop an ongoing batch calling campaign. |
| `ELEVENLABS_CONVERT_CHAPTER` | Convert chapter to audio | Converts the textual content of a chapter, identified by `chapter_id` within a `project_id`, into audio format. |
| `ELEVENLABS_CONVERT_PROJECT` | Convert a project | Converts an existing ElevenLabs Studio project, including all its chapters and using its configured settings and voices, into speech. |
| `ELEVENLABS_CREATE_A_PREVIOUSLY_GENERATED_VOICE` | Create a previously generated voice | Finalizes the creation of a voice using its `generated_voice_id` from a previous generation step by assigning a name, description, and optional labels. |
| `ELEVENLABS_CREATE_CONVAI_AGENT_TESTING` | Create Conversational AI Agent Test | Tool to create a new ElevenLabs Conversational AI agent response test. Use when you need to set up automated testing for agent responses, tool calls, or conversation simulations. Supports three test types: 'llm' for response validation, 'tool_call' for tool execution verification, and 'simulation' for full conversation testing. |
| `ELEVENLABS_CREATE_CONVAI_KNOWLEDGE_BASE` | Add to ConvAI Knowledge Base | Tool to add documentation to ElevenLabs Conversational AI knowledge base by uploading a file or referencing a webpage URL. Use when you need to provide reference materials or documentation that agents can access during conversations. Exactly one of 'file' or 'url' must be specified. |
| `ELEVENLABS_CREATE_CONVAI_KNOWLEDGE_BASE_FILE` | Create ConvAI Knowledge Base File | Tool to create a knowledge base document from an uploaded file for ElevenLabs Conversational AI agents. Use when you need to provide documentation or reference material that agents can access during conversations. The uploaded file content will be indexed and made available to agents for answering user queries. |
| `ELEVENLABS_CREATE_CONVAI_KNOWLEDGE_BASE_FOLDER` | Create ConvAI Knowledge Base Folder | Tool to create a folder in the ElevenLabs ConvAI knowledge base for organizing documents. Use when you need to group related documents together in a hierarchical structure. |
| `ELEVENLABS_CREATE_CONVAI_KNOWLEDGE_BASE_RAG_INDEX` | Create ConvAI Knowledge Base RAG Index | Tool to compute or retrieve RAG indexes for multiple knowledge base documents in batch. Use when you need to enable semantic search on multiple knowledge base documents for conversational AI agents. This endpoint creates embeddings if missing or returns existing indexes, supporting up to 100 documents per request. |
| `ELEVENLABS_CREATE_CONVAI_KNOWLEDGE_BASE_TEXT` | Create Knowledge Base Text Document | Tool to create a knowledge base document with text content in ElevenLabs Conversational AI. Use when you need to add text-based information to the knowledge base for agent reference. |
| `ELEVENLABS_CREATE_CONVAI_KNOWLEDGE_BASE_URL` | Create Knowledge Base URL Document | Tool to create a knowledge base document by scraping the given webpage. Use when you need to add a web page as a knowledge source for a conversational AI agent. |
| `ELEVENLABS_CREATE_CONVAI_SECRET` | Create ConvAI Workspace Secret | Tool to create a new secret for the ElevenLabs ConvAI workspace. Use when you need to securely store API keys, tokens, or other sensitive values that your conversational AI agents can reference. |
| `ELEVENLABS_CREATE_CONVAI_TOOL` | Create Conversational AI Tool | Tool to create a new conversational AI tool in ElevenLabs workspace. Use when adding custom tools for agents to execute during conversations. Supports webhook (external HTTP APIs), client (client-side execution), system (built-in), and MCP (Model Context Protocol) tool types. |
| `ELEVENLABS_CREATE_CONVERSATIONAL_AGENT` | Create Conversational AI Agent | Tool to create a new ElevenLabs Conversational AI agent with specified configuration. Use when you need to programmatically set up an agent with custom prompts, voice settings, and behavior. After creating the agent, you can chain other tools to attach phone numbers or configure additional settings. |
| `ELEVENLABS_CREATE_MUSIC_PLAN` | Generate Music Composition Plan | Tool to generate a music composition plan from a text prompt using ElevenLabs Music API. Use when you need to create a structured plan for music generation with defined styles, sections, and durations. The generated plan can be used as input for actual music generation or as a template for variations. |
| `ELEVENLABS_CREATES_AUDIONATIVE_ENABLED_PROJECT` | Create an AudioNative enabled project | Creates an ElevenLabs AudioNative project, generating an embeddable audio player from a provided content file using text-to-speech, allowing customization of player appearance, audio settings, and conversion options. |
| `ELEVENLABS_CREATE_SIMILAR_VOICES` | Get similar library voices | Returns a list of shared voices similar to the provided audio sample. Use when you need to find voice matches based on audio characteristics. If neither similarity_threshold nor top_k is provided, default values will be applied. |
| `ELEVENLABS_CREATE_SINGLE_USE_TOKEN` | Create Single Use Token | Tool to generate a time-limited single-use token with embedded authentication for frontend clients. Use when you need secure, temporary access tokens for WebSocket connections or real-time services. |
| `ELEVENLABS_CREATE_WORKSPACE_WEBHOOK` | Create Workspace Webhook | Tool to create a new webhook for the workspace with specified authentication type. Use when you need to configure a webhook endpoint to receive notifications from ElevenLabs. The webhook_secret returned should be stored securely for verifying webhook authenticity. |
| `ELEVENLABS_DELETE_CHAPTER` | Delete chapter from project | Irreversibly deletes a specific, existing chapter from an existing project, typically to remove unwanted or obsolete content. |
| `ELEVENLABS_DELETE_CONVAI_AGENT` | Delete Conversational AI Agent | Tool to permanently delete a Conversational AI agent by its unique identifier. Use when you need to remove an agent configuration from the ElevenLabs workspace. |
| `ELEVENLABS_DELETE_CONVAI_AGENT_TESTING` | Delete agent response test | Tool to delete an agent response test by ID. Use when you need to remove a test result or clean up test data. |
| `ELEVENLABS_DELETE_CONVAI_BATCH_CALLING` | Delete batch call | Tool to permanently delete a batch call and all associated recipient records. Conversations remain in history. Use when cleaning up completed or cancelled batch calls. |
| `ELEVENLABS_DELETE_CONVAI_CONVERSATION` | Delete conversation by ID | Tool to delete a particular Conversational AI conversation by ID. Use when you need to remove a conversation from the system for cleanup, compliance, or data management purposes. |
| `ELEVENLABS_DELETE_CONVAI_KNOWLEDGE_BASE` | Delete Knowledge Base Document or Folder | Tool to delete a document or folder from the knowledge base. Use when you need to remove a knowledge base document or folder that is no longer needed. |
| `ELEVENLABS_DELETE_CONVAI_KNOWLEDGE_BASE_RAG_INDEX` | Delete ConvAI Knowledge Base RAG Index | Tool to delete RAG index for a knowledge base document. Use when you need to remove semantic search indexing from a document to free up resources or when the document no longer needs to be indexed. |
| `ELEVENLABS_DELETE_CONVAI_SECRET` | Delete workspace secret | Tool to delete a workspace secret if it's not in use. Use when you need to remove unused secrets from the conversational AI workspace for security or cleanup purposes. |
| `ELEVENLABS_DELETE_CONVAI_TOOL` | Delete conversational AI tool | Tool to delete a conversational AI tool from the workspace by ID. Use when you need to remove a tool configuration that is no longer needed or to clean up outdated tool definitions. |
| `ELEVENLABS_DELETE_DUBBING_PROJECT` | Delete a dubbing project | Permanently deletes a dubbing project by its ID; this action is irreversible and the project cannot be recovered. |
| `ELEVENLABS_DELETE_HISTORY_ITEM` | Delete history item | Permanently deletes a specific history item (including its audio file and metadata) using its `history_item_id`; this operation is irreversible and should be used with caution. |
| `ELEVENLABS_DELETE_MCP_SERVER` | Delete MCP server | Tool to delete a specific MCP server configuration from the workspace. Use when you need to remove an MCP server that is no longer needed or to clean up outdated configurations. |
| `ELEVENLABS_DELETE_PHONE_NUMBER` | Delete phone number by id | Tool to delete an imported phone number from the ElevenLabs workspace by ID. Use when you need to remove a phone number configuration for cleanup or to avoid stale configurations in automated environments. |
| `ELEVENLABS_DELETE_PROJECT` | Delete project by id | Use to irreversibly delete a specific project by its `project_id`; the project must exist and be accessible, and this action cannot be undone. |
| `ELEVENLABS_DELETE_SAMPLE` | Delete voice sample | Permanently deletes a specific voice sample for a given voice ID; this action is irreversible. |
| `ELEVENLABS_DELETE_VOICE` | Delete voice by id | Permanently and irreversibly deletes a specific custom voice using its `voice_id`; the voice must exist and the authenticated user must have permission to delete it. |
| `ELEVENLABS_DELETE_WORKSPACE_WEBHOOK` | Delete workspace webhook | Tool to delete a specified workspace webhook by its ID. Use when you need to remove a webhook configuration that is no longer needed or to clean up webhook integrations. |
| `ELEVENLABS_DOWNLOAD_HISTORY_ITEMS` | Download history items | Downloads audio clips from history by ID(s), returning a single file or a ZIP archive, with an optional output format (e.g., 'wav'); provides only audio content, no metadata. |
| `ELEVENLABS_DUB_A_VIDEO_OR_AN_AUDIO_FILE` | Dub a video or an audio file | Dub a video or audio file into a specified target language, requiring 'file' or 'source_url', 'target_lang', and 'csv_file' if 'mode' is 'manual'. |
| `ELEVENLABS_DUPLICATE_CONVAI_AGENT` | Duplicate Conversational AI Agent | Tool to create a new agent by duplicating an existing one. Use when you need to clone an agent's configuration. The new agent will inherit all settings from the original agent but can be given a new name. |
| `ELEVENLABS_EDIT_VOICE` | Edit voice | Updates the name, audio files, description, or labels for an existing voice model. The voice_id must be for a voice owned by you (cloned voices). Premade/default voices cannot be edited. The 'name' field is required for all edit operations. This endpoint uses multipart/form-data format for the request body. |
| `ELEVENLABS_EDIT_VOICE_SETTINGS` | Edit voice settings | Edits key voice settings (e.g., stability, similarity enhancement, style exaggeration, speaker boost) for an existing voice, affecting all future audio generated with that voice ID. |
| `ELEVENLABS_GENERATE_A_RANDOM_VOICE` | Generate a random voice | Generates a unique, random ElevenLabs text-to-speech voice based on input text and specified voice characteristics. |
| `ELEVENLABS_GET_AGENT_DETAILS` | Get agent details | Tool to retrieve available Conversational AI agents and outbound-capable Twilio phone numbers. Use when selecting an agent and phone number for outbound calls. Always reference agents by agent_id (stable identifier), not agent_name (mutable). Returns basic metadata only — conversation_config and webhook settings require a separate ConvAI agent API call. Pass agent_id and agent_phone_number_id directly to ELEVENLABS_OUTBOUND_CALL; IDs must be current and owned by the authenticated account. |
| `ELEVENLABS_GET_AGENT_LINK` | Get Agent Link | Tool to get the current shareable link for a Conversational AI agent. Use when you need to retrieve the link URL for sharing the agent with others. |
| `ELEVENLABS_GET_A_PROFILE_PAGE` | Get user profile | Retrieves the profile information for the authenticated ElevenLabs user (identified by API key). |
| `ELEVENLABS_GET_AUDIO_FROM_HISTORY_ITEM` | Get audio from history item | Retrieves the audio content for a specific history item from ElevenLabs, using a `history_item_id` that must correspond to a previously generated audio. |
| `ELEVENLABS_GET_AUDIO_FROM_SAMPLE` | Get sample audio | Retrieves the audio for a given `sample_id` that must belong to the specified `voice_id`. |
| `ELEVENLABS_GET_AUDIO_NATIVE_SETTINGS` | Get audio native settings | Tool to retrieve player settings for a specific Audio Native project. Use when you need to check the current configuration of an audio-native project, including display settings, colors, and status. |
| `ELEVENLABS_GET_CHAPTER_BY_ID` | Get chapter by ID | Fetches comprehensive details for a specific chapter within a given project, including its metadata (name, ID), conversion status, progress, download availability, and content statistics. |
| `ELEVENLABS_GET_CHAPTERS` | Get chapters by project id | Retrieves a list of all chapters, their details, and conversion status for a project, useful for managing content or tracking progress. |
| `ELEVENLABS_GET_CHAPTER_SNAPSHOTS` | Get chapter snapshots | Retrieves all saved version snapshots for a specific chapter within a given project, enabling review of its history or reversion to prior states. |
| `ELEVENLABS_GET_CONVAI_AGENT` | Get Conversational AI Agent | Tool to retrieve the complete configuration for a specific Conversational AI agent by ID. Use when you need to inspect or audit an agent's settings, workflow, conversation config, or assigned channels. |
| `ELEVENLABS_GET_CONVAI_AGENT_KNOWLEDGE_BASE_SIZE` | Get Agent Knowledge Base Size | Tool to retrieve the number of pages in a conversational AI agent's knowledge base. Use when you need to check the size of an agent's knowledge base content. |
| `ELEVENLABS_GET_CONVAI_AGENTS_SUMMARIES` | Get ConvAI Agents Summaries | Tool to retrieve summaries for specified Conversational AI agents. Use when you need to fetch metadata such as name, tags, creation time, access level, and archival status for one or more agents. |
| `ELEVENLABS_GET_CONVAI_AGENTS_WIDGET` | Get Agent Widget Config | Tool to retrieve the widget configuration for a Conversational AI agent. Use when you need to fetch display settings, colors, text content, and behavior options for an agent's embedded widget. |
| `ELEVENLABS_GET_CONVAI_AGENT_TESTING_BY_ID` | Get Agent Response Test By ID | Tool to retrieve an ElevenLabs Conversational AI agent response test by its ID. Use when you need to fetch details of a specific test including its configuration, type, and test parameters. |
| `ELEVENLABS_GET_CONVAI_ANALYTICS_LIVE_COUNT` | Get conversational AI analytics live count | Tool to retrieve the live count of active ongoing Conversational AI conversations. Use when monitoring real-time conversation activity or checking current load. |
| `ELEVENLABS_GET_CONVAI_BATCH_CALLING` | Get batch call details | Tool to get detailed information about a batch call including all recipients. Use when you need to check the status, progress, or results of a previously submitted batch calling job. |
| `ELEVENLABS_GET_CONVAI_BATCH_CALLING_WORKSPACE` | Get Batch Calls for Workspace | Tool to retrieve all batch calls for the current workspace. Use when you need to list all batch calling campaigns, check their status, or find specific batch calls by name or agent. |
| `ELEVENLABS_GET_CONVAI_CONVERSATIONS` | Get Conversational AI Conversations | Tool to retrieve all conversations of agents that user owns. Use when you need to list conversations, optionally filtered by agent, time range, duration, rating, or other criteria. Supports pagination via cursor. |
| `ELEVENLABS_GET_CONVAI_KNOWLEDGE_BASE` | Get ConvAI Knowledge Base | Tool to retrieve a list of available knowledge base documents. Use when you need to browse, search, or filter knowledge base documents by name, type, folder, or ownership. Supports pagination via cursor for large result sets. |
| `ELEVENLABS_GET_CONVAI_KNOWLEDGE_BASE_CONTENT` | Get Knowledge Base Document Content | Tool to retrieve the entire content of a document from the knowledge base. Use when you need to access or read the full text content of a knowledge base document. |
| `ELEVENLABS_GET_CONVAI_KNOWLEDGE_BASE_DEPENDENT_AGENTS` | Get Knowledge Base Dependent Agents | Tool to retrieve a list of agents depending on a specific knowledge base document. Use when you need to identify which agents are using a particular document, either directly or transitively. |
| `ELEVENLABS_GET_CONVAI_KNOWLEDGE_BASE_DOCUMENTATION` | Get Knowledge Base Documentation | Tool to get details about a specific documentation making up the agent's knowledge base. Use when you need to retrieve information about a knowledge base document, including its content, type, and metadata. |
| `ELEVENLABS_GET_CONVAI_KNOWLEDGE_BASE_RAG_INDEX` | Get Knowledge Base RAG Index Overview | Tool to retrieve RAG index overview including total size and usage information. Use when you need to check storage limits, monitor usage, or understand which embedding models are consuming space in knowledge base documents. |
| `ELEVENLABS_GET_CONVAI_KNOWLEDGE_BASE_RAG_INDEXES` | Get ConvAI Knowledge Base RAG Indexes | Tool to retrieve all RAG indexes for a specified knowledge base document. Use when you need to view the indexing status, models used, and usage statistics for a document's semantic search capabilities. |
| `ELEVENLABS_GET_CONVAI_KNOWLEDGE_BASE_SOURCE_FILE_URL` | Get Knowledge Base Source File URL | Tool to get a signed URL to download the original source file of a file-type document from the knowledge base. Use when you need to download the original file that was uploaded to create a knowledge base document. |
| `ELEVENLABS_GET_CONVAI_KNOWLEDGE_BASE_SUMMARIES` | Get Knowledge Base Summaries | Tool to retrieve knowledge base document summaries by their IDs. Use when you need to get summaries for multiple knowledge base documents in a single request. |
| `ELEVENLABS_GET_CONVAI_MCP_SERVER` | Get ConvAI MCP Server | Tool to retrieve a specific MCP server configuration from the workspace. Use when you need to inspect details of an existing MCP server including its URL, transport type, approval policies, and dependent agents. |
| `ELEVENLABS_GET_CONVAI_MCP_SERVERS` | Get ConvAI MCP Servers | Tool to retrieve all MCP (Model Context Protocol) server configurations available in the workspace. Use when you need to list all registered MCP servers or check which servers are available for conversational AI agents. |
| `ELEVENLABS_GET_CONVAI_MCP_SERVER_TOOLS` | Get ConvAI MCP Server Tools | Tool to retrieve all tools available for a specific MCP server configuration. Use when you need to inspect what tools an MCP server provides or verify tool availability before using them. |
| `ELEVENLABS_GET_CONVAI_PHONE_NUMBER_BY_ID` | Get Phone Number by ID | Tool to retrieve detailed configuration for a specific phone number by ID. Use when you need to inspect a phone number's provider details, capabilities, agent assignments, or SIP trunk configuration. |
| `ELEVENLABS_GET_CONVAI_SECRETS` | Get ConvAI Workspace Secrets | Tool to retrieve all workspace secrets for the user. Use when you need to list stored secrets that can be used for authentication and integration with conversational AI agents. Supports pagination. |
| `ELEVENLABS_GET_CONVAI_SETTINGS` | Get Convai Settings | Tool to retrieve Convai settings for the workspace. Use when you need to inspect webhook configurations, RAG retention settings, or MCP server capabilities. |
| `ELEVENLABS_GET_CONVAI_SETTINGS_DASHBOARD` | Get Convai Dashboard Settings | Tool to retrieve Convai dashboard settings for the workspace. Use when you need to inspect configured dashboard charts for monitoring conversational AI performance. |
| `ELEVENLABS_GET_CONVAI_TEST_INVOCATIONS` | List Test Invocations | Tool to list all test invocations for a specific conversational AI agent with pagination support. Use when you need to retrieve test invocation history, check test results, or paginate through large sets of test runs. |
| `ELEVENLABS_GET_CONVAI_TOOL` | Get Conversational AI Tool | Tool to retrieve the complete configuration for a specific conversational AI tool by ID. Use when you need to inspect a tool's settings, type, or usage statistics from the workspace. |
| `ELEVENLABS_GET_CONVAI_TOOLS` | Get ConvAI tools | Tool to retrieve all available tools in the workspace. Use when you need to list, search, or discover tools that can be used with Conversational AI agents. |
| `ELEVENLABS_GET_CONVAI_TOOLS_DEPENDENT_AGENTS` | Get Tool Dependent Agents | Tool to retrieve a list of agents depending on a specific tool. Use when you need to identify which agents are using a particular tool in their configuration. |
| `ELEVENLABS_GET_CONVERSATION_BY_ID` | Get conversation by ID | Tool to fetch full details for a single Conversational AI conversation by ID. Use when you need transcript-level analysis, metadata, or audio status flags for a specific conversation. |
| `ELEVENLABS_GET_CONVERSATION_SIGNED_URL` | Get Conversation Signed URL | Tool to get a signed URL to start a conversation with an agent that requires authorization. Use when you need to obtain a secure WebSocket URL for initiating a conversation session. |
| `ELEVENLABS_GET_DEFAULT_VOICE_SETTINGS` | Get default voice settings | Retrieves the ElevenLabs text-to-speech service's default voice settings (stability, similarity boost, style, speaker boost) that are applied when no voice-specific or request-specific settings are provided. |
| `ELEVENLABS_GET_DUBBED_FILE` | Get dubbed audio for a language | Retrieves an existing dubbed audio file for a specific `dubbing_id` and `language_code`. |
| `ELEVENLABS_GET_DUBBING_PROJECT_METADATA` | Get dubbing project metadata | Retrieves metadata and status for a specific dubbing project by its ID. |
| `ELEVENLABS_GET_DUBBING_TRANSCRIPTS_FORMAT` | Get dubbing transcript in specific format | Retrieves the transcript for a specific dubbing project and language in the requested format (SRT, WebVTT, or JSON). Use this when you need subtitles or detailed transcript data with timing information for a dubbed video or audio. |
| `ELEVENLABS_GET_GENERATED_ITEMS` | Get generated items | Retrieves metadata for a list of generated audio items from history, supporting pagination and optional filtering by voice ID. |
| `ELEVENLABS_GET_HISTORY_ITEM_BY_ID` | Get history item by id | Retrieves detailed information (excluding the audio file) for a specific audio generation history item from ElevenLabs, using its unique ID. |
| `ELEVENLABS_GET_MCP_TOOL_CONFIG` | Get MCP Tool Configuration | Tool to retrieve configuration overrides for a specific MCP tool within an MCP server. Use when you need to inspect the custom execution settings for individual tools. |
| `ELEVENLABS_GET_METADATA_FOR_A_PRONUNCIATION_DICTIONARY` | Get pronunciation dictionary metadata | Retrieves metadata for a specific, existing pronunciation dictionary from ElevenLabs using its ID. |
| `ELEVENLABS_GET_MODELS` | Get models | Retrieves a detailed list of all available ElevenLabs text-to-speech (TTS) models and their capabilities. |
| `ELEVENLABS_GET_PROJECT_BY_ID` | Get project by ID | Use to retrieve all details for a specific project, including its chapters and their conversion statuses, by providing the project's unique ID. |
| `ELEVENLABS_GET_PROJECTS` | Get projects | Fetches a list of all projects and their details associated with the user's ElevenLabs account; this is a read-only operation. |
| `ELEVENLABS_GET_PROJECT_SNAPSHOTS` | Get project snapshots | Retrieves all available snapshots (saved states or versions) for an existing project, enabling history tracking, version comparison, or accessing specific states for playback/processing, particularly in text-to-speech workflows. |
| `ELEVENLABS_GET_PRONUNCIATION_DICTIONARIES` | Get pronunciation dictionaries | Retrieves a paginated list of pronunciation dictionaries, used to customize how specific words or phrases are pronounced by the text-to-speech (TTS) engine. |
| `ELEVENLABS_GET_PRONUNCIATION_DICT_VERSION` | Get pronunciation dictionary version | Downloads the Pronunciation Lexicon Specification (PLS) file for an existing version of a pronunciation dictionary from ElevenLabs, used to customize TTS pronunciation. |
| `ELEVENLABS_GET_SERVICE_ACCOUNTS` | Get Service Accounts | Tool to list all service accounts in the workspace. Use when you need to view service accounts, their associated API keys, or manage workspace access. |
| `ELEVENLABS_GET_SHARED_VOICES` | Get shared voices | Retrieves a paginated and filterable list of shared voices from the ElevenLabs Voice Library. |
| `ELEVENLABS_GET_SSO_PROVIDER_ADMIN` | Get sso provider admin | Retrieves the SSO provider configuration for a specified workspace, typically for review purposes, and will indicate if no configuration exists. |
| `ELEVENLABS_GET_SUMMARIES_CONVAI_AGENT_TESTING_SUMMARIES` | Get Agent Response Test Summaries | Tool to retrieve multiple agent response test summaries by their IDs. Use when you need to fetch summary information for multiple tests in a single request. Returns a dictionary mapping test IDs to their summary details including name, type, and timestamps. |
| `ELEVENLABS_GET_TRANSCRIPT_FOR_DUB` | Get dubbing transcript by language | Retrieves the textual transcript for a specified dubbing project and language, if one exists for that language in the project. |
| `ELEVENLABS_GET_USAGE_CHARACTER_STATS` | Get Usage Character Stats | Tool to retrieve usage metrics for the current user or entire workspace. Returns time-series data with configurable aggregation intervals and breakdown types. Use when analyzing character usage patterns, tracking consumption by voice, user, or other dimensions over time. |
| `ELEVENLABS_GET_USER_INFO` | Get user info | Retrieves detailed information about the authenticated ElevenLabs user's account, including subscription, usage, API key, and status. |
| `ELEVENLABS_GET_USER_SUBSCRIPTION_INFO` | Get user subscription info | Retrieves detailed subscription information for the currently authenticated ElevenLabs user. |
| `ELEVENLABS_GET_VOICE` | Get voice | Retrieves comprehensive details for a specific, existing voice by its `voice_id`, optionally including its settings. |
| `ELEVENLABS_GET_VOICES` | Get voices list | Retrieves a list of all available voices along with their detailed attributes and settings. |
| `ELEVENLABS_GET_VOICE_SETTINGS` | Get voice settings | Retrieves the stability, similarity, style, and speaker boost settings for a specific, existing ElevenLabs voice using its `voice_id`. |
| `ELEVENLABS_GET_WORKSPACE_RESOURCE` | Get workspace resource metadata | Tool to get metadata of a workspace resource by ID and type. Use when you need access control information, creator details, or sharing options for a specific resource. |
| `ELEVENLABS_GET_WORKSPACE_WEBHOOKS` | Get Workspace Webhooks | Tool to list all webhooks configured for the workspace. Use when you need to view existing webhook configurations or verify webhook settings. |
| `ELEVENLABS_LIST_CONVAI_AGENT_TESTING` | List Conversational AI Agent Tests | Tool to list all agent response tests with pagination support and optional search filtering. Use when you need to retrieve available tests, search tests by name, or paginate through large test collections. |
| `ELEVENLABS_LIST_DUBS` | List Dubs | Tool to list dubbing projects you have access to. Use when you need to retrieve dubs, check their status, or paginate through available dubbing projects. |
| `ELEVENLABS_LIST_PHONE_NUMBERS` | List Phone Numbers | Tool to list all imported phone numbers in the workspace. Use when you need to find available phone numbers, check their capabilities (inbound/outbound), or verify which agent is assigned to a number. |
| `ELEVENLABS_LIST_WHATSAPP_ACCOUNTS` | List WhatsApp Accounts | Tool to list all WhatsApp accounts in the workspace. Use when you need to view available WhatsApp Business accounts, check which agents are assigned to WhatsApp numbers, or retrieve WhatsApp phone number details. |
| `ELEVENLABS_MOVE_BULK_CONVAI_KNOWLEDGE_BASE` | Move Bulk Knowledge Base Items | Tool to move multiple documents or folders from one folder to another in the knowledge base. Use when you need to reorganize multiple knowledge base items at once by moving them to a different folder or to the root level. |
| `ELEVENLABS_MOVE_CONVAI_KNOWLEDGE_BASE` | Move ConvAI Knowledge Base Entity | Tool to move a knowledge base document or folder to a different folder. Use when you need to reorganize your knowledge base by moving entities between folders or to the root level. |
| `ELEVENLABS_OUTBOUND_CALL` | Outbound call | Tool to place an outbound call via SIP trunk. Use when you need to initiate a voice call through an ElevenLabs agent after obtaining required IDs. Prerequisites: - The API key must have Conversational AI (convai) permissions enabled. For write operations like initiating calls, ensure your API key has the appropriate convai write scope. - A valid SIP trunk phone number must be configured for outbound calls in ElevenLabs. - The SIP trunk must have valid outbound configuration with proper address and credentials. - The agent must be properly configured in the Conversational AI platform. |
| `ELEVENLABS_REDIRECT_TO_MINTLIFY` | Get API documentation | Retrieves the content of the official ElevenLabs API documentation page hosted on Mintlify. |
| `ELEVENLABS_REGISTER_CALL_CONVAI_TWILIO` | Register Twilio Call for ConvAI Agent | Tool to register a Twilio call and return TwiML to connect the call to an ElevenLabs Conversational AI agent. Use when you need to integrate ElevenLabs agents with your own Twilio infrastructure for inbound or outbound calls. |
| `ELEVENLABS_REMOVE_RULES_FROM_THE_PRONUNCIATION_DICTIONARY` | Remove rules from pronunciation dictionary | Permanently removes exact-match pronunciation rules from a specified ElevenLabs pronunciation dictionary using a list of rule strings; non-matching rule strings are ignored and this action cannot add or modify rules. |
| `ELEVENLABS_RESUBMIT_CONVAI_TEST_INVOCATIONS` | Resubmit Test Invocations | Tool to resubmit specific test runs from a test invocation for a conversational AI agent. Use when you need to re-run failed tests or specific test cases from a previous test invocation. |
| `ELEVENLABS_RETRY_CONVAI_BATCH_CALL` | Retry Batch Call | Tool to retry a batch call, calling failed and no-response recipients again. Use when you need to retry unsuccessful calls from a previous batch calling campaign. |
| `ELEVENLABS_RUN_AGENT_TESTS` | Run Agent Tests | Tool to run selected tests on a conversational AI agent with optional configuration overrides. Use when you need to execute automated tests on an agent to validate responses, tool calls, or conversation flows. Supports running up to 200 tests in a single invocation with optional branch-specific or configuration override testing. |
| `ELEVENLABS_SET_AGENT_AVATAR` | Set Agent Avatar | Tool to set or update the avatar image for a Conversational AI agent displayed in the widget. Use when you need to customize the visual appearance of an agent by uploading a profile image. |
| `ELEVENLABS_SIMULATE_CONVAI_AGENTS_SIMULATE_CONVERSATION` | Simulate Conversational AI Agent Conversation | Tool to run a simulated conversation between an agent and an AI user. Use when testing agent behavior with specific scenarios or evaluating conversation flow. Returns full transcript with analysis including success metrics and conversation summary. |
| `ELEVENLABS_SPEECH_TO_SPEECH` | Speech to speech | Converts an input audio file to speech using a specified voice; if a `model_id` is provided, it must support speech-to-speech conversion. |
| `ELEVENLABS_SPEECH_TO_SPEECH_STREAMING` | Speech to speech streaming | Converts an input audio stream to a different voice output stream in real-time, using a specified speech-to-speech model. |
| `ELEVENLABS_STREAM_AUDIO_ISOLATION` | Stream audio isolation | Tool to remove background noise from audio and stream the isolated result. Use when you need to clean up audio recordings by isolating vocals/speech and removing unwanted background noise. The audio file must be at least 4.6 seconds long. |
| `ELEVENLABS_STREAM_CHAPTER_AUDIO` | Stream chapter audio | Streams the audio for a specified chapter snapshot from an ElevenLabs project, optionally converting the output to MPEG format. |
| `ELEVENLABS_STREAM_CONVAI_AGENTS_SIMULATE_CONVERSATION` | Stream ConvAI agent simulate conversation | Tool to run a simulated conversation between an agent and a simulated user, streaming back the response. Response is streamed as partial lists of messages that should be concatenated, with a final message containing conversation analysis once complete. |
| `ELEVENLABS_STREAM_PROJECT_AUDIO` | Stream project audio | Streams audio from a specific project snapshot, optionally converting it to MPEG format. |
| `ELEVENLABS_STREAMS_ARCHIVE_WITH_PROJECT_AUDIO` | Archive project snapshot | Archives an existing project snapshot by its ID, creating a permanent, immutable, and typically irreversible copy of its state. |
| `ELEVENLABS_SUBMIT_BATCH_CALL` | Submit Batch Call | Tool to submit a batch call. Use when you need to initiate multiple calls (voice or WhatsApp) at once. Triggers real outbound calls immediately (if no scheduled_time_unix is set) or at the scheduled time — always confirm recipient list and call count with the user before executing. |
| `ELEVENLABS_TEXT_TO_SPEECH` | Text to speech | Converts text to speech using a specified ElevenLabs voice and model, returning a downloadable audio file (use ELEVENLABS_TEXT_TO_SPEECH_STREAM for streaming instead). Audio URL is nested at `data.file.s3url` in the response. Keep `voice_id`, `model_id`, and `output_format` consistent across all chunks to avoid audible artifacts when concatenating. Some voice/model/format combinations require specific subscription tiers; test with a short sample before full runs. HTTP 429 on burst batches; respect `Retry-After` headers. |
| `ELEVENLABS_TEXT_TO_SPEECH_STREAM` | Text to speech stream | Converts text to a spoken audio stream (no saved file or history entry); use the non-streaming text-to-speech tool when a persistent audio URL is needed. Allows latency optimization, specific output formats (some tier-dependent), and custom pronunciations; ensure the chosen model supports text-to-speech and text is preferably under 5000 characters. Keep voice_id, model_id, and output_format consistent across multi-chunk sessions to avoid audio artifacts. |
| `ELEVENLABS_UPDATE_AUDIO_NATIVE_CONTENT` | Update Audio Native project content | Tool to update content for an Audio Native project by uploading a text or HTML file. Use when you need to refresh or change the content of an existing Audio Native project. Optionally auto-convert to audio and auto-publish the new snapshot. |
| `ELEVENLABS_UPDATE_CONVAI_AGENT` | Update Conversational AI Agent | Tool to update an existing ElevenLabs Conversational AI agent's settings. Use when you need to modify an agent's configuration, such as changing its name, conversation settings, workflow, or platform settings. |
| `ELEVENLABS_UPDATE_CONVAI_AGENT_TESTING` | Update Agent Response Test | Tool to update an existing ElevenLabs Conversational AI agent response test by ID. Use when you need to modify test configuration, chat history, success conditions, or other test parameters. |
| `ELEVENLABS_UPDATE_CONVAI_KNOWLEDGE_BASE` | Update Knowledge Base Document | Tool to update the name of a knowledge base document in ElevenLabs Conversational AI. Use when you need to rename an existing knowledge base document. |
| `ELEVENLABS_UPDATE_CONVAI_SECRET` | Update ConvAI Workspace Secret | Tool to update an existing secret in the ElevenLabs ConvAI workspace. Use when you need to modify the name or value of an existing API key, token, or other sensitive value stored in the workspace. |
| `ELEVENLABS_UPDATE_CONVAI_SETTINGS` | Update Convai Settings | Tool to update Convai settings for the workspace. Use when you need to modify webhook configurations, RAG retention settings, MCP server capabilities, or Livekit stack preferences. |
| `ELEVENLABS_UPDATE_CONVAI_SETTINGS_DASHBOARD` | Update Convai Dashboard Settings | Tool to update Convai dashboard settings for the workspace. Use when you need to configure dashboard charts for monitoring conversational AI performance. |
| `ELEVENLABS_UPDATE_CONVAI_TOOL` | Update Conversational AI Tool | Tool to update an existing conversational AI tool in ElevenLabs workspace. Use when modifying tool settings, descriptions, API endpoints, or behavior configurations. Requires the complete tool_config object with all required fields for the tool type. |
| `ELEVENLABS_UPDATE_PRONUNCIATION_DICTIONARIES` | Update project pronunciation dictionaries | Updates a project's pronunciation dictionaries on ElevenLabs to improve text-to-speech accuracy for specialized terms; note that while multiple dictionaries can be applied, the UI only displays the first. |
| `ELEVENLABS_UPDATE_PRONUNCIATION_DICTIONARY` | Update pronunciation dictionary | Partially updates a pronunciation dictionary's metadata (name or archived status) without changing its version. Use when you need to rename or archive/unarchive a dictionary. |
| `ELEVENLABS_UPDATE_WORKSPACE_WEBHOOK` | Update Workspace Webhook | Tool to update a specified workspace webhook by its ID. Use when you need to modify webhook settings such as the display name or enable/disable status. |
| `ELEVENLABS_VOICE_GENERATION_PARAMETERS` | Voice generation parameters retrieval | Fetches configurable parameters for ElevenLabs voice generation, used to determine available settings (e.g., accents, character limits) prior to audio synthesis; returns metadata only, not audio. |

## Supported Triggers

None listed.

## Creating MCP Server - Stand-alone vs Composio SDK

The Elevenlabs MCP server is an implementation of the Model Context Protocol that connects your AI agent to Elevenlabs. It provides structured and secure access so your agent can perform Elevenlabs operations on your behalf through a secure, permission-based interface.
With Composio's managed implementation, you don't have to create your own developer app. For production, if you're building an end product, we recommend using your own credentials. The managed server helps you prototype fast and go from 0-1 faster.

## Step-by-step Guide

### 1. Prerequisites

Before you begin, make sure you have:
- Python 3.8/Node 16 or higher installed
- A Composio account with the API key
- An OpenAI API key
- A Elevenlabs account and project
- Basic familiarity with async Python/Typescript

### 1. Getting API Keys for OpenAI, Composio, and Elevenlabs

No description provided.

### 2. Installing dependencies

No description provided.
```python
pip install composio-llamaindex llama-index llama-index-llms-openai llama-index-tools-mcp python-dotenv
```

```typescript
npm install @composio/llamaindex @llamaindex/openai @llamaindex/tools @llamaindex/workflow dotenv
```

### 3. Set environment variables

Create a .env file in your project root:
These credentials will be used to:
- Authenticate with OpenAI's GPT-5 model
- Connect to Composio's Tool Router
- Identify your Composio user session for Elevenlabs access
```bash
OPENAI_API_KEY=your-openai-api-key
COMPOSIO_API_KEY=your-composio-api-key
COMPOSIO_USER_ID=your-user-id
```

### 4. Import modules

No description provided.
```python
import asyncio
import os
import dotenv

from composio import Composio
from composio_llamaindex import LlamaIndexProvider
from llama_index.core.agent.workflow import ReActAgent
from llama_index.core.workflow import Context
from llama_index.llms.openai import OpenAI
from llama_index.tools.mcp import BasicMCPClient, McpToolSpec

dotenv.load_dotenv()
```

```typescript
import "dotenv/config";
import readline from "node:readline/promises";
import { stdin as input, stdout as output } from "node:process";

import { Composio } from "@composio/core";

import { mcp } from "@llamaindex/tools";
import { agent as createAgent } from "@llamaindex/workflow";
import { openai } from "@llamaindex/openai";

dotenv.config();
```

### 5. Load environment variables and initialize Composio

No description provided.
```python
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
COMPOSIO_API_KEY = os.getenv("COMPOSIO_API_KEY")
COMPOSIO_USER_ID = os.getenv("COMPOSIO_USER_ID")

if not OPENAI_API_KEY:
    raise ValueError("OPENAI_API_KEY is not set in the environment")
if not COMPOSIO_API_KEY:
    raise ValueError("COMPOSIO_API_KEY is not set in the environment")
if not COMPOSIO_USER_ID:
    raise ValueError("COMPOSIO_USER_ID is not set in the environment")
```

```typescript
const OPENAI_API_KEY = process.env.OPENAI_API_KEY;
const COMPOSIO_API_KEY = process.env.COMPOSIO_API_KEY;
const COMPOSIO_USER_ID = process.env.COMPOSIO_USER_ID;

if (!OPENAI_API_KEY) throw new Error("OPENAI_API_KEY is not set");
if (!COMPOSIO_API_KEY) throw new Error("COMPOSIO_API_KEY is not set");
if (!COMPOSIO_USER_ID) throw new Error("COMPOSIO_USER_ID is not set");
```

### 6. Create a Tool Router session and build the agent function

What's happening here:
- We create a Composio client using your API key and configure it with the LlamaIndex provider
- We then create a tool router MCP session for your user, specifying the toolkits we want to use (in this case, elevenlabs)
- The session returns an MCP HTTP endpoint URL that acts as a gateway to all your configured tools
- LlamaIndex will connect to this endpoint to dynamically discover and use the available Elevenlabs tools.
- The MCP tools are mapped to LlamaIndex-compatible tools and plug them into the Agent.
```python
async def build_agent() -> ReActAgent:
    composio_client = Composio(
        api_key=COMPOSIO_API_KEY,
        provider=LlamaIndexProvider(),
    )

    session = composio_client.create(
        user_id=COMPOSIO_USER_ID,
        toolkits=["elevenlabs"],
    )

    mcp_url = session.mcp.url
    print(f"Composio MCP URL: {mcp_url}")

    mcp_client = BasicMCPClient(mcp_url, headers={"x-api-key": COMPOSIO_API_KEY})
    mcp_tool_spec = McpToolSpec(client=mcp_client)
    tools = await mcp_tool_spec.to_tool_list_async()

    llm = OpenAI(model="gpt-5")

    description = "An agent that uses Composio Tool Router MCP tools to perform Elevenlabs actions."
    system_prompt = """
    You are a helpful assistant connected to Composio Tool Router.
    Use the available tools to answer user queries and perform Elevenlabs actions.
    """
    return ReActAgent(tools=tools, llm=llm, description=description, system_prompt=system_prompt, verbose=True)
```

```typescript
async function buildAgent() {

  console.log(`Initializing Composio client...${COMPOSIO_USER_ID!}...`);
  console.log(`COMPOSIO_USER_ID: ${COMPOSIO_USER_ID!}...`);

  const composio = new Composio({
    apiKey: COMPOSIO_API_KEY,
    provider: new LlamaindexProvider(),
  });

  const session = await composio.create(
    COMPOSIO_USER_ID!,
    {
      toolkits: ["elevenlabs"],
    },
  );

  const mcpUrl = session.mcp.url;
  console.log(`Composio Tool Router MCP URL: ${mcpUrl}`);

  const server = mcp({
    url: mcpUrl,
    clientName: "composio_tool_router_with_llamaindex",
    requestInit: {
      headers: {
        "x-api-key": COMPOSIO_API_KEY!,
      },
    },
    // verbose: true,
  });

  const tools = await server.tools();

  const llm = openai({ apiKey: OPENAI_API_KEY, model: "gpt-5" });

  const agent = createAgent({
    name: "composio_tool_router_with_llamaindex",
        description : "An agent that uses Composio Tool Router MCP tools to perform actions.",
    systemPrompt:
      "You are a helpful assistant connected to Composio Tool Router."+
"Use the available tools to answer user queries and perform Elevenlabs actions." ,
    llm,
    tools,
  });

  return agent;
}
```

### 7. Create an interactive chat loop

No description provided.
```python
async def chat_loop(agent: ReActAgent) -> None:
    ctx = Context(agent)
    print("Type 'quit', 'exit', or Ctrl+C to stop.")

    while True:
        try:
            user_input = input("\nYou: ").strip()
        except (KeyboardInterrupt, EOFError):
            print("\nBye!")
            break

        if not user_input or user_input.lower() in {"quit", "exit"}:
            print("Bye!")
            break

        try:
            print("Agent: ", end="", flush=True)
            handler = agent.run(user_input, ctx=ctx)

            async for event in handler.stream_events():
                # Stream token-by-token from LLM responses
                if hasattr(event, "delta") and event.delta:
                    print(event.delta, end="", flush=True)
                # Show tool calls as they happen
                elif hasattr(event, "tool_name"):
                    print(f"\n[Using tool: {event.tool_name}]", flush=True)

            # Get final response
            response = await handler
            print()  # Newline after streaming
        except KeyboardInterrupt:
            print("\n[Interrupted]")
            continue
        except Exception as e:
            print(f"\nError: {e}")
```

```typescript
async function chatLoop(agent: ReturnType<typeof createAgent>) {
  const rl = readline.createInterface({ input, output });

  console.log("Type 'quit' or 'exit' to stop.");

  while (true) {
    let userInput: string;

    try {
      userInput = (await rl.question("\nYou: ")).trim();
    } catch {
      console.log("\nAgent: Bye!");
      break;
    }

    if (!userInput) {
      continue;
    }

    const lower = userInput.toLowerCase();
    if (lower === "quit" || lower === "exit") {
      console.log("Agent: Bye!");
      break;
    }

    try {
      process.stdout.write("Agent: ");

      const stream = agent.runStream(userInput);
      let finalResult: any = null;

      for await (const event of stream) {
        // The event.data contains the streamed content
        const data: any = event.data;

        // Check for streaming delta content
        if (data?.delta) {
          process.stdout.write(data.delta);
        }

        // Store final result for fallback
        if (data?.result || data?.message) {
          finalResult = data;
        }
      }

      // If no streaming happened, show the final result
      if (finalResult) {
        const answer =
          finalResult.result ??
          finalResult.message?.content ??
          finalResult.message ??
          "";
        if (answer && typeof answer === "string" && !answer.includes("[object")) {
          process.stdout.write(answer);
        }
      }

      console.log(); // New line after streaming completes
    } catch (err: any) {
      console.error("\nAgent error:", err?.message ?? err);
    }
  }

  rl.close();
}
```

### 8. Define the main entry point

What's happening here:
- We're orchestrating the entire application flow
- The agent gets built with proper error handling
- Then we kick off the interactive chat loop so you can start talking to Elevenlabs
```python
async def main() -> None:
    agent = await build_agent()
    await chat_loop(agent)

if __name__ == "__main__":
    # Handle Ctrl+C gracefully
    signal.signal(signal.SIGINT, lambda s, f: (print("\nBye!"), exit(0)))
    try:
        asyncio.run(main())
    except KeyboardInterrupt:
        print("\nBye!")
```

```typescript
async function main() {
  try {
    const agent = await buildAgent();
    await chatLoop(agent);
  } catch (err) {
    console.error("Failed to start agent:", err);
    process.exit(1);
  }
}

main();
```

### 9. Run the agent

When prompted, authenticate and authorise your agent with Elevenlabs, then start asking questions.
```bash
python llamaindex_agent.py
```

```typescript
npx ts-node llamaindex-agent.ts
```

## Complete Code

```python
import asyncio
import os
import signal
import dotenv

from composio import Composio
from composio_llamaindex import LlamaIndexProvider
from llama_index.core.agent.workflow import ReActAgent
from llama_index.core.workflow import Context
from llama_index.llms.openai import OpenAI
from llama_index.tools.mcp import BasicMCPClient, McpToolSpec

dotenv.load_dotenv()

OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
COMPOSIO_API_KEY = os.getenv("COMPOSIO_API_KEY")
COMPOSIO_USER_ID = os.getenv("COMPOSIO_USER_ID")

if not OPENAI_API_KEY:
    raise ValueError("OPENAI_API_KEY is not set")
if not COMPOSIO_API_KEY:
    raise ValueError("COMPOSIO_API_KEY is not set")
if not COMPOSIO_USER_ID:
    raise ValueError("COMPOSIO_USER_ID is not set")

async def build_agent() -> ReActAgent:
    composio_client = Composio(
        api_key=COMPOSIO_API_KEY,
        provider=LlamaIndexProvider(),
    )

    session = composio_client.create(
        user_id=COMPOSIO_USER_ID,
        toolkits=["elevenlabs"],
    )

    mcp_url = session.mcp.url
    print(f"Composio MCP URL: {mcp_url}")

    mcp_client = BasicMCPClient(mcp_url, headers={"x-api-key": COMPOSIO_API_KEY})
    mcp_tool_spec = McpToolSpec(client=mcp_client)
    tools = await mcp_tool_spec.to_tool_list_async()

    llm = OpenAI(model="gpt-5")
    description = "An agent that uses Composio Tool Router MCP tools to perform Elevenlabs actions."
    system_prompt = """
    You are a helpful assistant connected to Composio Tool Router.
    Use the available tools to answer user queries and perform Elevenlabs actions.
    """
    return ReActAgent(
        tools=tools,
        llm=llm,
        description=description,
        system_prompt=system_prompt,
        verbose=True,
    );

async def chat_loop(agent: ReActAgent) -> None:
    ctx = Context(agent)
    print("Type 'quit', 'exit', or Ctrl+C to stop.")

    while True:
        try:
            user_input = input("\nYou: ").strip()
        except (KeyboardInterrupt, EOFError):
            print("\nBye!")
            break

        if not user_input or user_input.lower() in {"quit", "exit"}:
            print("Bye!")
            break

        try:
            print("Agent: ", end="", flush=True)
            handler = agent.run(user_input, ctx=ctx)

            async for event in handler.stream_events():
                # Stream token-by-token from LLM responses
                if hasattr(event, "delta") and event.delta:
                    print(event.delta, end="", flush=True)
                # Show tool calls as they happen
                elif hasattr(event, "tool_name"):
                    print(f"\n[Using tool: {event.tool_name}]", flush=True)

            # Get final response
            response = await handler
            print()  # Newline after streaming
        except KeyboardInterrupt:
            print("\n[Interrupted]")
            continue
        except Exception as e:
            print(f"\nError: {e}")

async def main() -> None:
    agent = await build_agent()
    await chat_loop(agent)

if __name__ == "__main__":
    # Handle Ctrl+C gracefully
    signal.signal(signal.SIGINT, lambda s, f: (print("\nBye!"), exit(0)))
    try:
        asyncio.run(main())
    except KeyboardInterrupt:
        print("\nBye!")
```

```typescript
import "dotenv/config";
import readline from "node:readline/promises";
import { stdin as input, stdout as output } from "node:process";

import { Composio } from "@composio/core";
import { LlamaindexProvider } from "@composio/llamaindex";

import { mcp } from "@llamaindex/tools";
import { agent as createAgent } from "@llamaindex/workflow";
import { openai } from "@llamaindex/openai";

dotenv.config();

const OPENAI_API_KEY = process.env.OPENAI_API_KEY;
const COMPOSIO_API_KEY = process.env.COMPOSIO_API_KEY;
const COMPOSIO_USER_ID = process.env.COMPOSIO_USER_ID;

if (!OPENAI_API_KEY) {
    throw new Error("OPENAI_API_KEY is not set in the environment");
  }
if (!COMPOSIO_API_KEY) {
    throw new Error("COMPOSIO_API_KEY is not set in the environment");
  }
if (!COMPOSIO_USER_ID) {
    throw new Error("COMPOSIO_USER_ID is not set in the environment");
  }

async function buildAgent() {

  console.log(`Initializing Composio client...${COMPOSIO_USER_ID!}...`);
  console.log(`COMPOSIO_USER_ID: ${COMPOSIO_USER_ID!}...`);

  const composio = new Composio({
    apiKey: COMPOSIO_API_KEY,
    provider: new LlamaindexProvider(),
  });

  const session = await composio.create(
    COMPOSIO_USER_ID!,
    {
      toolkits: ["elevenlabs"],
    },
  );

  const mcpUrl = session.mcp.url;
  console.log(`Composio Tool Router MCP URL: ${mcpUrl}`);

  const server = mcp({
    url: mcpUrl,
    clientName: "composio_tool_router_with_llamaindex",
    requestInit: {
      headers: {
        "x-api-key": COMPOSIO_API_KEY!,
      },
    },
    // verbose: true,
  });

  const tools = await server.tools();

  const llm = openai({ apiKey: OPENAI_API_KEY, model: "gpt-5" });

  const agent = createAgent({
    name: "composio_tool_router_with_llamaindex",
    description:
      "An agent that uses Composio Tool Router MCP tools to perform actions.",
    systemPrompt:
      "You are a helpful assistant connected to Composio Tool Router."+
"Use the available tools to answer user queries and perform Elevenlabs actions." ,
    llm,
    tools,
  });

  return agent;
}

async function chatLoop(agent: ReturnType<typeof createAgent>) {
  const rl = readline.createInterface({ input, output });

  console.log("Type 'quit' or 'exit' to stop.");

  while (true) {
    let userInput: string;

    try {
      userInput = (await rl.question("\nYou: ")).trim();
    } catch {
      console.log("\nAgent: Bye!");
      break;
    }

    if (!userInput) {
      continue;
    }

    const lower = userInput.toLowerCase();
    if (lower === "quit" || lower === "exit") {
      console.log("Agent: Bye!");
      break;
    }

    try {
      process.stdout.write("Agent: ");

      const stream = agent.runStream(userInput);
      let finalResult: any = null;

      for await (const event of stream) {
        // The event.data contains the streamed content
        const data: any = event.data;

        // Check for streaming delta content
        if (data?.delta) {
          process.stdout.write(data.delta);
        }

        // Store final result for fallback
        if (data?.result || data?.message) {
          finalResult = data;
        }
      }

      // If no streaming happened, show the final result
      if (finalResult) {
        const answer =
          finalResult.result ??
          finalResult.message?.content ??
          finalResult.message ??
          "";
        if (answer && typeof answer === "string" && !answer.includes("[object")) {
          process.stdout.write(answer);
        }
      }

      console.log(); // New line after streaming completes
    } catch (err: any) {
      console.error("\nAgent error:", err?.message ?? err);
    }
  }

  rl.close();
}

async function main() {
  try {
    const agent = await buildAgent();
    await chatLoop(agent);
  } catch (err: any) {
    console.error("Failed to start agent:", err?.message ?? err);
    process.exit(1);
  }
}

main();
```

## Conclusion

You've successfully connected Elevenlabs to LlamaIndex through Composio's Tool Router MCP layer.
Key takeaways:
- Tool Router dynamically exposes Elevenlabs tools through an MCP endpoint
- LlamaIndex's ReActAgent handles reasoning and orchestration; Composio handles integrations
- The agent becomes more capable without increasing prompt size
- Async Python provides clean, efficient execution of agent workflows
You can easily extend this to other toolkits like Gmail, Notion, Stripe, GitHub, and more by adding them to the toolkits parameter.

## How to build Elevenlabs MCP Agent with another framework

- [ChatGPT](https://composio.dev/toolkits/elevenlabs/framework/chatgpt)
- [OpenAI Agents SDK](https://composio.dev/toolkits/elevenlabs/framework/open-ai-agents-sdk)
- [Claude Agent SDK](https://composio.dev/toolkits/elevenlabs/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/elevenlabs/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/elevenlabs/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/elevenlabs/framework/codex)
- [Cursor](https://composio.dev/toolkits/elevenlabs/framework/cursor)
- [VS Code](https://composio.dev/toolkits/elevenlabs/framework/vscode)
- [OpenCode](https://composio.dev/toolkits/elevenlabs/framework/opencode)
- [OpenClaw](https://composio.dev/toolkits/elevenlabs/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/elevenlabs/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/elevenlabs/framework/cli)
- [Google ADK](https://composio.dev/toolkits/elevenlabs/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/elevenlabs/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/elevenlabs/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/elevenlabs/framework/mastra-ai)
- [CrewAI](https://composio.dev/toolkits/elevenlabs/framework/crew-ai)

## Related Toolkits

- [Youtube](https://composio.dev/toolkits/youtube) - YouTube is a leading video-sharing platform for uploading, streaming, and discovering content. It empowers creators and businesses to reach global audiences and monetize their work.
- [Amara](https://composio.dev/toolkits/amara) - Amara is a collaborative platform for creating and managing subtitles and captions for videos. It helps make content accessible and multilingual for global audiences.
- [Cats](https://composio.dev/toolkits/cats) - Cats is an API with a huge library of cat images, breed data, and cat facts. It makes finding adorable cat photos and trivia effortless for your apps and users.
- [Chatfai](https://composio.dev/toolkits/chatfai) - Chatfai is an AI platform that lets users talk to AI versions of fictional characters from books, movies, and games. It offers an engaging, interactive experience for fans to chat, roleplay, and explore creative dialogues.
- [Cincopa](https://composio.dev/toolkits/cincopa) - Cincopa is a multimedia platform for uploading, managing, and customizing videos, images, and audio. It helps you deliver engaging media experiences with robust APIs and flexible integrations.
- [Dungeon fighter online](https://composio.dev/toolkits/dungeon_fighter_online) - Dungeon Fighter Online (DFO) is an arcade-style, side-scrolling action RPG packed with dynamic combat and progression. Play solo or with friends to battle monsters, complete quests, and upgrade your characters.
- [Elevenreader](https://composio.dev/toolkits/elevenreader) - Elevenreader is an AI-powered text-to-speech service by ElevenLabs that converts written content into lifelike audio. It enables fast, natural audio generation from any text.
- [Epic games](https://composio.dev/toolkits/epic_games) - Epic Games is a leading video game publisher and digital storefront, known for Fortnite and Unreal Engine. It lets gamers access, manage, and purchase games all in one place.
- [Fal.ai](https://composio.dev/toolkits/fal_ai) - Fal.ai is a generative media platform offering 600+ AI models for images, video, voice, and audio. Developers use Fal.ai for fast, scalable access to cutting-edge generative AI tools.
- [Giphy](https://composio.dev/toolkits/giphy) - Giphy is the largest online library for searching and sharing GIFs and stickers. Instantly add vibrant animated content to your apps, chats, and workflows.
- [Headout](https://composio.dev/toolkits/headout) - Headout is a global platform for booking travel experiences, tours, and entertainment. It helps users discover and secure activities at top destinations, all in one place.
- [Imagekit io](https://composio.dev/toolkits/imagekit_io) - ImageKit.io is a cloud-based media management platform for image and video delivery. Instantly optimize, transform, and deliver visuals globally via a lightning-fast CDN.
- [Listennotes](https://composio.dev/toolkits/listennotes) - Listennotes is a powerful podcast search engine with a massive global database. Discover, search, and curate podcasts from around the world in seconds.
- [News api](https://composio.dev/toolkits/news_api) - News api is a REST API for searching and retrieving live news articles from across the web. Instantly access headlines, coverage, and breaking stories from thousands of sources.
- [RAWG Video Games Database](https://composio.dev/toolkits/rawg_video_games_database) - RAWG Video Games Database is the largest video game discovery and info service. Instantly access comprehensive details, ratings, and release dates for thousands of games.
- [Seat geek](https://composio.dev/toolkits/seat_geek) - SeatGeek is a live event platform offering APIs for concerts, sports, and theater data. Instantly access events, venues, and performers info for smarter ticketing and discovery.
- [Shotstack](https://composio.dev/toolkits/shotstack) - Shotstack is a cloud platform for programmatically generating videos, images, and audio. Automate creative content production at scale with flexible RESTful APIs.
- [Spotify](https://composio.dev/toolkits/spotify) - Spotify is a streaming service for music and podcasts with millions of tracks from artists worldwide. Enjoy personalized playlists, recommendations, and seamless listening across all your devices.
- [Ticketmaster](https://composio.dev/toolkits/ticketmaster) - Ticketmaster is a global platform for event discovery, ticket sales, and live entertainment management. Get real-time access to events and streamline ticketing for fans and organizers.
- [Gmail](https://composio.dev/toolkits/gmail) - Gmail is Google's email service with powerful spam protection, search, and G Suite integration. It keeps your inbox organized and makes communication fast and reliable.

## Frequently Asked Questions

### What are the differences in Tool Router MCP and Elevenlabs MCP?

With a standalone Elevenlabs MCP server, the agents and LLMs can only access a fixed set of Elevenlabs tools tied to that server. However, with the Composio Tool Router, agents can dynamically load tools from Elevenlabs and many other apps based on the task at hand, all through a single MCP endpoint.

### Can I use Tool Router MCP with LlamaIndex?

Yes, you can. LlamaIndex fully supports MCP integration. You get structured tool calling, message history handling, and model orchestration while Tool Router takes care of discovering and serving the right Elevenlabs tools.

### Can I manage the permissions and scopes for Elevenlabs while using Tool Router?

Yes, absolutely. You can configure which Elevenlabs scopes and actions are allowed when connecting your account to Composio. You can also bring your own OAuth credentials or API configuration so you keep full control over what the agent can do.

### How safe is my data with Composio Tool Router?

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your Elevenlabs data and credentials are handled as safely as possible.

---
[See all toolkits](https://composio.dev/toolkits) · [Composio docs](https://docs.composio.dev/llms.txt)
