WhatsApp Multi-Capability Protocol (MCP) Server
Project description
Ragazap
A WhatsApp Multi-Capability Protocol (MCP) server that integrates the WhatsApp Cloud API with AI capabilities.
Features
- Receive and process WhatsApp messages via webhook
- Expose MCP WebSocket endpoint for AI agent connections
- Send messages to WhatsApp contacts
- Store and retrieve conversation history in Redis
- Support for text messages
- Tools for AI agents to interact with WhatsApp
- Two operation modes: Standalone and Client
Operation Modes
Standalone Mode
In standalone mode, the server operates independently with its own WhatsApp Business API credentials. This mode is useful for:
- Direct integration with WhatsApp
- Testing and development
- Single-tenant deployments
Client Mode
In client mode, the server expects WhatsApp credentials to be provided by the client through the MCP protocol. This mode is useful for:
- Multi-tenant deployments
- Managed service providers
- Clients managing their own WhatsApp Business accounts
Installation
From PyPI (Recommended)
The package is available on PyPI and can be installed using pip:
# Install the latest stable version
pip install ragazap
Direct Installation from GitHub
For development or the latest version:
# Clone the repository
git clone https://github.com/jquant/whatsapp-mcp-server.git
cd whatsapp-mcp-server
# Install the package in development mode
pip install -e .
# Install with development dependencies
pip install -e ".[dev]"
System Requirements
- Python 3.8 or higher
- Redis (optional, for conversation history)
- WhatsApp Business API access (for standalone mode)
Usage
Environment Variables
Create a .env file with the following variables:
# Mode Configuration
STANDALONE_MODE=false # Set to true for standalone mode
# WhatsApp API Configuration (Required in standalone mode)
META_API_VERSION=v22.0
META_APP_SECRET=your_app_secret
WHATSAPP_API_TOKEN=your_api_token
WEBHOOK_VERIFY_TOKEN=your_verify_token
BUSINESS_PHONE_NUMBER_ID=your_phone_number_id
# Server Configuration (Required in both modes)
WEBHOOK_HOST=0.0.0.0
WEBHOOK_PORT=8000
# Redis Configuration (Optional in both modes)
UPSTASH_REDIS_URL=your_redis_url
UPSTASH_REDIS_TOKEN=your_redis_token
# Optional Configuration
MAX_CONVERSATION_HISTORY_LENGTH=100
CONVERSATION_EXPIRATION_DAYS=7
LOG_LEVEL=INFO
Running the Server
# Using the CLI command (if installed via pip)
ragazap
# Or directly with Python
python -m app.main
API Endpoints
- Webhook:
POST /api/v1/webhook - MCP WebSocket:
ws://host:port/api/v1/mcp - Health Check:
GET /
Development
# Install development dependencies
pip install -e ".[dev]"
# Run tests
pytest
Building the Package
# Install build tools
pip install build twine
# Build the package
python -m build
# Publish to Test PyPI (for testing)
python scripts/publish_to_pypi.py --test
# Publish to PyPI
python scripts/publish_to_pypi.py
This will create both a source distribution (.tar.gz) and a wheel (.whl) in the dist/ directory.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ragazap-0.1.0.tar.gz.
File metadata
- Download URL: ragazap-0.1.0.tar.gz
- Upload date:
- Size: 43.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a589973f08394d69b27ba238120519a8218f84c50fe0d5404c4deb958a19877
|
|
| MD5 |
f57dc4c35647818265ae7541d50613d2
|
|
| BLAKE2b-256 |
0ef18c0331851e5a69fabe88cb6ebd4a90180cba93cfc48e7e7ec4b654ce1204
|
File details
Details for the file ragazap-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ragazap-0.1.0-py3-none-any.whl
- Upload date:
- Size: 50.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40f2f9f6164fbb85e7639e7d3080003a9b6bb987924f7e12e4f322964a535258
|
|
| MD5 |
819a36c33830d35e2b90227c7d4e0c03
|
|
| BLAKE2b-256 |
898cc2793ffa470a3f3db2f2928b6b83a062b06e7f693b2f41fc465e3090766b
|