Blogs
/
How to Build a Voice Agent with Claude Code and Claude Fable 5.2

How to Build a Voice Agent with Claude Code and Claude Fable 5.2

Retell
AI Voice Agent Platform
Published 
Nov 10, 2026
9
 min read
How to Build a Voice Agent with Claude Code and Claude Fable 5.2
About this article
Retell AI publishes this article about its own recognition. The award placements and the reviews quoted below come from G2’s 2026 Best Software Awards, which G2 bases on verified user reviews. See how G2 picks winners.
BACK TO BLOGS
See Retell AI in action
Start free
Back to top

Claude Code can build a working phone agent from your terminal. You connect it to Retell AI's MCP server with one command, describe the agent in plain language, and Claude Code creates it, writes test cases for it, and reviews its calls through the Retell API. This guide walks through that loop with Claude Fable 5.2, the model Anthropic released on November 9, 2026, and covers what to approve by hand along the way.

Retell AI publishes this guide, and the MCP server it uses is Retell's own.

What the setup looks like

Three pieces are involved. Claude Code runs in your terminal and plans the work. Retell's MCP server, at mcp.retellai.com, gives it access to the Retell API. Your Retell workspace holds the agents, phone numbers, tests and call history that the API acts on.

The MCP server exposes three tools instead of one tool per API endpoint, which keeps the tool list small enough for the model's context window. Claude Code uses them in order: it lists the available endpoints, reads the input schema for the one it needs, then invokes it. If a call includes an argument that is not in the schema, the server returns an error that names the argument and does not call the API.

Diagram of how Claude Code reaches a Retell workspace. On the left, Claude Code in your terminal, running the model Claude Fable 5.2, reads your request in plain language, plans which Retell endpoints it needs, and asks you to approve each call. It connects by MCP over HTTP, with the API key in the Authorization header, to the Retell MCP server at mcp.retellai.com, which has three tools used in order: list_api_endpoints finds the endpoint for the job, get_api_endpoint_schema reads that endpoint's input schema, and invoke_api_endpoint checks the arguments against the schema and then calls the Retell API. The Retell API acts on your Retell workspace: agents, phone numbers, knowledge bases, voices, tests, and calls. The agent answers calls with a model from Retell's list, not with Fable 5.2.
Claude Code plans the work and Retell's MCP server makes each API call after you approve it. Diagram by Retell AI, November 2026, from Retell's MCP server documentation.

One thing to settle before you start: Claude Fable 5.2 is the model doing the building, not the model on the phone. The agent you create answers calls with a model from Retell's own list, and Fable 5.2 is not in that list as of November 10, 2026. We cover that split in Claude Fable 5.2 for voice agents: where it fits and where it doesn't.

Three ways to build a Retell agent with Claude

Claude Code with the MCP server is one of three routes. They suit different people.

Claude Code + Retell MCP serverRetell AI connector in ClaudeRetell dashboard
Where you workYour terminal or IDEA chat in Claude on the web or Claude DesktopA browser
Sign-inA Retell API key in a request headerYour Retell login, over OAuthYour Retell login
What it reachesThe Retell API endpoints your key allows, apart from deprecated ones52 purpose-built tools with in-chat widgets (as of October 2026)Every setting
Agent typesWhatever the API supportsSingle-prompt agents onlyAll
Best forDevelopers, bulk changes, anything you want scripted or repeatedBuilding and editing one agent by describing itConversation flows, integrations, visual review

Sources: Retell's MCP server documentation and Claude connector documentation, read November 10, 2026.

Connect Claude Code to the Retell MCP server

You need a Retell account, a Retell API key, and Claude Code installed. Create the key in the Retell dashboard and give it only the permissions this work needs.

Run this in your terminal, with your key in place of the placeholder:

claude mcp add --transport http retell https://mcp.retellai.com \
  --header "Authorization: Bearer <RETELL_API_KEY>"

Start Claude Code and run /mcp to confirm the retell server is connected. Then run /model and choose Claude Fable 5.2 if your plan includes it. Claude Code's documentation says Fable 5.2 requires Claude Code v2.1.321 or later, and Anthropic's launch post says developers can call the model on the Claude Platform as claude-fable-5-2.

Keep the key out of the conversation. It belongs in the command above or in your client's settings, never pasted into a prompt.

Describe the agent and let Claude Code create it

Start with a read, so you can see the connection working before anything changes:

List my Retell agents and summarize what each one does.

Then describe the agent you want. Be specific about the job, the tone, what it must never do, and when it hands the call to a person:

Create a single-prompt voice agent for a dental clinic called
Northside Dental. It answers questions about hours and insurance,
books cleanings, and transfers billing questions to the front desk
at +14155550123. It should say it is an AI assistant at the start
of every call. Use Claude 5.5 Sonnet as the agent's model. Show me
the prompt before you create anything.

Claude Code drafts the prompt, looks up the schema for the endpoints it needs, and asks you to approve each API call. Read the prompt it wrote before you approve. This is where a stronger model earns its place: the prompt is the agent, and a vague one produces a vague call.

Write the test cases before you place a call

Retell's simulation testing runs your agent in a text conversation against an AI-simulated caller and grades each run pass or fail against success criteria you set. It works with single-prompt, multi-prompt and conversation flow agents, and it does not place a call. Ask Claude Code to write the suite:

Write eight simulation test cases for the Northside Dental agent.
Cover a new patient booking a cleaning, a caller who interrupts and
changes the day twice, a billing question that must be transferred,
a caller asking if they are talking to a real person, and someone
asking for medical advice the agent must decline to give. Give each
one clear success criteria. Then run them and show me the failures.

The saved cases become a regression suite. Every time the prompt changes, rerun them before the change reaches a caller.

Put the agent on a number and call your own phone

Simulation covers the logic. A real call covers the voice, the pacing and the interruptions. Ask Claude Code to list your phone numbers, assign the agent to one, and place a call to you:

Show me my Retell phone numbers and which agent is on each. Put the
Northside Dental agent on the one that has no agent, then have it
call me at +14155550199.

Three cautions. A call reaches a real phone and is billed like any other call, so check the destination number in the approval prompt. Outbound calls also require KYC on your Retell account. And if a number already has an agent on it, replacing that agent changes who answers that number, so check what is there first.

Review the calls and revise the prompt

After a handful of calls, have Claude Code read them back:

Pull the last 20 calls for the Northside Dental agent. Group the
ones that ended badly by cause, quote the turn where each went
wrong, and propose prompt changes. Do not change anything yet.

Approve the prompt changes you agree with, rerun the simulation suite, and publish. That loop of build, test, call, review and revise is the whole job, and it is the part Claude Code shortens most.

Diagram of the four-stage loop Claude Code runs on a Retell agent, each stage with an example request, what Claude Code does, and what to check. One, build the agent: Claude Code writes the prompt and creates the agent; read the prompt before you approve. Two, test without a call: it creates graded simulation test cases and runs them as text conversations; check that the success criteria match what you care about. Three, call your own phone: it assigns the agent to a number and places a call; check the destination number and which agent is replaced. Four, review the calls: it reads calls and post-call analysis and drafts changes; approve only the changes you agree with. A dotted arrow returns from stage four to stage one, labeled revise the prompt, rerun the test cases, publish.
The build, test, call and review loop, with the check to make at each stage. Diagram by Retell AI, November 2026, from Retell's MCP server and simulation testing documentation.
What you ask forWhat Claude Code does through the MCP serverNeeds your approval
"List my agents"Reads agents and their versionsLow risk, read only
"Create an agent that..."Writes a prompt, creates the agentYes. Read the prompt first
"Write and run test cases"Creates simulation test cases, runs them, reports failuresYes
"Put it on my number"Lists numbers, assigns the agentYes. Check which agent it replaces
"Call my phone"Creates a phone callYes. Check the destination number
"Review recent calls"Lists calls and reads each call's transcript, latency and post-call analysisLow risk, but transcripts can hold personal data
"Delete the old agent"Calls a delete endpointYes. Treat deletion as permanent

Which approvals to keep on

Every API call from Claude Code goes through one tool, invoke_api_endpoint. If you choose to always allow that tool, you allow every endpoint your key can reach, including delete and publish. Retell's documentation recommends approving each call separately and checking its endpoint and arguments, and we would not skip that.

  • Use a key with the least permission that does the job. A read-only key is enough for call review.
  • Read before you write. Have Claude Code fetch the current agent before it updates or deletes it.
  • Treat transcripts as untrusted text. A caller can say anything, including instructions aimed at the model. Do not let a call review session also hold approval to change agents without you looking.
  • Keep personal data out when you can. Ask for summaries of failures, not full transcripts, unless you need them.

Does it have to be Claude Fable 5.2?

No. The MCP server works with any model Claude Code can run, and Anthropic's own advice in the launch post is direct: "For most coding and knowledge tasks, we recommend that users start with Claude Opus 5.5, our strongest daily driver." It describes Fable and Mythos as built for the most ambitious, open-ended technical work.

For one agent with a short prompt, Opus 5.5 will do the job. Fable 5.2 is worth choosing when the job is large and open-ended: rewriting prompts across dozens of agents to a new standard, turning a month of failed calls into a regression suite, or migrating agents between workspaces while keeping behavior the same. Those are our judgment calls, not benchmark results. Anthropic prices Fable 5.2 at $8 per million input tokens and $40 per million output tokens on its platform.

Frequently asked questions

Can Claude Code connect to Retell AI?

Yes. Retell runs a hosted MCP server at mcp.retellai.com, and Claude Code connects to it with the claude mcp add command and a Retell API key in the Authorization header. Cursor, Claude Desktop, Codex and other MCP clients can connect to the same server.

Do I need Claude Fable 5.2 to use the Retell MCP server?

No. The server works with whichever model your MCP client runs. Anthropic recommends starting with Claude Opus 5.5 for most coding and knowledge tasks and positions Fable 5.2 for the most ambitious, open-ended technical work.

Can the voice agent itself run on Claude Fable 5.2?

Not from Retell's model list as of November 10, 2026. The agent answers calls with a model you pick from that list, which includes Claude 5.5 Opus, Claude 5.5 Sonnet and Claude 5.5 Haiku. Fable 5.2 does the building, testing and review from Claude Code.

What is the difference between the Retell MCP server and the Retell AI connector for Claude?

The MCP server signs in with a Retell API key and reaches the Retell API from clients such as Claude Code and Cursor. The connector is listed in Claude's connectors directory, signs in with your Retell login over OAuth, and shows build, deploy and test steps as widgets inside the chat. The connector builds single-prompt agents only.

Is it safe to let Claude Code manage my Retell account?

It is as safe as the key and the approvals you give it. Use a key with the minimum permissions, keep per-call approval on for invoke_api_endpoint, and review any call to a delete or publish endpoint before you approve it.

Does testing through Claude Code cost money?

Usage through the MCP server is usage of the Retell API, so calls it places are billed like any other call. Retell's testing pricing page covers what tests cost, and Claude Code usage is billed by Anthropic, under your Claude plan, usage credits or API rates depending on how you sign in.

Build one agent and run it on your own calls

According to Retell's platform data, 80% of production minutes run through agents that customers build and manage themselves. Claude Code makes that loop shorter. Follow the MCP server setup, build one agent in Retell, and judge it on your own calls before you decide anything else.

ROI Calculator
Estimate Your ROI from Automating Calls

See how much your business could save by switching to AI-powered voice agents.

All done! 
Your submission has been sent to your email
Oops! Something went wrong while submitting the form.
   1
   8
20
Oops! Something went wrong while submitting the form.

ROI Result

2,000

Total Human Agent Cost

$5,000
/month

AI Agent Cost

$3,000
/month

Estimated Savings

$2,000
/month
Live Demo
Try Our Live Demo

A Demo Phone Number From Retell Clinic Office

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

What results look like with Retell AI

The San Antonio Spurs Transformed Season Ticket Transactions for a Better Fan Experience
Read the case study
504.7×
return on investment
13.90%
of calls ended in a payment agreement
How SpareLabs Put AI Voice on the Front Line of Public Transit And Watched It Take Off
Read the case study
10x+
YoY growth in Spare's AI product line
~30%
of calls automated in the first week of deployment

Estimate your monthly voice AI cost

$  0.11
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Estimated monthly cost
$1,408
12,800 conversation minutes

Revolutionize your call operation with Retell