Skip to main content

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 demo
  • NestJS
  • TypeScript
  • Docker
  • AI Integration
  • System Design
Whatbot dashboard showing session management, webhooks, and real-time chat interface.

The 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.

Whatbot dashboard main view with session list and status indicators.
Whatbot session management with QR code and connection status.

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.

whatsapp-engine.interface.ts
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;
}
typescript

Key Features

Whatbot extends OpenWA with production-grade capabilities for AI agent integration, security, and extensibility.

MCP Server
~39 curated tools for AI agents via Streamable-HTTP
Agent Tool Registry
Protocol-neutral tools consumable by MCP, A2A, or any agent protocol
Sandboxed Plugins
Capability gates, manifest ingress, isolated storage
Docker Security
Socket proxy + non-root containers + gosu privilege drop

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.config.json
{
  "mcp": {
    "transport": "streamable-http",
    "port": 3001,
    "tools": {
      "messages": { "enabled": true },
      "sessions": { "enabled": true },
      "groups": { "enabled": true },
      "webhooks": { "enabled": true }
    }
  }
}
json

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:

Feature
OpenWA (Original)
Whatbot (Fork)
MCP Server
Not available
~39 curated tools for AI agents
Agent Tool Registry
Not available
Protocol-neutral (MCP, A2A)
Plugin System
Basic hooks
Sandboxed with capability gates
Docker Security
Direct socket access
Socket proxy + non-root containers
Queue System
Not available
BullMQ + Bull Board UI
HMAC Verification
Standard JSON verify
Raw body byte-identical verify
Engine Support
whatsapp-web.js / Baileys
whatsapp-web.js / Baileys
Database
SQLite / PostgreSQL
SQLite / PostgreSQL
Storage
Local / S3 / MinIO
Local / S3 / MinIO
REST API
Full API
Full API
Web Dashboard
React SPA
React SPA (bundled)

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.

NestJS API Layer (23 Modules)
SessionsMessagesWebhooksGroupsAuth
MCP ServerAgent ToolsPluginsQueue
Engine Abstraction (IWhatsAppEngine)
whatsapp-web.jsBaileys (browser-free)
Neutral JID Dialect<phone>@c.us / @lid / @g.us
Infrastructure (Pluggable)
SQLite / PostgreSQLLocal / S3 / MinIOMemory / RedisDocker

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.