mcpField
W
WhatsApp MCP Server

WhatsApp MCP Server

Local
github.com/piyushgupta53Communication7Updated 83w ago

About WhatsApp MCP Server

WhatsApp MCP Server is a TypeScript implementation for interacting with WhatsApp through GreenAPI. It provides session, messaging, chat, history, file, and group operations for applications and AI tools.

Key features

  1. 01Manage WhatsApp sessions
  2. 02Send messages and files
  3. 03List chats and retrieve history
  4. 04Create groups
  5. 05Add or remove group participants

Use cases

  1. 01Send a message to a WhatsApp chat
  2. 02Retrieve recent chat messages
  3. 03Share a file with a recipient
  4. 04Manage group membership

MCP support

The server implements MCP and exposes WhatsApp operations through GreenAPI to MCP clients, including session management, messaging, chat history, files, and group tools.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

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])

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.