Navigation
WhatsApp MCP Server: Enterprise Automation & Scalability - MCP Implementation

WhatsApp MCP Server: Enterprise Automation & Scalability

WhatsApp MCP Server: Scalable, enterprise-grade automation for seamless WhatsApp messaging, ensuring reliable, real-time communication at any scale.

Developer Tools
4.3(100 reviews)
150 saves
70 comments

Ranked in the top 2% of all AI tools in its category

About WhatsApp MCP Server

What is WhatsApp MCP Server: Enterprise Automation & Scalability?

The WhatsApp MCP Server is a robust solution for integrating enterprise-grade WhatsApp automation into business workflows. Built on the Model Context Protocol (MCP), it enables standardized communication with WhatsApp via GreenAPI, offering scalable session management and protocol compliance. Designed for developers, it simplifies complex tasks like message handling, group management, and file transfers through a unified interface while supporting TypeScript for modern development practices.

How to use WhatsApp MCP Server: Enterprise Automation & Scalability?

Start by setting up the server environment: clone the repository, install dependencies, and configure GreenAPI credentials. Launch the server, then utilize predefined tools like open_session to establish connections or send_message for automated messaging. Each operation requires a valid sessionId retrieved from an active session. For instance, to send a file, provide the session ID, recipient chat ID, and file URL using the send_file method.

WhatsApp MCP Server Features

Key Features of WhatsApp MCP Server: Enterprise Automation & Scalability?

  • Session Orchestration: Maintain multiple WhatsApp sessions across devices through GreenAPI integration
  • Protocol Compliance: Fully implements MCP standards for reliable bidirectional communication
  • Enterprise-Ready Tools: Built-in functions for group management, chat history retrieval, and media handling
  • Development Flexibility: TypeScript foundation simplifies large-scale code maintenance and collaboration

Use cases of WhatsApp MCP Server: Enterprise Automation & Scalability?

Automate customer support via GreenAPI integrated chatbots, manage bulk group memberships for marketing campaigns, or create dynamic report distribution systems using file transfer capabilities. For example, an e-commerce platform could use get_chat_history

WhatsApp MCP Server FAQ

FAQ from WhatsApp MCP Server: Enterprise Automation & Scalability?

What Node.js versions are supported?

Requires Node.js v14 or higher for ES6+ compatibility and improved security features.

How do I secure my credentials?

Store GREENAPI_API_TOKEN and other sensitive data in environment variables rather than source code for production deployments.

Why aren't incoming messages appearing?

Ensure the Receive webhooks setting is enabled via SetSettings method to capture inbound messages in chat history.

Content

WhatsApp MCP Server

A WhatsApp server implementation using the Model Context Protocol (MCP) SDK. This server provides a standardized interface for interacting with WhatsApp through the GreenAPI service.

Features

  • WhatsApp session management
  • Integration with GreenAPI service
  • Standardized MCP protocol implementation
  • TypeScript support

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn
  • GreenAPI account and credentials

Installation

  1. Clone the repository:
git clone <repository-url>
cd whatsapp-mcp-server
  1. Install dependencies:
npm install

Configuration

The server requires the following environment variables:

  • GREENAPI_API_URL: The base URL for GreenAPI service
  • GREENAPI_API_TOKEN: Your GreenAPI API token

Usage

  1. Start the server:
npm start
  1. The server will start listening for MCP protocol messages through standard input/output.

Available Tools

Open Session

Opens a new WhatsApp session using GreenAPI credentials.

Parameters:

  • sessionId: A unique session ID
  • instanceId: GreenAPI instance ID
  • apiTokenInstance: GreenAPI API token

Send Message

Sends a message to a specified chat.

Parameters:

Get Chats

Retrieves the list of available chats.

Parameters:

  • sessionId: Session ID from open_session

Create Group

Creates a new WhatsApp group.

Parameters:

  • sessionId: Session ID from open_session
  • groupName: Name of the group to create
  • participants: Array of phone numbers with domain (e.g. [email protected])

Get Chat History

Retrieves recent messages from a specified chat (personal or group).

Parameters:

  • sessionId: Session ID from open_session
  • chatId: Chat ID to retrieve messages from (e.g., [email protected] or [email protected])
  • count: Number of messages to retrieve (default: 50)

Important : To receive incoming messages in the chat history, you need to enable the "Receive webhooks on incoming messages and files" setting using the SetSettings method or through the GreenAPI console. Without this setting enabled, the chat history will only show outgoing messages.

Send File

Sends a file to a specified chat.

Parameters:

  • sessionId: Session ID from open_session
  • chatId: WhatsApp chat ID (e.g., [email protected])
  • fileUrl: Public URL of the file to send
  • fileName: (Optional) Name of the file as seen by recipient
  • caption: (Optional) Caption text to display below the file

Add Participant

Adds a participant to an existing WhatsApp group.

Parameters:

  • sessionId: Session ID from open_session
  • groupId: ID of the WhatsApp group (e.g., [email protected])
  • participantChatId: Chat ID of the participant to add (e.g., [email protected])

Remove Participant

Removes a participant from an existing WhatsApp group.

Parameters:

  • sessionId: Session ID from open_session
  • groupId: ID of the WhatsApp group (e.g., [email protected])
  • participantChatId: Chat ID of the participant to remove (e.g., [email protected])

Related MCP Servers & Clients