mcp-whatsapp

March 28, 2026 ยท View on GitHub

MCP server exposing WhatsApp bot functionality with support for multiple adapters.

PyPI Python Coverage Ruff

Install

pip install mcp-whatsapp

WhatsApp Adapters

This package supports two WhatsApp adapters:

  • pywhatkit: Uses WhatsApp Web (default, easier setup)
  • whatsapp-business: Uses WhatsApp Business API (production-ready)

Install with adapter dependencies:

# For pywhatkit (WhatsApp Web)
pip install mcp-whatsapp[pywhatkit]

# For WhatsApp Business API
pip install mcp-whatsapp[whatsapp-business]

Usage

Setting the adapter

Set the adapter using the WHATSAPP_ADAPTER environment variable:

export WHATSAPP_ADAPTER=pywhatkit       # Default
export WHATSAPP_ADAPTER=whatsapp-business

WhatsApp Business API Configuration

For WhatsApp Business API, set these environment variables:

export WHATSAPP_PHONE_NUMBER_ID=your_phone_number_id
export WHATSAPP_ACCESS_TOKEN=your_access_token
export WHATSAPP_VERIFY_TOKEN=your_verify_token

Running as MCP Server

mcp-whatsapp

MCP Tools

ToolDescription
send_messageSend a text message to a phone number
send_mediaSend media (image, document) to a phone number
send_locationSend a location to a phone number
connect_whatsappConnect to the WhatsApp service
disconnect_whatsappDisconnect from the WhatsApp service

MCP Resources

ResourceDescription
whatsapp://statusGet the current connection status
whatsapp://configGet the adapter configuration

mcp-name

io.github.daedalus/mcp-whatsapp

Development

git clone https://github.com/daedalus/mcp-whatsapp.git
cd mcp-whatsapp
pip install -e ".[test]"

# run tests
pytest

# format
ruff format src/ tests/

# lint
ruff check src/ tests/

# type check
mypy src/

License

MIT