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).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.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.
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, and pronunciation dictionaries. 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:| Field | Common values | What it does |
|---|---|---|
on_call | silent | What the PAL does while the tool runs, for example staying silent instead of narrating the call. |
on_resolve | generate_response, fire_and_forget | What happens after the result returns. generate_response has the PAL speak based on the result. fire_and_forget (the default) does not wait or narrate. |
static_filler | any string | A line to say while waiting on a slow tool. |
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.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.
