Back to Browse

Better Call Claude MCP Server

by Sns45
Developer ToolsUse Caution2.2MCP RegistryLocal
Free

Server data from the Official MCP Registry

Voice Calls, SMS, and WhatsApp for Claude Code with cross-channel context sharing.

About

Voice Calls, SMS, and WhatsApp for Claude Code with cross-channel context sharing.

Security Report

2.2
Use Caution2.2Critical Risk

Better Call Claude is an MCP server enabling phone/SMS/WhatsApp communication with Claude via Twilio, Telnyx, or Baileys. The codebase has reasonable authentication patterns (API keys via environment variables) and appropriate permission scoping for a communication tool. However, there are significant security concerns: (1) Webhook signature verification is implemented but not consistently enforced across all handlers, creating potential for injection attacks; (2) No validation of phone numbers or message content before passing to external APIs could enable abuse; (3) Sensitive data (transcripts, messages, API responses) may be logged or retained in memory without explicit cleanup; (4) The code is incomplete/truncated, preventing full security assessment. These issues warrant immediate remediation before production use. Supply chain analysis found 7 known vulnerabilities in dependencies (1 critical, 2 high severity). Package verification found 1 issue.

3 files analyzed ยท 18 issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

HTTP Network Access

Connects to external APIs or services over the internet.

env_vars

Check that this permission is expected for this type of plugin.

File System Read

Reads files on your machine. Normal for tools that analyze or process local data.

File System Write

Writes or modifies files on your machine. Check that this is expected for the tool.

process_spawn

Check that this permission is expected for this type of plugin.

system_info

Check that this permission is expected for this type of plugin.

What You'll Need

Set these up before or after installing:

Phone provider: 'twilio' or 'telnyx'Optional

Environment variable: BETTERCALLCLAUDE_PHONE_PROVIDER

Your phone number in E.164 formatOptional

Environment variable: BETTERCALLCLAUDE_PHONE_NUMBER

Twilio Account SID or Telnyx API KeyRequired

Environment variable: BETTERCALLCLAUDE_PHONE_ACCOUNT_SID

Twilio Auth Token or Telnyx API SecretRequired

Environment variable: BETTERCALLCLAUDE_PHONE_AUTH_TOKEN

Your personal phone number in E.164 format (for outbound calls/SMS)Optional

Environment variable: BETTERCALLCLAUDE_USER_PHONE_NUMBER

OpenAI API key for speech-to-text (Whisper) and text-to-speechRequired

Environment variable: BETTERCALLCLAUDE_OPENAI_API_KEY

WhatsApp number if different from phone number (e.g., Twilio Sandbox)Optional

Environment variable: BETTERCALLCLAUDE_WHATSAPP_NUMBER

Local HTTP server portOptional

Environment variable: BETTERCALLCLAUDE_PORT

Override Tailscale hostname for webhook URLOptional

Environment variable: TAILSCALE_HOSTNAME

WhatsApp provider: set to 'baileys' for free WhatsApp via WebSocket (no Twilio needed)Optional

Environment variable: BETTERCALLCLAUDE_WHATSAPP_PROVIDER

Path to Baileys auth state directory (default: data/baileys-auth)Optional

Environment variable: BETTERCALLCLAUDE_BAILEYS_AUTH_DIR

Max WhatsApp chat history messages to retain (default: 50)Optional

Environment variable: BETTERCALLCLAUDE_WHATSAPP_CHAT_HISTORY_SIZE

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "io-github-sns45-better-call-claude": {
      "env": {
        "TAILSCALE_HOSTNAME": "your-tailscale-hostname-here",
        "BETTERCALLCLAUDE_PORT": "your-bettercallclaude-port-here",
        "BETTERCALLCLAUDE_PHONE_NUMBER": "your-bettercallclaude-phone-number-here",
        "BETTERCALLCLAUDE_OPENAI_API_KEY": "your-bettercallclaude-openai-api-key-here",
        "BETTERCALLCLAUDE_PHONE_PROVIDER": "your-bettercallclaude-phone-provider-here",
        "BETTERCALLCLAUDE_WHATSAPP_NUMBER": "your-bettercallclaude-whatsapp-number-here",
        "BETTERCALLCLAUDE_BAILEYS_AUTH_DIR": "your-bettercallclaude-baileys-auth-dir-here",
        "BETTERCALLCLAUDE_PHONE_AUTH_TOKEN": "your-bettercallclaude-phone-auth-token-here",
        "BETTERCALLCLAUDE_PHONE_ACCOUNT_SID": "your-bettercallclaude-phone-account-sid-here",
        "BETTERCALLCLAUDE_USER_PHONE_NUMBER": "your-bettercallclaude-user-phone-number-here",
        "BETTERCALLCLAUDE_WHATSAPP_PROVIDER": "your-bettercallclaude-whatsapp-provider-here",
        "BETTERCALLCLAUDE_WHATSAPP_CHAT_HISTORY_SIZE": "your-bettercallclaude-whatsapp-chat-history-size-here"
      },
      "args": [
        "-y",
        "better-call-claude"
      ],
      "command": "npx"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub README.

Better Call Claude

๐Ÿ“ž "Hey Claude, refactor the auth module and call me when you're done or need a decision."

[20 minutes later, phone rings]

๐Ÿค– "I've finished the refactor but found a security issue. Should I fix it now or create a ticket?"

๐Ÿ’ฌ Or via SMS/WhatsApp:

You: "Claude, how's the deployment going?"

Claude: "Deployment complete. 3 services updated, all health checks passing."

Features

  • ๐Ÿ“ฑ Inbound calls - Call Claude Code from your phone to start tasks
  • ๐Ÿ“ฒ Outbound calls - Claude calls you when done, stuck, or needs decisions
  • ๐Ÿ’ฌ SMS messaging - Send and receive text messages with Claude
  • ๐Ÿ“ฑ WhatsApp - Full WhatsApp Business integration
  • ๐Ÿ”„ Cross-channel context - Start on voice, continue on WhatsApp seamlessly
  • ๐Ÿ”— Persistent sessions - Claude stays alive listening for WhatsApp messages
  • ๐Ÿ”’ Secure transport - Tailscale Funnel with guided auto-setup
  • ๐Ÿ—ฃ๏ธ Natural conversations - Multi-turn interactions across all channels
  • ๐Ÿ”ง Tool composable - Claude can use other tools while communicating
  • โšก Auto-webhook updates - Twilio webhooks auto-update when URL changes
  • ๐Ÿ†“ Free WhatsApp via Baileys - Personal WhatsApp with zero API costs, no business verification
  • โŒš Works anywhere - Phone, smartwatch, or any device

โš ๏ธ Testing Status

ChannelProviderStatus
VoiceTwilioโœ… Tested & Working
WhatsAppTwilio Sandboxโœ… Tested & Working
SMSTwilioโณ Pending A2P 10DLC verification
VoiceTelnyx๐Ÿ”ฌ Not yet tested
SMSTelnyx๐Ÿ”ฌ Not yet tested
WhatsAppTelnyx๐Ÿ”ฌ Not yet tested
WhatsAppBaileys (free)๐Ÿ”ฌ New - testing welcome

Contributions welcome for testing other provider/channel combinations!


Quick Start

1. Choose Your Setup

SetupWhat You GetCostAccounts Needed
Baileys onlyWhatsApp messagingFreeNone
Twilio/TelnyxVoice + SMS + WhatsApp~$1/mo + usageTwilio/Telnyx + OpenAI
HybridVoice + SMS (Twilio) + WhatsApp (Baileys)~$1/mo + voice usageTwilio/Telnyx + OpenAI

Just want WhatsApp? Skip to Option C: Baileys โ€” no accounts, no API keys, completely free.

2. Set Up Phone Provider

  1. Create account at portal.telnyx.com and verify identity
  2. Buy a phone number (~$1/month)
  3. Create a Voice API application:
    • Set webhook URL to your tunnel URL + /webhook/telnyx/inbound
    • Set API version to v2
  4. Enable SMS on your phone number:
    • Go to Messaging and create a Messaging Profile
    • Assign your phone number to the profile
    • Set SMS webhook URL to your tunnel URL + /webhook/telnyx/sms
  5. Enable WhatsApp (optional):
    • Go to WhatsApp in portal
    • Complete WhatsApp Business verification
    • Set webhook URL to your tunnel URL + /webhook/telnyx/whatsapp
  6. Verify your phone number for outbound calls
  7. Get your Connection ID (or Messaging Profile ID) and API Key
  1. Create account at twilio.com/console
  2. Buy a phone number
  3. Configure webhooks for your number:
    • Voice webhook: your tunnel URL + /webhook/twilio/inbound
    • SMS webhook: your tunnel URL + /webhook/twilio/sms
  4. Enable WhatsApp (optional):
    • Go to WhatsApp Senders
    • Complete WhatsApp Business setup
    • Set webhook URL to your tunnel URL + /webhook/twilio/whatsapp
  5. Get your Account SID and Auth Token

Baileys connects directly to WhatsApp's Web protocol via WebSocket. It uses your personal WhatsApp account โ€” no business verification, no API costs, no Twilio/Telnyx required.

How it works: Same as WhatsApp Web โ€” you link a device by scanning a QR code.

Step 1: Clone and install

git clone https://github.com/sns45/better-call-claude
cd better-call-claude
bun install

Step 2: Pair your WhatsApp

bun run baileys:pair
  1. A QR code will appear in your terminal
  2. Open WhatsApp on your phone > Settings > Linked Devices > Link a Device
  3. Scan the QR code
  4. Wait for "Paired successfully!" message

Your session is saved in data/baileys-auth/ โ€” you won't need to scan again.

Step 3: Add to Claude Code (~/.claude.json or ~/.claude/settings.json):

{
  "mcpServers": {
    "better-call-claude": {
      "command": "bun",
      "args": ["run", "/path/to/better-call-claude/src/index.ts"],
      "env": {
        "BETTERCALLCLAUDE_WHATSAPP_PROVIDER": "baileys",
        "BETTERCALLCLAUDE_USER_PHONE_NUMBER": "+1234567890"
      }
    }
  }
}

That's it! No Tailscale, no Twilio, no OpenAI keys needed.

Step 4: Restart Claude Code and test

Send a WhatsApp message to yourself (or have someone message you) โ€” Baileys receives it and spawns a Claude task. Or ask Claude to send you a WhatsApp:

"Send me a WhatsApp saying hello"

Get the best of both worlds: Twilio/Telnyx handles voice calls and SMS, Baileys handles WhatsApp for free.

  1. Set up Twilio or Telnyx (Options A/B above)
  2. Run bun run baileys:pair to pair your WhatsApp
  3. Add to your MCP config:
{
  "env": {
    "BETTERCALLCLAUDE_PHONE_PROVIDER": "twilio",
    "BETTERCALLCLAUDE_WHATSAPP_PROVIDER": "baileys",
    "BETTERCALLCLAUDE_PHONE_ACCOUNT_SID": "your-account-sid",
    "BETTERCALLCLAUDE_PHONE_AUTH_TOKEN": "your-auth-token",
    "BETTERCALLCLAUDE_PHONE_NUMBER": "+15551234567",
    "BETTERCALLCLAUDE_USER_PHONE_NUMBER": "+15559876543",
    "BETTERCALLCLAUDE_OPENAI_API_KEY": "sk-..."
  }
}

Voice calls and SMS go through Twilio. WhatsApp goes through Baileys (free).

3. Set Up Tailscale Funnel (for webhooks)

Skip this step if you're using Baileys-only mode (Option C). Baileys doesn't need webhooks.

Tailscale Funnel provides free, stable public URLs for receiving webhooks from your phone provider.

Why Tailscale? Free unlimited tunnels, stable URLs (no random subdomains), enterprise-grade security.

Path: Better Call Claude uses /bcc path (e.g., https://your-hostname.ts.net/bcc) to avoid conflicts with other services.

First-time setup (automated):

When you first start the MCP server, it will guide you through setup:

  1. Install Tailscale (if not installed):

    # macOS
    brew install tailscale
    
    # Linux
    curl -fsSL https://tailscale.com/install.sh | sh
    
  2. Authenticate - The server will auto-run tailscale up and open your browser

  3. Enable Funnel - Visit the URL shown in the terminal to enable Funnel on your tailnet (one-time admin step)

That's it! The server handles the rest automatically.

4. Install Better Call Claude

# Quick start with bunx (recommended)
bunx better-call-claude

# Or install globally
bun install -g better-call-claude
better-call-claude

5. Add to Claude Code

Add to ~/.claude/settings.json:

{
  "mcpServers": {
    "better-call-claude": {
      "command": "bunx",
      "args": ["better-call-claude"],
      "env": {
        "BETTERCALLCLAUDE_PHONE_PROVIDER": "telnyx",
        "BETTERCALLCLAUDE_PHONE_ACCOUNT_SID": "your-connection-id",
        "BETTERCALLCLAUDE_PHONE_AUTH_TOKEN": "your-api-key",
        "BETTERCALLCLAUDE_PHONE_NUMBER": "+15551234567",
        "BETTERCALLCLAUDE_USER_PHONE_NUMBER": "+15559876543",
        "BETTERCALLCLAUDE_OPENAI_API_KEY": "sk-..."
      }
    }
  }
}

Note: Tailscale setup is automatic on first run. The server will guide you through installation and authentication if needed.

Restart Claude Code. Done!


Environment Variables

Required Variables

VariableDescription
BETTERCALLCLAUDE_PHONE_PROVIDERtelnyx or twilio
BETTERCALLCLAUDE_PHONE_ACCOUNT_SIDProvider account/connection ID
BETTERCALLCLAUDE_PHONE_AUTH_TOKENProvider API key/auth token
BETTERCALLCLAUDE_PHONE_NUMBERYour Telnyx/Twilio phone number (E.164)
BETTERCALLCLAUDE_WHATSAPP_NUMBERWhatsApp number if different (e.g., Twilio Sandbox)
BETTERCALLCLAUDE_USER_PHONE_NUMBERYour personal phone number
BETTERCALLCLAUDE_OPENAI_API_KEYOpenAI API key for TTS/STT

Baileys (Free WhatsApp)

VariableDefaultDescription
BETTERCALLCLAUDE_WHATSAPP_PROVIDER(unset)Set to baileys to enable free WhatsApp
BETTERCALLCLAUDE_BAILEYS_AUTH_DIRdata/baileys-authSession credential directory

Baileys-only mode: When WHATSAPP_PROVIDER=baileys and no Twilio/Telnyx credentials are set, only USER_PHONE_NUMBER is required. No Tailscale, no OpenAI key needed.

Tailscale (Optional)

VariableDefaultDescription
TAILSCALE_HOSTNAMEauto-detectedOverride Tailscale hostname

Optional Variables

VariableDefaultDescription
BETTERCALLCLAUDE_TTS_VOICEonyxOpenAI voice (alloy, echo, fable, onyx, nova, shimmer)
BETTERCALLCLAUDE_PORT3333Local HTTP server port
BETTERCALLCLAUDE_TRANSCRIPT_TIMEOUT_MS180000Speech timeout (3 min)
BETTERCALLCLAUDE_STT_SILENCE_DURATION_MS800End-of-speech detection

Usage

Voice Calls

You โ†’ Claude (Inbound Calls)

Call your Telnyx/Twilio phone number from your personal phone:

๐Ÿ“ฑ "Hey Claude, I need you to write unit tests for the payment module. Call me when you're done."

Claude will acknowledge and start working. When done, it calls you back.

Claude โ†’ You (Outbound Calls)

Claude can initiate calls when it needs your input:

๐Ÿค– "I found 3 different approaches for the caching layer. Want me to explain them so you can choose?"

Voice Commands During Calls
  • "Hang up" or "Goodbye" - End the call
  • "Hold on" - Claude waits for you to continue
  • "Go ahead" - Claude continues with the task
  • "Cancel that" - Abort current action

SMS Messaging

You โ†’ Claude (Inbound SMS)

Text your Telnyx/Twilio number:

๐Ÿ’ฌ "Hey Claude, what's the status of the deployment?"

Claude will respond via SMS:

๐Ÿค– "Deployment is 80% complete. Running integration tests now. ETA: 5 minutes."

Claude โ†’ You (Outbound SMS)

Claude can send you text updates:

๐Ÿค– "Build failed on line 42 of auth.ts. Reply with 'fix' to auto-fix or 'skip' to continue."


WhatsApp

You โ†’ Claude (Inbound WhatsApp)

Send a WhatsApp message to your business number:

๐Ÿ’ฌ "Show me the error logs from the last hour"

Claude responds in WhatsApp:

๐Ÿค– "Found 3 errors:\n1. Connection timeout at 14:32\n2. Auth failure at 14:45\n3. Rate limit at 15:01\n\nWant me to investigate any of these?"

Claude โ†’ You (Outbound WhatsApp)

Claude can send rich WhatsApp messages:

๐Ÿค– "Code review complete! Found 2 issues:\nโ€ข Line 23: Unused variable\nโ€ข Line 67: Missing error handling\n\nReply 'fix' to auto-fix or 'details' for more info."


Cross-Channel Context

Start a task on voice and seamlessly continue on WhatsApp - Claude remembers everything.

Example Flow
  1. Call Claude:

    ๐Ÿ“ž "Hey Claude, run the todo app in dev mode and let's continue on WhatsApp"

  2. Claude starts the app and enters WhatsApp listening mode:

    ๐Ÿค– "Todo app running on port 5173. Send me WhatsApp messages for more instructions."

  3. Send WhatsApp message:

    ๐Ÿ’ฌ "Expose it via localtunnel and add the URL to allowed hosts"

  4. Claude responds via WhatsApp:

    ๐Ÿค– "Done! Localtunnel URL: https://xyz.loca.lt - I've added it to vite.config.ts allowedHosts"

  5. Continue the conversation:

    ๐Ÿ’ฌ "What's the public IP so I can access it remotely?"

    ๐Ÿค– "Your public IP is 203.0.113.42. Access the app at https://xyz.loca.lt"

Key phrases to trigger WhatsApp listening:

  • "Continue on WhatsApp"
  • "Let's talk on WhatsApp"
  • "Listen for my WhatsApp messages"

WhatsApp Sandbox (Twilio)

For testing, you can use Twilio's WhatsApp Sandbox instead of a full WhatsApp Business account.

  1. Go to Twilio Console > Messaging > WhatsApp Sandbox
  2. Send the join code to the sandbox number (+1 415 523 8886)
  3. Set the webhook URL to {your-tailscale-url}/bcc/webhook/twilio/whatsapp
  4. Add to your config:
    "BETTERCALLCLAUDE_WHATSAPP_NUMBER": "+14155238886"
    

Note: Sandbox requires re-joining every 72 hours.


How It Works

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Your Phone    โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€>โ”‚      Phone Provider              โ”‚
โ”‚  ๐Ÿ“ž Voice       โ”‚<โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚   (Telnyx/Twilio)                โ”‚
โ”‚  ๐Ÿ’ฌ SMS         โ”‚         โ”‚                                  โ”‚
โ”‚  ๐Ÿ“ฑ WhatsApp    โ”‚         โ”‚   โ€ข Voice API                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ”‚   โ€ข Messaging API                โ”‚
                            โ”‚   โ€ข WhatsApp Business API        โ”‚
                            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                           โ”‚ webhooks
                                           โ–ผ
                            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                            โ”‚     Transport Layer              โ”‚
                            โ”‚     (Tailscale Funnel)           โ”‚
                            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                           โ”‚
                                           โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Claude Code   โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ–บ โ”‚   Better Call Claude MCP Server  โ”‚
โ”‚   (your IDE)    โ”‚  stdio  โ”‚   (local, port 3333)             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ”‚                                  โ”‚
                            โ”‚   โ€ข Voice handling               โ”‚
                            โ”‚   โ€ข SMS handling                 โ”‚
                            โ”‚   โ€ข WhatsApp handling            โ”‚
                            โ”‚   โ€ข Conversation management      โ”‚
                            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                           โ”‚
                                           โ–ผ
                            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                            โ”‚         OpenAI API               โ”‚
                            โ”‚    (Whisper STT + TTS)           โ”‚
                            โ”‚    (Voice calls only)            โ”‚
                            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Communication Flows

Voice:

  1. Inbound: You call โ†’ Provider โ†’ Webhook โ†’ MCP Server โ†’ Claude Code
  2. Outbound: Claude Code โ†’ MCP Server โ†’ Provider โ†’ Your phone rings
  3. Speech: Your voice โ†’ Whisper STT โ†’ Text โ†’ Claude โ†’ TTS โ†’ Audio playback

SMS:

  1. Inbound: You text โ†’ Provider โ†’ Webhook โ†’ MCP Server โ†’ Claude Code
  2. Outbound: Claude Code โ†’ MCP Server โ†’ Provider API โ†’ SMS delivered

WhatsApp:

  1. Inbound: You message โ†’ Provider โ†’ Webhook โ†’ MCP Server โ†’ Claude Code
  2. Outbound: Claude Code โ†’ MCP Server โ†’ Provider API โ†’ WhatsApp delivered

MCP Tools

Voice Tools

receive_inbound_call

Accept and process an incoming call from the user.

initiate_call

Start a phone call to the user.

const { callId, response } = await initiate_call({
  message: "Hey! I finished the refactor. What should I work on next?"
});
continue_call

Continue an active call with follow-up messages.

const response = await continue_call({
  call_id: callId,
  message: "Got it. Should I also add the caching layer?"
});
speak_to_user

Speak without waiting for a response (for acknowledgments).

await speak_to_user({
  call_id: callId,
  message: "Let me search for that. One moment..."
});
end_call

End an active call.

await end_call({
  call_id: callId,
  message: "Perfect, I'll get started. Talk soon!"
});
get_call_status

Check status of current or recent calls.

const status = await get_call_status({ call_id: callId });
// { state: "active", duration: 45, transcript: [...] }

Messaging Tools

receive_inbound_message

Check for incoming SMS or WhatsApp messages.

const result = await receive_inbound_message({
  channel: "any",      // "sms", "whatsapp", or "any"
  timeout_ms: 5000     // How long to wait
});
// { success: true, channel: "sms", conversation_id: "...", message: "Deploy now" }
send_sms

Send an SMS message to the user.

const result = await send_sms({
  message: "Build complete! 42 tests passed.",
  wait_for_reply: true,
  timeout_ms: 180000
});
// { success: true, conversation_id: "...", reply: "Great, deploy it" }
send_whatsapp

Send a WhatsApp message to the user.

const result = await send_whatsapp({
  message: "Found 3 issues in code review:\nโ€ข Issue 1\nโ€ข Issue 2\nโ€ข Issue 3",
  wait_for_reply: true
});
// { success: true, conversation_id: "...", reply: "Fix issue 1 first" }
reply_to_conversation

Reply to an existing conversation (works for voice, SMS, or WhatsApp).

const result = await reply_to_conversation({
  conversation_id: "abc-123",
  message: "Got it, fixing issue 1 now.",
  wait_for_reply: false
});
get_conversation_history

Get the full message history for any conversation.

const history = await get_conversation_history({
  conversation_id: "abc-123"
});
// { success: true, channel: "whatsapp", messages: [...], state: "active" }

Costs

Voice Calls

ServiceCost
Telnyx outbound calls~$0.007/min
Twilio outbound calls~$0.014/min
OpenAI Whisper (STT)~$0.006/min
OpenAI TTS~$0.015/1K chars

Typical voice conversation: ~$0.03-0.05/minute

SMS

ServiceCost
Telnyx SMS (US)~$0.004/message
Twilio SMS (US)~$0.0079/message

Typical SMS exchange: ~$0.01-0.02/exchange

WhatsApp

ServiceCost
Baileys (personal WhatsApp)Free
Telnyx WhatsApp~$0.005/message
Twilio WhatsApp~$0.005/message + conversation fees

Typical WhatsApp exchange: Free (Baileys) or ~$0.01-0.02 (Twilio/Telnyx)

Infrastructure

ServiceCost
Phone number~$1/month
Tailscale FunnelFree

Security Considerations

Tailscale Funnel Security

  • Funnel creates a public endpoint but traffic routes through Tailscale's secure network
  • Integrates with SSO/SCIM for enterprise use
  • Audit logs available in Tailscale admin console
  • Webhook signatures verified by default

General

  • Phone numbers are never logged
  • Call transcripts are ephemeral (cleared on restart)
  • Use environment variables, never hardcode credentials

Capability attestation

This repo ships a smithmark capability manifest, smithmark.yaml, at the repo root. It is a "trust as code" declaration of everything this server touches outside its own process: the network hosts it egresses to (Twilio, Telnyx, OpenAI, WhatsApp/Baileys infrastructure, and, transitively, api.anthropic.com via the spawned claude subprocess), the filesystem paths it reads/writes (Baileys auth state, spawn debug logs), the binaries it executes (claude, tailscale, which, open, sudo), the environment variables it reads, and the secret types it handles (Twilio, Telnyx, and OpenAI API keys).

On every GitHub release, .github/workflows/smithmark-attest.yml produces a keyless Sigstore attestation over the published npm tarball: GitHub's OIDC token is exchanged for a short-lived Fulcio signing certificate, the attestation is signed with it, and the signature is recorded in the public Rekor transparency log. There are no signing keys and no secrets involved. The resulting smithmark-attestation.sigstore.json is attached to the GitHub release.

Verify a published version with:

smithmark verify better-call-claude@3.1.1 \
  --certificate-identity "https://github.com/sns45/better-call-claude/.github/workflows/smithmark-attest.yml@refs/tags/v3.1.1" \
  --certificate-oidc-issuer "https://token.actions.githubusercontent.com"

(substitute the actual release tag for v3.1.1)

smithmark.yaml is the authoritative declaration of this server's capability surface. smithmark lint (and verify in strict mode) is deliberately host-unaware: it flags every network/exec/filesystem call site as a generic "undeclared" finding regardless of what the manifest declares at the host level, so it will report advisory findings against any real MCP server that talks to the network. Those findings are expected noise, not a sign the manifest is out of date; the manifest above is the record to trust.


Troubleshooting

Voice Issues

Claude doesn't answer calls
  1. Check the MCP server is running: claude --debug
  2. Verify webhook URL is configured in provider dashboard
  3. Ensure Tailscale Funnel is active
Can't make outbound calls
  1. Verify BETTERCALLCLAUDE_USER_PHONE_NUMBER is correct
  2. Check phone number is verified with provider
  3. Ensure sufficient balance in provider account
Audio quality issues
  1. Check network connectivity
  2. Try different TTS voice: BETTERCALLCLAUDE_TTS_VOICE=nova
  3. Adjust silence detection: BETTERCALLCLAUDE_STT_SILENCE_DURATION_MS=1000

SMS Issues

SMS not being received
  1. Verify SMS is enabled on your phone number in provider dashboard
  2. Check SMS webhook URL is set: /webhook/telnyx/sms or /webhook/twilio/sms
  3. Verify Messaging Profile is assigned to phone number (Telnyx)
Can't send outbound SMS
  1. Check phone number has SMS capability
  2. Verify destination number format (E.164: +15551234567)
  3. Check provider account balance

WhatsApp Issues

WhatsApp messages not received
  1. Verify WhatsApp Business is set up in provider portal
  2. Check webhook URL: /webhook/telnyx/whatsapp or /webhook/twilio/whatsapp
  3. Ensure WhatsApp Business verification is complete
Can't send WhatsApp messages
  1. User must have messaged you first (WhatsApp 24-hour rule)
  2. Check WhatsApp Business approval status
  3. Verify message template compliance (for outbound-first messages)

Baileys Issues

QR code doesn't appear

The QR code cannot display inside the MCP server (stdout is reserved for MCP protocol). Run the pairing script separately:

cd /path/to/better-call-claude
bun run baileys:pair

Once paired, the session is saved and the MCP server connects automatically.

"Baileys configured but no session found"

Run bun run baileys:pair to pair your WhatsApp first, then restart Claude Code.

WhatsApp logged out

Delete the auth directory and re-pair:

rm -rf data/baileys-auth
bun run baileys:pair
Messages not being received
  1. Check that Baileys is connected (look for [Baileys] Connected in stderr)
  2. Ensure messages are from individual chats (group messages are filtered out)
  3. Verify the sender is not the linked account itself (own messages are filtered)

Tailscale Issues

"Tailscale not running"
  1. macOS: Open the Tailscale app from Applications
  2. Linux: sudo systemctl start tailscaled && tailscale up
"Funnel not enabled"
  1. Visit the URL shown in the terminal to enable Funnel
  2. Or go to https://login.tailscale.com/admin/acls and add Funnel capability
Funnel starts but webhooks don't work
  1. Check tailscale funnel status shows /bcc pointing to your port
  2. Verify your phone provider webhook URL matches the Tailscale URL (with /bcc path)
  3. Test with curl https://your-hostname.ts.net/bcc/health

Development

# Clone the repo
git clone https://github.com/sns45/better-call-claude
cd better-call-claude

# Install dependencies
bun install

# Run in development mode
bun run dev

Testing locally

# Start the MCP server
bun run dev

# In another terminal, test with MCP inspector
npx @anthropics/mcp-inspector

Tech Stack

  • Runtime: Bun - Fast JavaScript runtime
  • Web Framework: Hono - Lightweight, fast web framework
  • Phone: Telnyx / Twilio - Telephony APIs
  • WhatsApp: Baileys - Free WhatsApp Web protocol
  • Speech: OpenAI Whisper - STT/TTS
  • Transport: Tailscale Funnel - Public URL tunneling
  • Protocol: MCP - Model Context Protocol

Contributing

PRs welcome! Please see CONTRIBUTING.md for guidelines.


License

MIT

Reviews

No reviews yet

Be the first to review this server!