Integrates with Cloudflare AI Playground as a remote MCP client to access and use the custom tools defined on the server
Enables deployment of a remote MCP server on Cloudflare Workers without authentication requirements
AI Call System
A Node.js application that enables AI-powered phone calls using Twilio and OpenAI's Realtime API.
Features
- 🤖 AI-powered phone calls with natural conversation
- 📞 Real-time voice interaction using OpenAI's Realtime API
- 🔄 Interruption handling for natural conversation flow
- 📊 Call status tracking and logging
- 🚀 Easy-to-use functions and CLI interface
Setup
- Install dependencies:
- Create a
.env
file with your credentials: - Make sure your Twilio phone number is configured for voice calls and webhooks.
Usage
Method 1: Using the Functions Directly
Method 2: Using the CLI
Start the server:
Make a call:
Make a call to a specific number:
Method 3: Using the Example
API Functions
makeAICall(toNumber?, fromNumber?, serverUrl?)
Initiates an AI call using Twilio.
Parameters:
toNumber
(optional): Phone number to call (defaults toTO_PHONE_NUMBER
from env)fromNumber
(optional): Twilio phone number to call from (defaults toTWILIO_PHONE_NUMBER
from env)serverUrl
(optional): URL of your server (defaults tohttp://localhost:5050
)
Returns: Promise with call details including SID, status, etc.
startAIServer(port?)
Starts the server that handles AI calls and webhooks.
Parameters:
port
(optional): Port to run the server on (defaults to 5050)
How It Works
- Call Initiation: The
makeAICall
function creates a Twilio call to the specified number - Webhook Handling: When the call connects, Twilio sends a webhook to
/incoming-call
- Media Stream: The call connects to a WebSocket stream for real-time audio
- AI Processing: Audio is sent to OpenAI's Realtime API for processing
- Response: AI responses are converted to speech and sent back through the call
Environment Variables
Variable | Description | Required |
---|---|---|
TWILIO_ACCOUNT_SID | Your Twilio Account SID | Yes |
TWILIO_AUTH_TOKEN | Your Twilio Auth Token | Yes |
TWILIO_PHONE_NUMBER | Your Twilio phone number | Yes |
TO_PHONE_NUMBER | Default number to call | Yes |
OPENAI_API_KEY | Your OpenAI API key | Yes |
PORT | Server port (default: 5050) | No |
Development
Type checking:
Formatting:
Linting:
Troubleshooting
- "Missing Twilio credentials": Make sure all required environment variables are set in your
.env
file - "Call failed": Check that your Twilio phone number is configured for voice calls
- "Server not accessible": Ensure your server is publicly accessible for Twilio webhooks (use ngrok for local development)
Local Development with ngrok
For local development, you'll need to expose your local server to the internet:
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A deployable MCP server on Cloudflare Workers that can be accessed from Claude Desktop or Cloudflare AI Playground, allowing users to create and use custom AI tools without authentication.
Related MCP Servers
- -securityFlicense-qualityA deployable MCP server on Cloudflare Workers that provides tools without requiring authentication, allowing users to connect from Cloudflare AI Playground or Claude Desktop.Last updated -TypeScript
- -securityFlicense-qualityA Cloudflare Workers-based MCP server that enables AI tools without requiring authentication, allowing connection from Claude Desktop or the Cloudflare AI Playground.Last updated -6JavaScript
- -securityFlicense-qualityA Cloudflare Workers-based MCP server that allows users to deploy and customize tools without authentication requirements, compatible with Cloudflare AI Playground and Claude Desktop.Last updated -TypeScript
- -securityFlicense-qualityA deployable MCP server on Cloudflare Workers that enables AI tools integration without authentication requirements, compatible with AI Playground and Claude Desktop.Last updated -TypeScript