@jesec/retellai-mcp-server
v1.5.0
Published
Model Context Protocol server for Retell AI - Make outbound calls with AI agents
Downloads
18
Maintainers
Readme
Retell AI MCP Server
A Model Context Protocol (MCP) server for Retell AI, enabling AI assistants to make outbound calls and interact with voice services.
Features
The Retell AI MCP server provides tools for:
- Call Management: Create and manage outbound phone calls and web calls
- Agent Management: Create voice agents with customizable LLM configurations
- LLM Configuration: Design custom prompts for any use case - from restaurant reservations to complex customer service
- Phone Number Management: List and manage your Retell phone numbers
- Voice Management: Choose from various voice options for your agents
Claude Desktop Setup
- Open
Claude Desktopand pressCMD + ,to go toSettings. - Click on the
Developertab. - Click on the
Edit Configbutton. - This will open the
claude_desktop_config.jsonfile in your file explorer. - Get your Retell API key from the Retell dashboard (https://dashboard.retellai.com/apiKey).
- Add the following to your
claude_desktop_config.jsonfile. See here for more details. - Restart the Claude Desktop after editing the config file.
{
"mcpServers": {
"retellai-mcp-server": {
"command": "npx",
"args": ["-y", "@jesec/retellai-mcp-server"],
"env": {
"RETELL_API_KEY": "<your_retellai_token>"
}
}
}
}⚠️ CRITICAL: Think Before You Call - Information Gathering
NEVER skip the information gathering phase! But be INTELLIGENT about what information you need.
🧠 Think From the Recipient's Perspective
Before making any call, ask yourself: "What would the person answering this call need to know to help me?"
Every situation is unique. A call to emergency roadside assistance needs different information than a call to order flowers. Think deeply about the specific context.
Core Principle: Context-Aware Information Gathering
Instead of following rigid checklists, consider:
- Who you're calling - Business type, formality level, industry norms
- What they need to know - Think like the person answering
- What ensures success - Critical info vs nice-to-have details
Examples of Intelligent Context Thinking
- Pizza order → Size, toppings, delivery address, timing
- Car breakdown → Location, vehicle info, safety status, insurance
- Passport inquiry → Specific question, current application status, deadlines
- Dentist emergency → Pain level, duration, previous patient status
- School enrollment → Child's age, district, special needs, documentation
- Legal consultation → Matter type, urgency, how you found them
- Plumber emergency → Problem description, property access, water shut-off location
- Restaurant complaint → Order details, date/time, specific issue, desired resolution
Notice how each situation requires DIFFERENT information based on context!
✅ SMART Workflow:
- User: "Order a pizza"
- You: Think what pizza place needs → Ask contextually relevant questions
- User: Provides information
- You: Notice if anything crucial is missing, ask follow-ups if needed
- You: Create call with complete, context-appropriate information
- Result: Natural, successful conversation!
❌ COMMON Mistakes:
- Using the same questions for every call type
- Not thinking about recipient's actual needs
- Missing context-specific critical information
- Over-gathering irrelevant details for simple calls
⚠️ CRITICAL: Never Trust Agent Names!
The "Pizza Agent" Trap
Just because an agent is named "Pizza Order Agent" doesn't mean it will work for YOUR pizza order!
Why this is dangerous:
- A "Pizza Agent" might be configured for a SPECIFIC restaurant only
- It could have hardcoded addresses, menu items, or phone numbers
- The prompt might be completely wrong for your current needs
- It might be an old test agent that doesn't work properly
✅ ALWAYS Verify Agents Before Using:
- List agents - See what's available
- Check the name - But don't trust it!
- Use get_agent - Inspect the actual configuration
- Use get_retell_llm - Read the ACTUAL PROMPT to understand behavior
- Verify it matches - Ensure it fits YOUR specific needs
Example Verification Flow:
User: "Order a pizza from Domino's"
AI: Let me check what agents exist...
*Uses list_agents*
AI: I see a "Pizza Order Agent" - let me verify it...
*Checks with get_agent and get_retell_llm*
AI: This agent is hardcoded for Pizza Hut, not Domino's!
AI: Let me check for other agents...
*Finds no suitable generic agent*
AI: I'll need to create a new agent for this task...
*Creates new LLM config and agent*Remember:
- Agent names are just labels - always verify!
- Don't assume a "generic" or "general" agent exists
- You may need to create a new agent from scratch
⚠️ CRITICAL: Variable Matching Must Be EXACT!
The Variable Mismatch Disaster
THE #1 CAUSE OF CALL FAILURES: Using wrong variable names or passing variables when none are expected!
How Variables Work in Retell:
- Agent prompts contain {{VARIABLE_NAME}} placeholders
- You MUST pass EXACTLY those variable names
- If NO variables in prompt → Pass empty object {}
- Variable names are CASE-SENSITIVE
Common Failures:
❌ Prompt has NO variables, but you pass data:
// Prompt: "Call pizza place and order large pepperoni" (no {{variables}})
"retellLlmDynamicVariables": {"TASK": "order pizza"} // IGNORED!❌ Wrong variable names:
// Prompt contains: {{ORDER}} and {{CUSTOMER}}
"retellLlmDynamicVariables": {"TASK": "...", "DETAILS": "..."} // FAILS!❌ Missing required variables:
// Prompt contains: {{NAME}}, {{PHONE}}, {{ADDRESS}}
"retellLlmDynamicVariables": {"NAME": "John"} // INCOMPLETE!✅ CORRECT Variable Matching:
Check the prompt first:
Use get_retell_llm to see EXACT variable namesMatch exactly:
// If prompt has {{TASK}} and {{INFO}}: "retellLlmDynamicVariables": { "TASK": "your task here", "INFO": "your info here" } // If prompt has NO variables: "retellLlmDynamicVariables": {}
ALWAYS verify what variables the agent expects BEFORE making the call!
Example Use Cases
Basic Operations
- List all phone numbers available
- List all existing agents
- Get details about a specific agent
Making Outbound Calls
Restaurant Reservations
- Create an agent to make dinner reservations
- Handle IVR navigation and voicemail
- Confirm details and get confirmation numbers
Medical Appointments
- Schedule doctor appointments
- Handle HIPAA verification
- Navigate insurance discussions
Customer Service
- Inquire about bills or services
- Handle account verification
- Navigate complex IVR systems
Custom Scenarios
- Government services (DMV, permits)
- Travel bookings (hotels, flights)
- Home services (repairs, deliveries)
- And many more - the examples provided are just starting points!
Creating Custom Agents
The MCP server includes comprehensive prompt examples but encourages creativity:
- Mix and match elements from different examples
- Create industry-specific agents
- Experiment with different models (GPT-4o, Claude, Gemini, DeepSeek)
- Design prompts for your unique requirements
Example workflow:
- Create a custom LLM configuration with your specific prompt
- Create an agent using that LLM
- Get your phone number from the list
- Make the outbound call with dynamic variables
- Monitor the call status and get results
Repo Setup
Install dependencies:
npm iCreate a
.envfile with your RetellAI API key:RETELL_API_KEY=your_api_key_hereRun the server:
node src/retell/index.js
Available Tools
Call Tools
list_calls: Lists all Retell callscreate_phone_call: Creates a new phone callcreate_web_call: Creates a new web callget_call: Gets details of a specific calldelete_call: Deletes a specific call
Agent Tools
list_agents: Lists all Retell agentscreate_agent: Creates a new Retell agentget_agent: Gets a Retell agent by IDupdate_agent: Updates an existing Retell agentdelete_agent: Deletes a Retell agentget_agent_versions: Gets all versions of a Retell agent
Phone Number Tools
list_phone_numbers: Lists all Retell phone numberscreate_phone_number: Creates a new phone numberget_phone_number: Gets details of a specific phone numberupdate_phone_number: Updates a phone numberdelete_phone_number: Deletes a phone number
Voice Tools
list_voices: Lists all available Retell voicesget_voice: Gets details of a specific voice
License
MIT
