Integrations
Enables messaging (send text messages) and group management (create groups, list members, add/remove participants) through the WhatsApp Business API via GreenAPI
WhatsApp MCP Server
A server that provides a Model Context Protocol (MCP) interface to interact with WhatsApp Business API using FastMCP.
Introduction
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.
Features
- 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
WhatsApp API Client
This project uses the whatsapp-api-client-python
library to interact with WhatsApp. The client provides access to the WhatsApp Cloud API, which requires a GreenAPI account to use.
Environment Variables
This project uses environment variables for configuration:
GREENAPI_ID_INSTANCE
: Your GreenAPI ID instanceGREENAPI_API_TOKEN
: Your GreenAPI API token
You can either set these in your environment or use the provided .env
file (see Installation instructions).
Installation
Usage
Run the MCP server:
For debugging:
The server communicates using the Model Context Protocol (MCP) and can be accessed via HTTP or WebSockets when running with FastMCP.
Available Tools
open_session
: Open a new WhatsApp sessionsend_message
: Send a message to a chatget_chats
: Get a list of chatscreate_group
: Create a new WhatsApp groupget_group_participants
: Get the participants of a group
FastMCP API Reference
The WhatsApp MCP Server uses FastMCP to provide both WebSocket and HTTP endpoints:
- WebSocket:
ws://localhost:8000/mcp
- HTTP:
http://localhost:8000/mcp
You can test the API directly using tools like curl:
How to add it to Claude Code
To add a WhatsApp server to Claude, use the claude mcp add
command:
Using with Claude
Once the WhatsApp MCP server is running, you can interact with it using Claude in your conversations:
Authenticating with WhatsApp
Sending a message
Using with Claude Desktop
To use the WhatsApp MCP server with Claude Desktop, you need to add it to your claude_desktop_config.json
file:
Using pip installation (recommended)
Using the executable
Using Docker
Remember to set your GreenAPI credentials either as environment variables or in your .env
file before starting Claude Desktop.
Command-line options
The WhatsApp MCP server accepts these command-line arguments:
--debug
: Increase verbosity level for debugging--host
: Host to bind the server to (default: 127.0.0.1)--port
: Port to bind the server to (default: 8000)
Debugging
For debugging the MCP server:
- Use MCP inspector:
npx @modelcontextprotocol/inspector whatsapp-mcp
- View logs in your Claude Desktop logs directory (typically
~/Library/Logs/Claude/
on macOS) - Access the FastMCP web interface at http://localhost:8000 for interactive API documentation
Development
The project uses a modern pyproject.toml
configuration which includes:
- Core dependencies needed for running the application
- Development dependencies available with
pip install -e ".[dev]"
License
This project is licensed under the MIT License - see the LICENSE file for details.
You must be authenticated.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A Python server that enables language models like Claude to interact with WhatsApp Business API through GreenAPI, supporting features like sending messages and managing groups.
Related MCP Servers
- -securityAlicense-qualityA bridge that connects WhatsApp Web to AI models using the Model Context Protocol, enabling Claude and other AI systems to interact with WhatsApp through a standardized interface.Last updated -194TypeScriptMIT License
- -securityAlicense-qualityA Model Context Protocol server that enables Claude to interact with WhatsApp through the Evolution API, allowing for message sending, contact management, group operations, and WhatsApp instance administration.Last updated -1410TypeScriptMIT License
- -securityAlicense-qualityA Node.js application that connects WhatsApp Web with AI models through the Model Context Protocol, enabling automated messaging, contact management, and group chat functionality through AI-driven workflows.Last updated -1918TypeScriptMIT License
- AsecurityFlicenseAqualityA Node.js application that enables programmatic interaction with WhatsApp desktop on macOS, allowing users to send messages and check WhatsApp status through AppleScript automation without direct UI interaction.Last updated -32TypeScript