Related MCP Server Resources

Explore more AI models, providers, and integration options:

  • Explore AI Models
  • Explore AI Providers
  • Explore MCP Servers
  • LangDB Pricing
  • Documentation
  • AI Industry Blog
  • Ragie Model Context Protocol Server
  • MongoDB MCP Server for LLMs
  • Email Checker MCP Server
  • CouchDB MCP Server
  • SQL Query MCP Server
Back to MCP Servers
Twilio WhatsApp FastMCP Server

Twilio WhatsApp FastMCP Server

Public
wubbyweb/mcp-generated

A simple server that enables AI models to send WhatsApp messages via the Twilio API by exposing a send\_whatsapp tool through the FastMCP framework.

Verified
python
0 tools
May 29, 2025
Updated May 30, 2025

Twilio WhatsApp FastMCP Server ๐Ÿ’ฌ

This project provides a simple FastMCP server that allows sending WhatsApp messages using the Twilio API.

Features

  • ๐Ÿ“ฒ Sends WhatsApp messages via Twilio.
  • ๐Ÿค– Exposes a send_whatsapp tool for use with FastMCP clients (like AI models).
  • ๐Ÿ”’ Loads configuration securely from a .env file.
  • ๐Ÿงช Includes a basic test script (/home/rj/Code/mcp-generated/twilio_test.py) for direct Twilio API interaction.

Setup

  1. Get the Code: Clone this repository or download the source files into /home/rj/Code/mcp-generated/.

  2. **Create a Virtual Environment (Recommended){ @@ -77,11 +77,11 @@

2. Running the Test Script

-The /home/rj/Code/mcp-generated/twilio_test.py script provides a way to directly test sending a message using your Twilio credentials without the FastMCP server. +The /home/rj/Code/mcp-generated/twilio_test.py script provides a way to directly test sending a message using your Twilio credentials without the FastMCP server. ๐Ÿ› ๏ธ

  • Modify the script: Ensure the to= number in /home/rj/Code/mcp-generated/twilio_test.py is a WhatsApp number linked to your Twilio Sandbox (if using the Sandbox) or any valid WhatsApp number (if using a purchased Twilio number). The from_ number should typically be your Twilio Sandbox number (whatsapp:+14155238886) or your purchased Twilio WhatsApp number.
  • Run the script:
  • undefined
  • undefined
python /home/rj/Code/mcp-generated/twilio_test.py
```
This will attempt to send a hardcoded message ("Is this working?") from the specified Twilio number to the specified recipient.

:** bash ๐ŸŒฑ cd /home/rj/Code/mcp-generated/ python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`

  1. Install Dependencies: The necessary dependencies are listed in /home/rj/Code/mcp-generated/whatsapp_server.py. You can install them using pip:

    pip install twilio python-dotenv pydantic-settings fastmcp

    Alternatively, if using the FastMCP framework features:

    fastmcp install /home/rj/Code/mcp-generated/whatsapp_server.py
  2. Configure Environment Variables:

    • Sign up for a Twilio account if you don't have one.
    • Get your Account SID and Auth Token from the Twilio Console.
    • Set up the Twilio Sandbox for WhatsApp or configure a dedicated Twilio WhatsApp number.
    • Create a file named .env in the project root directory (/home/rj/Code/mcp-generated/).
    • Add your Twilio credentials and WhatsApp number to the .env file: ๐Ÿ”‘
      # /home/rj/Code/mcp-generated/.env TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx TWILIO_AUTH_TOKEN=your_auth_token_here TWILIO_WHATSAPP_NUMBER=+14155238886 # Use your Twilio WhatsApp number (Sandbox or purchased)
    • Important: Replace the placeholder values with your actual credentials and number. Ensure the TWILIO_WHATSAPP_NUMBER starts with a + and includes the country code (E.164 format). The whatsapp_server.py script will automatically add the + if it's missing from the .env file. โ—
    • Trial Account Note: If you are using a Twilio trial account, the TWILIO_WHATSAPP_NUMBER will likely be the Twilio Sandbox number (+14155238886). You must enroll any recipient (to_number) phone numbers in your Twilio Sandbox via the Twilio console for messages to be delivered successfully. Sending to non-enrolled numbers requires upgrading your Twilio account.

Usage

1. Running the FastMCP Server

To make the send_whatsapp tool available for remote calls (e.g., from an AI model integrated with FastMCP):

python /home/rj/Code/mcp-generated/whatsapp_server.py

The server will start and print the Twilio number it's configured to use. It will listen for incoming requests (by default via stdio, but FastMCP supports other transports). A FastMCP client can then call the send_whatsapp tool with to_number (including the whatsapp: prefix, e.g., whatsapp:+15551234567) and message arguments.

Example Interaction (Conceptual):

A client (like an AI ๐Ÿค–) might send a request like this (format depends on the transport):

{ "tool_name": "send_whatsapp", "arguments": { "to_number": "whatsapp:+15551234567", "message": "Hello from the FastMCP server!" } }

The server will process this, call the Twilio API, and return a confirmation or error message.

2. Running the Test Script

The /home/rj/Code/mcp-generated/twilio_test.py script provides a way to directly test sending a message using your Twilio credentials without the FastMCP server. ๐Ÿ› ๏ธ

  • Modify the script: Ensure the to= number in /home/rj/Code/mcp-generated/twilio_test.py is a WhatsApp number linked to your Twilio Sandbox (if using the Sandbox) or any valid WhatsApp number (if using a purchased Twilio number). The from_ number should typically be your Twilio Sandbox number (whatsapp:+14155238886) or your purchased Twilio WhatsApp number.
  • Run the script:
    python /home/rj/Code/mcp-generated/twilio_test.py
    This will attempt to send a hardcoded message ("Is this working?") from the specified Twilio number to the specified recipient.
Publicly Shared Threads0

Discover shared experiences

Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!

Share your threads to help others
Related MCPs5
  • Ragie Model Context Protocol Server
    Ragie Model Context Protocol Server

    An MCP server that enables AI models to retrieve information from Ragie's knowledge base through a s...

    1 tools
    Added May 30, 2025
  • MongoDB MCP Server for LLMs
    MongoDB MCP Server for LLMs

    An MCP server that enables large language models to interact directly with MongoDB databases, allowi...

    Added May 30, 2025
  • Email Checker MCP Server
    Email Checker MCP Server

    Enables users to validate the existence of email addresses through a simple FastMCP tool, offering J...

    1 tools
    Added May 30, 2025
  • CouchDB MCP Server
    CouchDB MCP Server

    A TypeScript-based MCP server that enables AI assistants to interact with CouchDB databases through ...

    9 tools
    Added May 30, 2025
  • SQL Query MCP Server
    SQL Query MCP Server

    A FastMCP server that enables natural language querying of PostgreSQL databases through LLM integrat...

    Added May 30, 2025