WhatsApp MCP Server logo

WhatsApp MCP Server

by msaelices

WhatsApp MCP Server is a Python implementation that enables language models like Claude to interact with WhatsApp functionality through GreenAPI. It leverages FastMCP for improved performance, better developer experience, and a cleaner implementation.

View on GitHub

Last updated: N/A

What is WhatsApp MCP Server?

The WhatsApp MCP Server is a Python-based server that provides a Model Context Protocol (MCP) interface for language models like Claude to interact with the WhatsApp Business API via GreenAPI. It uses FastMCP for efficient communication.

How to use WhatsApp MCP Server?

First, clone the repository and install the dependencies. Then, set the required GreenAPI credentials as environment variables. Run the server using the whatsapp-mcp command, specifying host and port if needed. Interact with the server using HTTP or WebSockets through the FastMCP API.

Key features of WhatsApp MCP Server

  • Messaging: Send text messages to WhatsApp contacts

  • Group Management: Create groups, list members, add/remove participants

  • Session Handling: Manage WhatsApp API sessions

  • Chat History: Retrieve chat lists and message history

Use cases of WhatsApp MCP Server

  • Integrating WhatsApp functionality into language model applications

  • Automating WhatsApp communication through code

  • Building conversational AI agents that interact with WhatsApp

  • Enabling Claude to send and receive WhatsApp messages

FAQ from WhatsApp MCP Server

What is GreenAPI?

GreenAPI is a service that provides access to the WhatsApp Cloud API.

What is FastMCP?

FastMCP is used for improved performance, better developer experience, and a cleaner implementation of the Model Context Protocol.

How do I set up the environment variables?

You can set the GREENAPI_ID_INSTANCE and GREENAPI_API_TOKEN environment variables directly in your environment or by editing the .env file.

How do I run the server?

Use the command whatsapp-mcp to run the server. You can specify the host and port using the --host and --port flags.

How do I add the server to Claude?

Use the claude mcp add whatsapp -- whatsapp-mcp command to add the server to Claude.