# MessageFlow MCP

> MessageFlow MCP Server handles cross-channel communication—SMS, WhatsApp, and Email—through a unified API layer. It lets your AI client manage all outgoing messages, track delivery status in real time, check account balances, and use saved templates without jumping between vendor dashboards. Control every message flow from one place.

## Overview
- **Category:** communication-messaging
- **Price:** Free
- **Tags:** omnichannel-communication, delivery-tracking, message-templates, email-marketing, whatsapp-marketing

## Description

MessageFlow lets you run every message—SMS, WhatsApp, and email—through a single API layer. Your AI client uses this server to handle outgoing communications, track delivery status in real time, check your account balance, and use saved templates without needing to switch between vendor dashboards. You control the whole flow from one spot.

**Sending Messages Across Channels**
When you need to send a message, you don't care if it’s going out via email, SMS, or WhatsApp; you just tell your agent what needs sending. To dispatch a full-featured text message through the standard SMS gateway, use **`send_sms`**. If you need something basic and quick, **`send_generic_message`** handles that across any available channel type. For emails, **`send_email`** takes care of composing and sending complete messages to specific recipients. When you're talking WhatsApp, the structured format is handled by **`send_whatsapp`**. These functions let your agent treat all messaging—text, email, or chat—as one unified action.

**Managing Templates and Content Consistency**
You don't want your AI client generating copy on the fly for every campaign. MessageFlow keeps things clean with templates. You can first check what pre-approved messages are available by running **`list_templates`**. If you need to know exactly what a specific template contains, **`get_template`** fetches all the detailed content and metadata for that saved message. Similarly, if you're trying to figure out which channels your agent should even use in the first place, **`list_channels`** gives you a full rundown of every supported communication channel along with its specific setup details.

**Tracking and Monitoring Messages**
Once a message goes out, you need receipts. If you want to confirm if a particular message ID was successfully sent, delivered, or failed, **`get_delivery_status`** pulls the real-time status for that unique transaction. You can also review everything your agent has ever sent by calling **`list_messages`**, which retrieves a complete list of all previous messages dispatched through the platform. This lets you keep a perfect record.

**Account Management and Limits**
Before sending out anything, especially bulk comms, you gotta know if you've got funds. Use **`get_account_balance`** to check your current MessageFlow account balance and see what your usage limits are. This keeps you from hitting a paywall halfway through a major send.

This setup allows your agent to first confirm the available channels using **`list_channels`**, then check the balance with **`get_account_balance`**. It can list existing templates via **`list_templates`** and fetch the details for any specific one needing review using **`get_template`**. When ready, it sends messages using tailored functions like **`send_sms`**, **`send_whatsapp`**, or **`send_email`**. After sending, it tracks the outcome immediately with **`get_delivery_status`** and keeps a history by pulling reports via **`list_messages`**.

## Tools

### get_account_balance
Checks your MessageFlow account balance and current usage limits.

### get_delivery_status
Retrieves the real-time delivery status for a specific message ID.

### get_template
Fetches the detailed content and metadata for a specific saved message template.

### list_channels
Lists all communication channels that MessageFlow supports, along with their configurations.

### list_messages
Retrieves a list of all messages you have previously sent through the platform.

### list_templates
Lists all available message templates stored in your account.

### send_email
Sends a complete email message to a specified recipient address.

### send_generic_message
Sends a basic text message through any available communication channel.

### send_sms
Dispatches a standard SMS text message to a phone number via SMS gateway.

### send_whatsapp
Sends a structured message specifically through the WhatsApp channel.

## Prompt Examples

**Prompt:** 
```
Send a WhatsApp message to '+1234567890' saying 'Your order is on the way!'
```

**Response:** 
```
Dispatching WhatsApp message... Sent! The Message ID is 'mf-98765'. I'll monitor the status for you.
```

**Prompt:** 
```
Check the delivery status for message ID 'mf-12345'.
```

**Response:** 
```
Checking status... Message 'mf-12345' was successfully delivered to the recipient at 10:30 AM.
```

**Prompt:** 
```
What is my current MessageFlow account balance?
```

**Response:** 
```
Retrieving balance... You have $150.00 available in your account.
```

## Capabilities

### Send Messages Across Channels
Dispatch text, email, or WhatsApp messages using a single function call regardless of the final communication method.

### Track Message Delivery Status
Check if a message was sent, delivered, failed, or read by retrieving its unique status ID.

### Manage Account Limits
Confirm your current balance and API usage limits to prevent sending messages when funds run out.

### Use Message Templates
List available, pre-approved message templates so the AI agent can use consistent messaging for campaigns.

### Discover Communication Channels
Retrieve a list of all supported communication channels and their current configurations.

## Use Cases

### The Failed Follow-Up
A customer support agent sends an initial query via SMS using `send_sms`. A day later, the follow-up message fails to send. The agent asks their AI client: 'Check what happened with the last message.' The agent uses `list_messages` and then `get_delivery_status`, confirming failure. It then automatically drafts a new email through `send_email` explaining the issue, solving the problem without manual intervention.

### The Campaign Deployment
A marketing manager needs to run an anniversary campaign. They first check their budget using `get_account_balance`. Next, they ask for available copy and use `list_templates` to select the correct message. The agent then uses a combination of `send_whatsapp` and `send_email` to dispatch the personalized messages across both channels simultaneously.

### The Incident Response
A critical service alert needs immediate notification. Instead of manually calling three different APIs, the agent determines the necessary contacts using `list_channels`. It then calls `send_generic_message` for SMS and `send_email` simultaneously to guarantee maximum reach. The process is contained in one clean workflow.

### The Data Audit
Compliance requires a log of all communications sent last quarter. The user directs their agent: 'Give me every message ID and its final status.' The agent calls `list_messages` and then iterates through the IDs, using `get_delivery_status` for each one to build a comprehensive compliance report.

## Benefits

- **Omnichannel Reliability:** Instead of writing separate code for WhatsApp, SMS, and email, the agent uses distinct tools like `send_whatsapp`, `send_sms`, and `send_email`. This lets you deploy a single communication flow that automatically routes based on need. It's cleaner than managing three different vendor SDK calls.
- **Proactive Error Handling:** You don't wait for manual reports to see if a message succeeded. Running `get_delivery_status` immediately after dispatching any message gives your agent instant feedback, allowing it to automatically trigger retries or alerts if the delivery fails.
- **Cost Control Built-In:** Before sending out a high volume of messages—like in a batch campaign—the agent runs `get_account_balance`. This prevents costly failures and ensures your workflow stops gracefully when credits are low. You don't want to run out of money halfway through a promotion.
- **Consistent Messaging:** Templates keep your brand voice consistent everywhere. Using `list_templates` lets the AI agent pull standardized content, so whether it’s an email or an SMS, the core message structure never changes. This saves time and keeps things professional.
- **Full Audit Trail:** The `list_messages` tool provides a complete history of every message sent. You can quickly audit communications for compliance checks or simply review what was said and when.

## How It Works

The bottom line is, you tell your agent what needs sending or checking, and it handles the complex API calls to MessageFlow for you.

1. Subscribe to the MessageFlow server. This grants your agent access to the API tools.
2. Provide your unique MessageFlow API Key to your AI client configuration.
3. Your AI client calls a specific tool (e.g., `send_whatsapp`) which runs the operation through MessageFlow.

## Frequently Asked Questions

**How do I check if my MessageFlow account has enough credits?**
Run the `get_account_balance` tool. This returns your current credit balance and usage limits, letting you verify funds before any large send operation.

**Can I use different channels in one conversation? (MessageFlow MCP Server)**
Yes. The agent can orchestrate the flow by calling multiple tools, like first using `send_whatsapp` and then following up with an email via `send_email`.

**How do I track a specific message that was sent?**
Use the `get_delivery_status` tool. You need the unique Message ID, which you first get from running `list_messages`, to check its current status.

**What is better: sending a generic message or using templates? (MessageFlow MCP Server)**
You should use `list_templates` and then reference the template ID. Templates ensure consistent, approved copy every time, which is much safer than letting the agent generate raw text.

**When using the `list_messages` tool, what API key credentials are required for the MessageFlow MCP Server?**
You need a valid MessageFlow API Key. Your AI client uses this single credential to authenticate all operations, including listing messages and checking balances. Make sure your subscription is active before attempting any reads.

**If I use the `send_whatsapp` tool, how does the MessageFlow MCP Server handle common delivery failure codes?**
The server returns specific error codes for failures; you'll get a code and an associated description. Common errors include 'Recipient Blocked' or 'Invalid Number Format.' Your agent can read these codes to decide if it needs to retry.

**When calling `get_template`, can the MessageFlow MCP Server handle dynamic variable substitution?**
Yes, templates support dynamic variables. You simply map the required data fields (like name or order ID) into the template payload when invoking the tool. The server handles the merging and formatting for you.

**Does the MessageFlow MCP Server enforce any rate limits when I use `send_email`?**
The platform enforces sending limits based on your account tier. If you hit a rate limit, the tool will fail with an explicit 'Rate Limit Exceeded' error code. You must implement backoff logic in your agent to respect this limit.

**How do I find my MessageFlow API Key?**
Log in to MessageFlow, go to the Dashboard, and look for API Settings or Integration to generate your key.

**Can I send messages to multiple channels?**
Yes, MessageFlow supports SMS, WhatsApp, and Email. Use the specific tool for each channel or the generic message tool.

**Is my communication data secure?**
Absolutely. Your token is encrypted at rest and injected securely at runtime.