AWS Logo
Menu

How to integrate LLM's with WhatsApp using MCP

Do you want to learn about MCP and you are a Whatsapp heavy user? This article is for you!

Vinicius Senger
Amazon Employee
Published May 8, 2025
Last Modified May 13, 2025
WhatsApp is a powerful messaging platform used globally—and in Brazil, where I’m from, it’s even more than just messaging. People use it to order food, receive medical exam results, join meetings, and manage tech communities. However, when you're receiving hundreds (or thousands) of messages a day—especially for business—keeping things organized can be a real challenge.
Today, I’ll show you how to build your own AI-powered assistant for WhatsApp using Claude, the Model Context Protocol (MCP), and Amazon Q CLI. With this setup, you can ask questions like:
  • “Summarize today’s conversation in group X”
  • “Which messages are related to medications?”
  • “Show all messages mentioning product Z”

What is Model Context Protocol

MCP is the new WebServices, but for AI, and according to Anthropic we can:
"Think of MCP like a USB-C port for AI applications. Just as USB-C provides a standardized way to connect your devices to various peripherals and accessories, MCP provides a standardized way to connect AI models to different data sources and tools."
You can find complete technical details about MCP here, but Today we want to be learning by doing so let's move to our three steps tutorial:
  1. Building the Whatsapp MCP Server using Amazon Q CLI
  2. Running Whatsapp MCP Server in your local computer
  3. Configuring and using Claude Desktop to interact with your Whatsapp messages through the MCP Server

WhatsApp MCP Server

I found this open-source Whatsapp MCP Server developed with Go and Python programming languages:
"With this you can search and read your personal Whatsapp messages (including images, videos, documents, and audio messages), search your contacts and send messages to either individuals or groups. You can also send media files including images, videos, documents, and audio messages.
It connects to your personal WhatsApp account directly via the Whatsapp web multidevice API (using the whatsmeow library). All your messages are stored locally in a SQLite database and only sent to an LLM (such as Claude) when the agent accesses them through tools (which you control)."
The WhatsApp MCP Server will be a kind of bridge connecting the LLM to your WhatApp account and can using Tools; this MCP Server provides the following tools:
  • search_contacts: Search for contacts by name or phone number
  • list_messages: Retrieve messages with optional filters and context
  • list_chats: List available chats with metadata
  • get_chat: Get information about a specific chat
  • get_direct_chat_by_contact: Find a direct chat with a specific contact
  • get_contact_chats: List all chats involving a specific contact
  • get_last_interaction: Get the most recent message with a contact
  • get_message_context: Retrieve context around a specific message
  • send_message: Send a WhatsApp message to a specified phone number or group JID
  • send_file: Send a file (image, video, raw audio, document) to a specified recipient
  • send_audio_message: Send an audio file as a WhatsApp voice message (requires the file to be an .ogg opus file or ffmpeg must be installed)
  • download_media: Download media from a WhatsApp message and get the local file path
But Go is a programming language that I had almost no experience, so instead of learning how to install Go and all other requirements I used Amazon Q CLI, an AI agentic and intentional command-line tool that knows everything about Linux / Unix / Programming Languages to help to build the process. If you are not familiar with Q CLI, you can learn about and how to setup in this article here.
1. Clone the Whatsapp MCP Server repository:
2. Open Q CLI and provide a prompt to build the project for you, type "q chat" and the "build this project"
As you will see, Amazon Q CLI is bringing a new paradigm to operate computer: instead of imperative commands, you can just type your intention. The agent will ask for your permission to read and write files in your computer, which will be necessary to install the software required, and if it found an error it will be try to fix it for you automatically to achieve your goal you prompted. Check this video of the CLI in action building the Whatsapp MCP Server:
If everything is fine, you should see a QR Code to log the Whatsapp MCP Server a device in your Whatsapp account, and once it's done, your Whatsapp MCP Server will be ready to be used with Claude Desktop, our MCP Client, but you can also you any other client of your choice.

Claude Desktop

Now it's time to (install if you don't have it) and configure Claude Desktop. Save this as claude_desktop_config.json in your Claude Desktop configuration directory at:
Enter the PATH to the command and source directory and add this configuration to your claude_desk_config.json:

Testing

Open your Claude Desktop and drop questions about your Whatsapp messages or even publish messages; in my case I asked to resume the conversation in my favorite whatsapp group (since Today is May 8th, it was all about Real ID requirement to travel in US :).
Now you learned about MCP, Amazon Q CLI and how to integrate with Claude Desktop (or any other MCP Client!) to your WhatsApp MCP Server. You can build powerful AI agents to automate your business or improve your productivity and hope you have fun learning more about this industry top trend.
Reach me on linked.in if you need any support and happy coding!
-Vini
 

Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.

2 Comments