Twilio MCP Server + Salesforce MCP Server

Intermediate1 hour
Use Cases

Common Use Cases

  • SMS campaign tracking
  • Call logging
  • Customer communication history
  • Automated follow-ups
Before You Begin

Prerequisites

  • Twilio account with phone number
  • Salesforce with API access
  • Contact records in Salesforce
Walkthrough

Step-by-Step Guide

1

Configure Twilio MCP Server

Set up with your Account SID and Auth Token.

2

Configure Salesforce MCP Server

Connect with your Salesforce OAuth credentials.

3

Log SMS in Salesforce

When an SMS is sent or received, create a Task record on the matching Contact.

async function logSMS(message) {
  const contact = await salesforce.query(`SELECT Id FROM Contact WHERE Phone='${message.from}' OR MobilePhone='${message.from}'`);
  if (contact.totalSize > 0) {
    await salesforce.createTask({
      WhoId: contact.records[0].Id,
      Subject: `SMS: ${message.body.slice(0, 50)}`,
      Description: message.body,
      Status: "Completed",
      Type: "SMS"
    });
  }
}
4

Enable Two-Way Messaging

Allow sales reps to send SMS from Salesforce via Twilio.

5

Track Engagement

Monitor message delivery rates and response times in Salesforce reports.

Examples

Code Examples

typescript
Bulk SMS Campaign
async function sendCampaign(contactList, template) {
  for (const contact of contactList) {
    const body = template.replace("{name}", contact.FirstName);
    await twilio.sendSMS({ to: contact.MobilePhone, body });
    await salesforce.createTask({ WhoId: contact.Id, Subject: "Campaign SMS sent", Status: "Completed" });
  }
}
Help

Troubleshooting

How do I handle opt-outs?+
What about international numbers?+

Quick Info

DifficultyIntermediate
Time Estimate1 hour
Tools
Twilio MCP ServerSalesforce MCP Server

Need Integration Help?

Our team can implement this integration for you.

Get in Touch
Twilio MCP Server + Salesforce MCP Server Integration - CortexAgent