Sponsored by Deepsite.site

WhatsApp Agent

Created By
aasherkamal2168 months ago
A WhatsApp agent that uses WhatsApp MCP server to send messages and perform other actions.
Content

WhatsApp Agent

An Agent that interacts with WhatsApp using WhatsApp MCP server. It can perform multiple actions on the user's behalf.

WhatsApp Agent

🚀 Features

The Agent is connected to WhatsApp MCP server. This 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

⚡Quick Start

Prerequisites

  • Python 3.10+
  • WhatsApp MCP server
  • An OpenAI API key (or compatible service like DeepSeek)
  • uv

NOTE

To setup WhatsApp MCP server, follow the instructions in the README.

Installation

Follow these steps to set up the project on your local machine:

  1. Clone the repository

    git clone https://github.com/aasherkamal216/whatsapp_agent.git
    cd whatsapp_agent
    
  2. Create and activate a virtual environment

    uv venv
    # On macOS/Linux
    source .venv/bin/activate
    # On Windows
    .venv\Scripts\activate
    
  3. Install dependencies

    uv sync
    
  4. Set up environment variables

    Copy the example environment file and update it with your credentials:

    cp .env.example .env
    

    Add your environment variables to the .env file.

Usage

Run the Chainlit app:

uv run chainlit run chainlit_app.py -w

The application will be running at http://localhost:8000

Example Questions

Here are some example questions you can ask the WhatsApp Agent:

  • Show me my recent chats.
  • Send a message to John Doe: "Meeting at 5pm."
  • List all messages from John in the last week.
  • Download the last photo sent in the SF News group.
  • Search for contacts named Alex.
  • Get the last interaction with +1234567890.
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
WindsurfThe new purpose-built IDE to harness magic
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright McpPlaywright MCP server
Serper MCP ServerA Serper MCP Server
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
ChatWiseThe second fastest AI chatbot™
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
DeepChatYour AI Partner on Desktop
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Tavily Mcp
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
CursorThe AI Code Editor
Amap Maps高德地图官方 MCP Server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"