community_usecase/Whatsapp-MCP/README.md
This project demonstrates a use case connecting OWL (from CAMEL-AI.org) with the WhatsApp MCP Server. It enables fully automated, agentic replies within messaging apps—without needing predefined workflows or manual tool selection. Simply send a plain message and let the system handle the rest.
Automated, Agentic Messaging:
OWL interacts with the WhatsApp MCP server in real time. Roleplay agents infer the intent behind your messages, automatically selecting the correct toolkit to generate and send responses.
Seamless Communication Integration:
This integration demonstrates how intelligent agents can operate across different communication platforms with zero manual orchestration.
No Predefined Workflow:
No need for rigid, pre-set procedures. The system dynamically handles each conversation.
Zero Tool Selection Required:
Simply send a message; the right toolkit is autonomously selected based on the agent’s inference.
Real-Time Interaction:
OWL continuously communicates with the WhatsApp MCP server to access message histories, send replies, and manage media files.
Message Processing:
Agent Collaboration:
Automated Reply:
curl -LsSf https://astral.sh/uv/install.sh | sh
Clone Repositories:
git clone https://github.com/camel-ai/owl.git
git clone https://github.com/lharries/whatsapp-mcp.git
Set Up the WhatsApp Bridge:
cd whatsapp-mcp/whatsapp-bridge
go run main.go
Configure MCP Server Integration:
claude_desktop_config.json or mcp.json) with the following content (ensure you replace the placeholder paths):
{
"mcpServers": {
"whatsapp": {
"command": "<PATH_TO_UV>",
"args": [
"--directory",
"<PATH_TO_REPO>/whatsapp-mcp/whatsapp-mcp-server",
"run",
"main.py"
]
}
}
}
Running the OWL MCP Integration:
python owl/community_usecase/Whatsapp-MCP/app.py
What is MCP?
MCP (Model Context Protocol) standardizes communication between AI models and external tools and data sources. Learn more at the MCP Documentation.
Basic Architecture:
MCP uses a client-server model, where a host application communicates with multiple MCP servers to seamlessly access local and remote data sources.
Role-Playing Agents:
OWL leverages roleplay agents that deconstruct tasks and work collaboratively, ensuring robust automation.
Real-Time Decision-Making:
Using methods such as POMDP (Partially Observable Markov Decision Processes), OWL optimizes decisions dynamically.
Multi-Modal Tool Integration:
From web data scraping to code execution and document processing, OWL integrates various toolkits to empower agent collaboration.
Below is a simplified version of how to initialize and connect to the MCP toolkit:
from pathlib import Path
from mcp_toolkit import MCPToolkit
# Load configuration and initialize MCP toolkit
config_path = Path(__file__).parent / "mcp_servers_config.json"
mcp_toolkit = MCPToolkit(config_path=str(config_path))
# Establish asynchronous connection
await mcp_toolkit.connect()
Then, construct the agent environment and run the task:
question = (
"I'd like an academic report about Andrew Ng, including his research direction, "
"published papers, and affiliated institutions. Organize the report in Markdown format and save it to my desktop."
)
tools = list(mcp_toolkit.get_tools())
society = await construct_society(question, tools)
answer, chat_history, token_count = await run_society(society)
print(f"Answer: {answer}")
For a complete guide on using MCP with the OWL framework, please refer to the detailed guide.
Capabilities:
Architecture:
Installation & Running:
QR Code Not Displaying:
Ensure your terminal supports displaying QR codes, or try restarting the authentication script.
Device Limit Issues:
If you reach the maximum number of devices on WhatsApp, remove an existing device from your phone’s linked devices settings.
Running on Windows:
For Windows setups, ensure that CGO is enabled and a C compiler (e.g., through MSYS2) is installed. See the Windows Compatibility Guide for step-by-step instructions.