Skip to content

naicud/Baileys-wa-mcp

 
 

Repository files navigation

WhatsApp MCP Server

License: MIT

A Model Context Protocol (MCP) server that enables LLM applications to interact with WhatsApp through the Baileys library.

Features

  • 📱 WhatsApp Integration - Send and receive WhatsApp messages through MCP
  • 🔐 Session Management - QR code and pairing code authentication
  • 💬 Message Tools - Send text, media, and interactive messages
  • 👥 Group Management - Create groups, manage participants
  • 📞 Contact Operations - Check contacts, get profile info
  • 🗄️ Database Support - Optional Prisma integration for persistent sessions

Quick Start

Prerequisites

  • Node.js >= 20.0.0
  • npm or yarn

Installation

cd mcp-server
npm install

Configuration

Copy the environment template:

cp .env.template .env

Edit .env with your settings. See Environment Variables for details.

Running

STDIO Mode (for MCP clients like Claude Desktop):

npm run build
npm start

HTTP Mode (for web applications):

npm run build
npm run start:http

Development Mode:

npm run dev       # STDIO with hot reload
npm run dev:http  # HTTP with hot reload

Documentation

Document Description
Getting Started Setup guide and first steps
Architecture System design and components
MCP Tools Reference Complete API documentation
Environment Variables Configuration options
Webhooks Event notifications setup
Deployment Production deployment guide

MCP Client Configuration

Claude Desktop

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "whatsapp": {
      "command": "node",
      "args": ["/path/to/mcp-server/lib/index.js"]
    }
  }
}

Project Structure

├── mcp-server/          # MCP Server implementation
│   ├── src/             # TypeScript source code
│   ├── prisma/          # Database schema (optional)
│   └── lib/             # Compiled JavaScript
├── docs/                # Documentation
└── starting_point/      # Original Baileys library (reference)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Credits

Built on top of Baileys by WhiskeySockets.

Original Baileys library copyright © 2025 Rajeh Taher/WhiskeySockets.


Disclaimer: This project is not affiliated with WhatsApp. Use responsibly and in accordance with WhatsApp's Terms of Service.

About

Socket-based TS/JavaScript API for WhatsApp Web

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 97.0%
  • JavaScript 2.6%
  • Dockerfile 0.4%