Sponsored by Deepsite.site

WhatsApp Message Sender MCP Tool

Created By
deuslirio8 months ago
MCP to send message using Meta whatsapp API
Content

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
  1. 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.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Tavily Mcp
WindsurfThe new purpose-built IDE to harness magic
Serper MCP ServerA Serper MCP Server
DeepChatYour AI Partner on Desktop
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
CursorThe AI Code Editor
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Amap Maps高德地图官方 MCP Server
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
ChatWiseThe second fastest AI chatbot™
Playwright McpPlaywright MCP server