Skip to main content
TW

Twilio

v0.2.1API Key

Global SMS + WhatsApp + Voice + 2FA Verify + phone Lookup across 180+ countries. Fills the global gap in the messaging category (all other entries are BR-specific).

22 tools3 env vars🌐 GLOBALstable on npm

What your agent can do

Twilio gives your agent 22 tools it calls directly β€” pick the ones it needs, in Claude, Cursor, or any MCP client.

  • send_message β€” Send an SMS or WhatsApp message. For WhatsApp, prefix `To` (and `From`) with `whatsapp:+E164`. Supply either `From` (a Twilio phone number) OR `MessagingServiceSid` (a Messaging Service). If neither is given, falls back to env TWILIO_MESSAGING_SERVICE_SID.
  • get_message β€” Retrieve a message resource by SID (SM... or MM...).
  • list_messages β€” List messages with optional filters. Returns Twilio's paginated list; pass PageSize to cap.
Example call
// Your agent calls a tool directly β€” no glue code.
// CodeSpar's managed tier handles OAuth2, token rotation and rate limits.
const result = await session.call("send_message", { /* ... */ });

Install

terminal
$ npm install @codespar/mcp-twilio

Quickstart

Add this entry to your claude_desktop_config.json (or any MCP-compatible client config).

claude_desktop_config.json
{
  "mcpServers": {
    "twilio": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-twilio"
      ],
      "env": {
        "TWILIO_ACCOUNT_SID": "<your_twilio_account_sid>",
        "TWILIO_AUTH_TOKEN": "<your_twilio_auth_token>"
      }
    }
  }
}

After restart, your agent can call any of the 22 tools below β€” try send_message first.

Environment variables Β· 3

Required to authenticate the server. Stored encrypted when using CodeSpar managed hosting.

TWILIO_ACCOUNT_SID
required

Twilio Account SID (starts with AC...). Used as username for HTTP Basic auth.

TWILIO_AUTH_TOKEN
requiredsecret

Twilio Auth Token. Used as password for HTTP Basic auth.

TWILIO_MESSAGING_SERVICE_SID
optional

Optional default Messaging Service SID (starts with MG...) used for send_message when From is omitted.

Available tools Β· 22

Each tool is independent β€” your agent loads only what it needs to reduce context and response time.

WRITEsend_message
Send an SMS or WhatsApp message. For WhatsApp, prefix `To` (and `From`) with `whatsapp:+E164`. Supply either `From` (a Twilio phone number) OR `MessagingServiceSid` (a Messaging Service). If neither is given, falls back to env TWILIO_MESSAGING_SERVICE_SID.
READget_message
Retrieve a message resource by SID (SM... or MM...).
READlist_messages
List messages with optional filters. Returns Twilio's paginated list; pass PageSize to cap.
DELETEdelete_message
Delete a message from history. Irreversible.
READmake_call
Place an outbound voice call. Twilio fetches TwiML from `Url` on connect to drive the call.
READget_call
Retrieve a call resource by SID (CA...).
WRITEupdate_call
Modify an in-progress call. Set Status='completed' to hang up, or pass a new Url to redirect the call to fresh TwiML.
READstart_verification
Start a Verify (2FA) challenge. Sends a one-time code to `To` via the chosen channel. Requires a Verify Service SID (VA...).

Compatible frameworks

MCP is a protocol β€” any framework that speaks it can mount this server.

Claude Agent SDKAnthropic
OpenAI AgentsOpenAI
Vercel AI SDKVercel
LangChainLangChain
LlamaIndexLlamaIndex
CrewAICrewAI
MastraMastra
Any MCP clientProtocol

Frequently asked questions

Run `npx -y @codespar/mcp-twilio` and add the config block above to your MCP client β€” Claude, Cursor, VS Code, or any MCP-compatible client. No build step, no SDK required. Prefer hosted? CodeSpar's managed tier runs it for you with auth handled.
Twilio β€” MCP server Β· 22 tools | CodeSpar