Why connect your editor
A working voice agent has two parts that have to agree:- The PAL needs to know which tools exist and when to call them. That lives in the PAL’s tool definitions and prompt.
- Your application needs to handle those calls when they fire. That lives in your code.
Develop the PAL
Create and patch the PAL’s layers, prompt, guardrails, and objectives.
Wire tool calls
Define tools, attach them, and generate the handler code in your own app.
Test the integration
Start chat or full conversations and watch tool calls round-trip live.
Connect a client
The server is reachable at an HTTPS/mcp endpoint. Authentication uses a browser-based OAuth flow: the PAL Maker mints a per-user API key and the server forwards it to the Tavus API as x-api-key. No key or shared token sits in your client config.
Production
https://mcp.tavus.io/mcp (custom domain).Preview
https://mcp.tavus-preview.io/mcp (Cloudflare-owned domain).1
Step 1: Add the server
Point your MCP client at the hosted endpoint.For Codex:For Claude Code:This registers the server under the name
tavus for your user scope.2
Step 2: Authenticate in the browser
On first use, the client runs an OAuth flow against the server. For Codex, you can start it directly:Then the flow is:
- The client initiates the authorize flow.
- The portal redirects to
/dev/cli-authorize?mode=oauth. - You sign in.
- The portal mints a per-user Tavus API key.
- You are redirected back to the client’s loopback callback.
- The server exchanges the authorization code and forwards the minted key to the Tavus API as
x-api-keyon every downstream call.
3
Step 3: Drive Tavus from your agent
Once authenticated, the full Tavus toolset is available: PAL CRUD, faces, conversations, builder, chat-mode testing, guardrails, objectives, tools, pronunciation dictionaries, built-in PAL Maker capabilities (Magic Canvas, Slide Presenter, Web Search, Perception, Memory), and Knowledge documents. See Agentic PAL building & testing for the autonomous PAL loop, or the MCP tools reference for the full catalog.
MCP tools return data and file manifests. They do not write files themselves. Your client decides what to do with the returned data, such as writing a generated tool handler into your repo.
Bidirectional tool calls
A tool call in Tavus is an exchange, and that exchange is what connects the PAL to your app:- During a conversation the PAL decides a tool is needed, based on the tool’s
descriptionand the PAL’s prompt, and calls it with arguments. - Tavus delivers that call to your code.
- Your code runs its logic and returns a result.
- The PAL uses the result to decide what to say and do next.
Two delivery channels
A tool’sdelivery field sets where the call is delivered. It is the main choice you make when you define a tool.
- To your client (app_message)
- To your backend (api webhook)
Controlling what the PAL does around the call
Two fields shape the conversational behavior of the exchange:
Use
on_resolve: generate_response when the result should change what the PAL says next, such as an order status or an availability check. Use fire_and_forget for side effects the PAL does not need to react to.
A complete example
A backend lookup the PAL can call to answer “where’s my order?”:get_order_status tool
{ "order_id": "A-10428" } to your endpoint. Your handler returns JSON, for example:
on_resolve is generate_response, the PAL speaks from that result, for example: “Good news, order A-10428 is out for delivery and should arrive today by 6pm.”
Build and test it with your agent
One agent can do every step above. A typical loop:- Define the tool. The agent calls
tavus_tool_createwith theparametersanddeliverythat match what the tool should do. - Attach it.
tavus_pal_tools_attachwires the tool onto your PAL so it is offered during conversations. - Write the handler. For an
apitool, the agent scaffolds the matching endpoint in your repo (the route atdelivery.api.url) so the request and response shape match the tool’sparameters. - Test the exchange.
tavus_chat_startandtavus_chat_turn(text only), ortavus_conversation_create(full video), start a session so you can watch the tool fire and your handler respond, then iterate.
tavus_pal_build_and_verify. See Agentic PAL building & testing.
The server flags a likely duplicate when you create a tool that resembles one you already have, so your agent can attach the existing tool instead. Prefer attaching saved tools over redefining them inline. See the MCP tools reference for
tavus_tool_list, tavus_tool_create, and tavus_pal_tools_attach.Built-in capabilities
Custom tools are one way to extend a PAL. The other is the set of built-in PAL Maker capabilities - Magic Canvas, Slide Presenter, Web Search, Perception, and Memory - which the server exposes through friendly, portal-aligned tools so your agent turns them on the same way PAL Maker does:tavus_pal_capability_cataloglists the five capabilities and their backend mappings.tavus_pal_capabilities_listshows what is attached to a PAL and its config.tavus_pal_capability_attach/tavus_pal_capability_patch/tavus_pal_capability_detachmanage them by friendly ID (magic_canvas,slide_presenter,web_search,perception,memory).
/pals/{id}/skills) while Perception persists through layers.perception. For skills that are not one of the five capabilities, the raw tavus_skill_list and tavus_pal_skill_* tools work with a skill by its registry ID.
Knowledge
Give a PAL documents to ground its answers with the Knowledge tools. This is a two-step flow that mirrors PAL Maker’s Knowledge section:- Create the document.
tavus_document_createingests an already-hosted URL with a normal Tavus API key. To upload a local file,tavus_document_uploadruns the portal path (local file → tavus-api upload/S3 URL → document record) and needs a locally running MCP server plusTAVUS_PORTAL_BEARER_TOKEN. - Attach it.
tavus_pal_knowledge_add(or_replace) wires documents and document tags onto the PAL.tavus_pal_knowledge_settings_patchtunes RAG behavior underlayers.knowledge_base, andtavus_pal_knowledge_uploaddoes the upload-and-attach in one call.
Use
tavus_document_chunks to inspect the text RQH actually indexed for a document before relying on it - it returns the ingested chunks, not the source file. See the MCP tools reference for the full capability, skill, and Knowledge catalogs.Environment alignment
The server must run in the same environment as the portal that minted your key.Troubleshooting the connection
The server exposes standard OAuth discovery metadata you can inspect directly:/mcp request should return 401 with a WWW-Authenticate header pointing at the protected-resource metadata URL. If that header or the discovery endpoints are missing, the OAuth flow cannot complete. Re-add the server and retry the browser sign-in.
