Simple AI agent that connects and translates text and audio into different languages in WhatsApp. Built via Luke Harries's WhatsApp MCP server.
You can find BabelBot's WhatsApp number here!
Find a video where I explain the idea behind the project, its architecture, and show a few examplary applications here!
-
Install Dependencies
# Install dependencies using uv (recommended) uv pip install -r pyproject.toml # Alternative: using pip pip install anthropic>=0.49.0 fastapi>=0.115.12 fire>=0.7.0 httpx>=0.28.1 mcp[cli]>=1.6.0 openai>=1.70.0 python-dotenv>=1.1.0 requests>=2.32.3
-
Configure Environment Variables Create a
.envfile in the root directory with the following content:# Anthropic API Key ANTHROPIC_API_KEY="your-anthropic-key" # OpenAI API Key OPENAI_API_KEY="your-openai-key" # Webhook URL (default for local development) WEBHOOK_URL="http://localhost:8000/webhook"
-
Start the WhatsApp Bridge
# Navigate to the bridge directory cd babelbot/whatsapp-mcp/whatsapp-bridge # Run the bridge go run main.go
- On first run, you'll see a QR code in the terminal
- Scan this with WhatsApp mobile app: Settings -> Linked Devices -> Link a Device
- The bridge will start on port 8080
-
Start the FastAPI Application
# From the root directory python -m babelbot.app.main- The API server will start on http://localhost:8000
- API documentation available at http://localhost:8000/docs
- The bridge needs to be running before starting the FastAPI application
- Make sure to keep your API keys secure and never commit them to version control
- The WhatsApp session will persist in the
storedirectory created by the bridge
