Skip to main content

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.

Metadata

Release files for ragazap 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ragazap 0.1.0
File Size Uploaded Provenance
ragazap-0.1.0.tar.gz 43.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ragazap 0.1.0
File Interpreter ABI Platform
ragazap-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 93.5 kB

Release files / ragazap-0.1.0.tar.gz

Download URL ragazap-0.1.0.tar.gz
Size 43.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9a589973f08394d69b27ba238120519a8218f84c50fe0d5404c4deb958a19877
BLAKE2b-256 checksum
How to use checksums
0ef18c0331851e5a69fabe88cb6ebd4a90180cba93cfc48e7e7ec4b654ce1204
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / ragazap-0.1.0-py3-none-any.whl

Download URL ragazap-0.1.0-py3-none-any.whl
Size 50.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40f2f9f6164fbb85e7639e7d3080003a9b6bb987924f7e12e4f322964a535258
BLAKE2b-256 checksum
How to use checksums
898cc2793ffa470a3f3db2f2928b6b83a062b06e7f693b2f41fc465e3090766b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Security for ragazap 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page