WhatsApp Message Sender MCP Tool

by deuslirio

227 downloads
Not rated
GitHub

About

This MCP server sends WhatsApp messages via the Meta (Facebook) WhatsApp Business API and provides a contacts resource. It is built for developers who want to integrate WhatsApp messaging into AI assistants or automated workflows using the Model Context Protocol.

Details

Author
deuslirio
Downloads
227
Categories
Communication

- Send WhatsApp messages via Meta Business API
- Supports international phone number format
- Provides a contacts resource listing names and numbers
- Runnable in standalone or Claude Local mode
- Configured with environment variables for credentials

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 Message Sender MCP Tool
    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 with uv pip install -e . in the cloned repository. Run the server with uv run python main.py for standalone mode, or add the whatsapp entry to your Claude Local configuration under mcpServers, setting environment variables META_ACCESS_TOKEN and META_PHONE_NUMBER_ID. The tool exposes a send_whatsapp_message tool (parameters: phone_number, message) and a contacts resource at resource://contacts.

Claude Desktop / Cursor

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

{
    "mcpServers": {
        "whatsapp message sender mcp tool": {
            "mcp-server-whatsapp-message": {
                "command": "uv",
                "args": [
                    "pip",
                    "install",
                    "-e",
                    "."
                ]
            }
        }
    }
}

McpServers

{
    "mcp-server-whatsapp-message": {
        "command": "uv",
        "args": [
            "pip",
            "install",
            "-e",
            "."
        ]
    }
}

WhatsApp Message Sender MCP Tool

This is a MCP (Model Context Protocol) that sends WhatsApp messages using the Meta (Facebook) WhatsApp Business API.

Requirements

- Python 3.12 or higher
- uv (Python package manager)
- Meta WhatsApp Business API credentials

Installation

1. Clone the repository:

git clone https://github.com/deuslirio/mcp-server-whatsapp-message.git
cd mcp-server-whatsapp-message

2. Install dependencies using uv:

uv pip install -e .

Running the Server

Standalone Mode

Start the server with:
uv run python main.py

The server will be running and ready to receive requests.

Integration with Claude Local

To add this tool to your Claude Local configuration, add the following to your Claude's configuration:
{
    "mcpServers": {
        "whatsapp": {
            "command": "uv",
            "args": [
                "run",
                "\\\\wsl.localhost\\Ubuntu-24.04\\home\\deuslirio\\PycharmProjects\\mcp-server-whatsapp-message\\main.py"
            ],
            "env": {
                "META_ACCESS_TOKEN": "your-token-here",
                "META_PHONE_NUMBER_ID": "your-phone-id-here"
            }
        }
    }
}

Note: Replace the environment variable values with your actual Meta API credentials.

Available Tools

send_whatsapp_message

Sends a WhatsApp message to a specified phone number.

Parameters:
- phone_number: The recipient's phone number (string, international format, e.g., +5562995631588)
- message: The message to send (string)

Usage Example:

{
"phone_number": "+5562000000000",
"message": "Hello! This is a test message!"
}

Available Resources

contacts

Returns a list of contacts with their names and phone numbers.

URI: resource://contacts

Example Response:

[
{"name": "João da Silva", "phone_number": "+55629999999999"}
]

Demo

Here are some screenshots demonstrating the WhatsApp Message Sender MCP Tool in action:

Sending a Message

Sending a WhatsApp message

Receiving a Message

Receiving a WhatsApp message

Using the Contacts Resource

Accessing the contacts resource

Received Message

Received Message

Troubleshooting

Common Issues

1. FastMCP Import Error:
- Verify that the mcp package is installed correctly:

     uv pip install mcp==1.6.0

2. Environment Variables Error:
- Make sure the environment variables are correctly set in your Claude Local configuration
- Verify that the variable values are correct

3. Error when running with uv run:
- Try clearing the uv cache:

     uv cache clean

- Reinstall dependencies:
     uv pip install -e .

Project Structure

mcp-server-whatsapp-message/
├── main.py                  # Server entry point
├── mcp_server/              # Main module
│   ├── __init__.py          # Module initialization
│   └── whatsapp_handler.py  # WhatsApp message handler
├── pyproject.toml           # Project configuration
├── requirements.txt         # Project dependencies
└── .env                     # Environment variables (not versioned)

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

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.