Skip to main content

MCP server for WhatsApp functionality via Titanmind

Project description

Titanmind WhatsApp MCP

A WhatsApp marketing and messaging tool MCP (Model Control Protocol) service using Titanmind. Handles free-form messages (24hr window) and template workflows automatically

Overview

This service provides all the WhatsApp marketing and messaging functionalities using Titanmind. Includes features like template creation and registration with all components header, body, CTAs.., template broadcast to phone numbers in bulk. Read and send messages in an active conversation.

This MCP utilizes Titanmind. Titanmind Account is a requirement to use this MCP.

Titanmind enhances WhatsApp communication by providing powerful features such as conversation management, scheduling, agentic conversations, content generation etc.

Features

Conversation Management

Get Recent Conversations

  • Retrieve all conversations with messages sent or received in the last 24 hours
  • Returns conversation data with recent activity

Get Conversation Messages

  • Fetch all messages from a specific conversation
  • Requires: conversation_id (alphanumeric conversation identifier)

Send WhatsApp Message

  • Send a message to an existing WhatsApp conversation
  • Requires: conversation_id and message content

Template Management

Create Message Template

  • Register new WhatsApp message templates for approval
  • Configure template name (single word, underscores allowed only)
  • Set language (default: "en") and category (MARKETING, UTILITY, AUTHENTICATION)
  • Structure message components including:
    • BODY (required): Main text content
    • HEADER (optional): TEXT, VIDEO, IMAGE, or DOCUMENT format
    • FOOTER (optional): Footer text
    • BUTTONS (optional): QUICK_REPLY, URL, or PHONE_NUMBER actions

Get Templates

  • Retrieve all created templates with approval status
  • Optional filtering by template name

Send Bulk Messages

  • Send messages to multiple phone numbers using approved templates
  • Requires: template_id and list of contacts
  • Contact format: country code alpha (e.g., "IN"), country code (e.g., "91"), and phone number

Installation

Prerequisites

  • Python 3.10 or higher
  • API Key and Business Code from Titanmind

Usage with MCP Client

In any MCP Client like Claude or Cursor, Titanmind whatsapp MCP config can be added following ways:

Using Titanmind WhatsApp MCP Python package 

1. Install pipx to install the python package globally

# terminal

# Install pipx first
brew install pipx  # on macOS
# or
sudo apt install pipx  # on Ubuntu/Debian

# Then install Titanmind WhatsApp MCP Python package 
pipx install titanmind-whatsapp-mcp

# Make sure '/[HOME_DIR_OR_USER_PRFILE]/.local/bin' is on your PATH environment variable. Use pipx ensurepath to set it.
pipx ensurepath 
 

2. Set the MCP Config python package script in the MCP Client's MCP Configs Json file.

{
  "mcpServers": {
    "TitanMindMCP": {
      "command": "/[HOME_DIR_OR_USER_PRFILE]/.local/bin/titan-mind-mcp",
      "args": [
      ],
      "env": {
        "api-key": "XXXXXXXXXXXXXXXXXXXXXXXX",
        "bus-code": "XXXXXX"
      }
    }
  }
}

Use Remote Titanmind MCP server config

1. Make sure npx is installed in the system
2. Then just add the MCP config

{
  "mcpServers": {
    "TitanMindMCP": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mcp.titanmind.so/whatsapp/mcp/",
        "--header",
        "api-key:XXXXXXXXXXXXXXXXXXXXXXX",
        "--header",
        "bus-code:XXXXXX"
      ]
    }
  }
}

Use local python project config

1. First Setup project using instructions mentioned in the Setup Project section.
2. Then add the MCP config

{
  "mcpServers": {
    "TitanMindMCP": {
      "type": "stdio",
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/[PATH_TO_THE_PROJECT]",
        "python",
        "main.py"
      ],
      "env": {
        "api-key": "XXXXXXXXXXXXXXXXXXXX",
        "bus-code": "XXXXXX"
      }
    }
  }
}

Manual Installation for custom purpose or development

Install package from PyPI for package use

pip install titanmind-whatsapp-mcp

Or use uv:

uv pip install titanmind-whatsapp-mcp

Setup Project for development use

1. Clone the repository:

git clone https://github.com/TitanmindAGI/titanmind-whatsapp-mcp
cd titanmind-whatsapp-mcp

2. Install dependencies:

pip install -e .
# Or
uv pip install -e .

3. Set the auth keys

export api-key="your-titanmind-api-key"
export bus-code="your-titanmind-business-code"

How it Works

TitanMind's WhatsApp messaging system operates under two distinct messaging modes based on timing and conversation status:

Free-Form Messaging (24-Hour Window)

  • When Available: Only after a user has sent a message within the last 24 hours
  • Content Freedom: Any content is allowed without pre-approval
  • Use Case: Ongoing conversations and immediate responses

Template Messaging (Outside 24-Hour Window)

  • When Required: For new conversations or when the 24-hour window has expired
  • Content Structure: Pre-approved, structured message templates only
  • Use Case: Initial outreach and re-engagement campaigns

Messaging Workflow Process

  1. Check Messaging Window Status
    • Verify if receiver's phone number is within the free-form messaging window
    • A receiver is eligible for free-form messaging if:
      • A conversation with their phone number already exists AND
      • The receiver has sent a message within the last 24 hours
  2. Choose Messaging Method
    • Free-Form: Send directly if within 24-hour window
    • Template: Register and use approved template if outside window
  3. Template Approval Process (if needed)
    • Submit template for WhatsApp approval
    • Wait for approval confirmation
    • Template becomes available for bulk messaging
  4. Send Message
    • Execute message delivery using appropriate method
    • Monitor delivery status
  5. Verify Delivery
    • Check conversation to confirm receiver successfully received the message
    • Track message status and engagement

Usage Notes

  • All tools integrate with Titanmind's WhatsApp channel messaging functionality
  • Templates require approval before they can be used for bulk messaging
  • For more help contact us through https://www.titanmind.so/

License

MIT License - See LICENSE file

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file iflow_mcp_titanmindagi_titanmind_whatsapp_mcp-0.1.8.tar.gz.

File metadata

  • Download URL: iflow_mcp_titanmindagi_titanmind_whatsapp_mcp-0.1.8.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_titanmindagi_titanmind_whatsapp_mcp-0.1.8.tar.gz
Algorithm Hash digest
SHA256 a164c37ddbc4e5d076087c898ef9ee3d97dfacdc14abb2a18af760dbbbc45512
MD5 d669860eaf0bde3c76d749a5fb9b2912
BLAKE2b-256 2decf047041f13ee07b24c968ff02376b5d82d0a7f6ae65d97eacd19878150d6

See more details on using hashes here.

File details

Details for the file iflow_mcp_titanmindagi_titanmind_whatsapp_mcp-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_titanmindagi_titanmind_whatsapp_mcp-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_titanmindagi_titanmind_whatsapp_mcp-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 666453df95ec9f553336f13b699ef1e0593a97ecc1b0f76c067c746a5ebcb458
MD5 6ffb0a5362d285dfd7309876b7cdff88
BLAKE2b-256 4e407454aa8e00b482a41878cb46d20b8d44a06aa05499996c8980bf83cf8e73

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page