Whatbot
An open-source, self-hosted WhatsApp API Gateway — forked from OpenWA with MCP server integration for AI agents, a protocol-neutral tool registry, and hardened Docker security.
Live demoThe problem
Most WhatsApp API gateways are either hosted SaaS platforms with vendor lock-in and hidden fees, or open-source projects that lack production-ready features like AI agent integration, proper security hardening, and pluggable infrastructure. Developers need full control over their messaging infrastructure without compromising on features or security.
Whatbot solves this by forking OpenWA and extending it with MCP server integration for AI agents, a protocol-neutral tool registry, sandboxed plugin system, and Docker security hardening — while preserving the pluggable architecture that makes swapping databases, storage, and cache layers possible without code changes.
Dashboard & Session Management
The bundled React dashboard provides a modern interface for managing sessions, webhooks, API keys, and real-time chat — all served from the same NestJS process on a single port in production.
Engine Abstraction
The engine abstraction layer supports both whatsapp-web.js and Baileys via the ENGINE_TYPE environment variable. Both adapters implement the same interface with engine-neutral JID dialects, so application code never sees engine-specific types.
export interface IWhatsAppEngine {
connect(sessionId: string): Promise<void>;
disconnect(sessionId: string): Promise<void>;
sendMessage(to: string, content: MessageContent): Promise<MessageReceipt>;
getMessages(sessionId: string, limit?: number): Promise<Message[]>;
on(event: EngineEvent, handler: EngineEventHandler): void;
}Key Features
Whatbot extends OpenWA with production-grade capabilities for AI agent integration, security, and extensibility.
MCP Configuration
The MCP server exposes tools over Streamable-HTTP with automatic tool discovery. Agents connect to a single endpoint and negotiate capabilities at runtime.
{
"mcp": {
"transport": "streamable-http",
"port": 3001,
"tools": {
"messages": { "enabled": true },
"sessions": { "enabled": true },
"groups": { "enabled": true },
"webhooks": { "enabled": true }
}
}
}Fork Origin & Comparison
Whatbot is built on top of OpenWA v0.7.7 (rmyndharis/OpenWA, 10.7k stars). The following features are NEW additions not present in the upstream OpenWA:
Architecture
Built with NestJS 11.x and TypeScript 5.x. The engine abstraction layer supports both whatsapp-web.js and Baileys via the ENGINE_TYPE environment variable. Both adapters implement the same IWhatsAppEngine interface with engine-neutral JID dialects, so application code never sees engine-specific types.
Project outcomes
Whatbot provides a production-ready, self-hosted alternative to Twilio and WhatsApp Cloud API with real production features: pluggable infrastructure, AI agent integration via MCP, Docker security hardening, and a comprehensive REST API. The source code and live demo are available on GitHub.

