WhatsApp MCP Assistant (Client-Server)

by Nirsisr

3 stars
211 downloads
Not rated
GitHub

About

The WhatsApp MCP Assistant (Client‑Server) is a natural‑language pipeline that sends and schedules WhatsApp messages. It uses a Mistral LLM to interpret user intent and Twilio’s WhatsApp API to perform the messaging.

Details

Author
Nirsisr
GitHub stars
3
Downloads
211
Categories
AI

- Uses Mistral LLM for natural‑language intent parsing
- Sends and schedules WhatsApp messages via Twilio
- Client‑server architecture with a CLI interface
- Configurable via config.py with API keys and numbers

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name WhatsApp MCP Assistant (Client-Server)
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install dependencies (pip install twilio requests fastapi), update config.py with your API keys and phone numbers, then run the server (python mcp_server.py) and the client (python mcp_client.py) in separate terminals. Type free‑form prompts like “Send a message to Nir.”

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "whatsapp mcp assistant (client-server)": {
            "MCPWhatsApp": {
                "command": "python",
                "args": [
                    "mcp_server.py"
                ]
            }
        }
    }
}

McpServers

{
    "MCPWhatsApp": {
        "command": "python",
        "args": [
            "mcp_server.py"
        ]
    }
}

WhatsApp MCP Assistant (Client-Server)

This project builds a client-server pipeline to send and schedule WhatsApp messages using natural language. The server interprets user intent with Mistral's LLM and uses Twilio to perform the actual WhatsApp messaging.

Files

- mcp_server.py: The main MCP server that uses Mistral for interpreting user input and calls Twilio to send messages.
- mcp_client.py: Simple CLI client for interacting with the server using free-form natural language.
- config.py: Stores API keys and constants including phone number config.

Server-Client Idea

The server parses your intent using Mistral's LLM and converts it into actionable instructions (like sending a message). The client is a CLI interface where you type prompts like "Send a message to Nir", and the backend handles the rest.

Twilio:

Twilio provides a programmable WhatsApp messaging API. It's used here to send messages or simulate scheduling via WhatsApp.

⚠️ WhatsApp 24-Hour Window Limitation (Twilio)

If you're using Twilio's WhatsApp API, note that freeform messages (i.e., regular text messages) are only allowed within a 24-hour window after the user last messaged your WhatsApp number.

If you attempt to send a message outside of that window, you'll see this error in your Twilio dashboard:
"Failed to send freeform message because you are outside the allowed window. If you are using WhatsApp, please use a Message Template"

✅ To fix this:

- You must use a pre-approved Message Template for messages sent after the 24-hour window.
- You can create templates in your Twilio Console > Messaging > Templates.

💡 For local testing:

If you’re just testing this with your own number and it’s failing, make sure you’ve sent a message to the Twilio number from your own WhatsApp recently — that resets the 24-hour window.

MCP Idea:

The MCP Server wraps a function-calling capable LLM (Mistral) to dynamically route user intent to appropriate tools (send/schedule WhatsApp messages). The client allows CLI-based prompt entry.

How to Run

1. Install dependencies:

    pip install twilio requests fastapi

2. Update config.py with real values.

3. Run the server:

    python mcp_server.py

4. In another terminal, run the client:

    python mcp_client.py

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.