# Submail MCP

> Submail / 赛邮云 is an MCP Server that lets your AI agent manage multi-channel communications—SMS, email, and voice calls—from a single conversation window. It handles everything from checking credit balances (`get_sms_balance`) to sending template messages or initiating automated voice verification codes. Stop switching between consoles; let your agent coordinate all transactional messaging in one place.

## Overview
- **Category:** communication-messaging
- **Price:** Free
- **Tags:** sms-gateway, email-marketing, voice-notifications, transactional-messaging, multi-channel-comms, api-orchestration

## Description

This MCP Server lets your agent handle all your communication—SMS, email, and voice calls—from one chat window. You don't gotta jump between different dashboards; your AI client manages everything transactional right where you are.

Before sending anything, you can check your spending limits. To see how much email credit you got left, run `get_mail_balance`. You wanna know what quota you got for text messages? Use `get_sms_balance`. If you're doing voice calls, checking the remaining credits is simple with `get_voice_balance`.

For sending standard messages, your agent handles it across channels. To send a normal HTML email to someone, call `send_mail`. For basic text alerts, just use `send_sms`. If you need to initiate a regular automated voice notification call, run `send_voice`.

When you're running campaigns or need consistency, the agent handles specialized sending. To execute an SMS using a predefined template and custom variables—like for bulk messaging—you use `send_template_sms`. For critical security steps, triggering a one-time verification code is simple; call `send_voice_verify` to make that automated phone call.

The whole point is orchestration. Your agent doesn't just send stuff out; it coordinates the entire process. You tell your AI client what needs doing—like checking credits and then sending an alert email, or running a template SMS followed by a verification voice call—and it executes all those steps in sequence, reporting back everything you need to know without you ever leaving the chat.

## Tools

### get_mail_balance
Checks your current available balance for email credits.

### get_sms_balance
Checks your remaining quota for SMS messages.

### get_voice_balance
Retrieves the current credit balance for voice notifications and calls.

### send_mail
Sends a standard HTML email message to a recipient.

### send_sms
Sends a standard text SMS message directly to a phone number.

### send_template_sms
Sends an SMS using a predefined template (XSend) and custom variables.

### send_voice
Initiates a standard voice notification call to the user's number.

### send_voice_verify
Triggers an automated phone call specifically designed to deliver a verification code.

## Prompt Examples

**Prompt:** 
```
Send a standard SMS to '13800138000' with content 'Your package has arrived'.
```

**Response:** 
```
I've successfully sent the SMS to `13800138000`. The Submail send ID is `88210934`. Would you like me to check your remaining SMS balance?
```

**Prompt:** 
```
Check my current account balance for Mail and Voice credits.
```

**Response:** 
```
I've retrieved your balances. You have 15,240 Mail credits and 850 Voice credits remaining. Should I also check your SMS balance to ensure all channels are topped up?
```

**Prompt:** 
```
Send a voice verification code '1234' to '13800138000'.
```

**Response:** 
```
I've initiated the voice verification call to `13800138000`. The code '1234' will be read to the user. Would you like me to monitor the call status for you?
```

## Capabilities

### Manage Multi-Channel Messaging
The agent sends transactional messages across SMS, Email, and Voice channels using a single command.

### Audit Communication Credits
You check the remaining quotas for email, SMS, or voice calls before initiating any send operation (e.g., calling `get_mail_balance`).

### Send Template-Driven Messages
The agent executes pre-formatted SMS campaigns using specific variables (`send_template_sms`) for consistency.

### Automate User Verification Calls
You initiate a voice call to deliver a one-time verification code, which the agent can also monitor.

## Use Cases

### New User Signup Verification
A user signs up on your platform. Instead of you logging in, prompting the code, and calling a separate voice service, you just ask: 'Verify John Doe.' Your agent runs `send_voice_verify` with the required code, immediately initiating the call and letting you monitor its status.

### Bulk Order Status Alert
An order ships. You need to notify ten users. You prompt your agent: 'Send an email notification for order #1234' (using `send_mail`) and then, if the email fails, use `send_sms` as a fallback alert. The agent handles the multi-step failover logic.

### System Health Check
The DevOps team needs to know if they have enough credits for the next week's alerts. They ask: 'What are our current spending limits?' Your agent calls `get_sms_balance` and `get_mail_balance`, giving an instant, combined report.

### Scheduled Campaign Deployment
Marketing needs to send 50 automated reminders. You use the specialized tool, `send_template_sms`, specifying the XSend project ID and the variable list. This ensures mass sending is done reliably using existing campaign structures.

## Benefits

- **Single Source of Truth:** You don't need to switch between billing dashboards. Your agent can run `get_sms_balance`, `get_mail_balance`, and `get_voice_balance` sequentially just by asking for an audit, keeping everything in the chat history.
- **Template Consistency:** Stop writing message content from scratch. Use `send_template_sms` to send alerts using defined project templates (XSend) with variable fields, ensuring every user gets the exact right format.
- **Automated Verification Flows:** When a user needs to prove their identity, trigger an instant call using `send_voice_verify`. This is much faster than manually checking and initiating calls through a web console.
- **True Multi-Channel Action:** Need to confirm an order? Your agent can send the confirmation email (`send_mail`) *and* follow up with an SMS alert (`send_sms`), all from one prompt, without you writing complex multi-step code.
- **Error Reduction:** By letting your AI client handle the sequence—like checking `get_sms_balance` before calling `send_sms`—you prevent failed sends due to expired credits and save time debugging API errors.

## How It Works

The bottom line is: you talk to your AI agent, and it handles all API calls and reporting for Submail automatically.

1. Subscribe to this server and provide your Submail AppID and AppKey.
2. Connect it to your preferred client (Claude, Cursor, etc.).
3. Tell your agent the task: e.g., 'Send an alert email and check my SMS balance.' The agent executes the relevant tools.

## Frequently Asked Questions

**How do I check my email quota using the get_mail_balance tool?**
You simply ask your agent to run `get_mail_balance`. It immediately queries Submail and returns your current available credit count. This is useful before running any large-scale campaigns with `send_mail`.

**Can I use send_template_sms for a simple alert?**
Yes, you should. While `send_sms` works, using `send_template_sms` is better because it lets you reuse pre-approved XSend templates and variables. This keeps your messaging consistent across all campaigns.

**What's the difference between send_voice and send_voice_verify?**
`send_voice` sends a general notification call. `send_voice_verify`, however, is specifically designed for security purposes; it initiates a call meant solely to deliver a one-time verification code.

**Do I need to check my balance before using send_sms?**
It's best practice. Always run `get_sms_balance` first. This prevents the agent from failing mid-task and tells you exactly which channel needs topping up.

**How does the system handle authentication when I use the send_mail tool?**
The agent uses your initial AppID and AppKey to authorize every API call. These credentials are stored securely and prevent you from having to manually input them each time, ensuring only authorized messages get sent.

**If I run the send_sms tool and receive an error code, how do I troubleshoot it?**
The response payload includes specific error codes and failure reasons. Your agent reads these details so you know if the issue is invalid credentials or a recipient block.

**Can I inject custom data into my message using the send_template_sms tool?**
Yes, you define placeholders within your project template structure. When running the tool, you simply pass key-value pairs that populate those variables instantly, making it highly dynamic.

**Beyond checking credit with get_voice_balance, what can I monitor about my voice communication service?**
You can verify API connectivity and AppID configurations. This confirms the entire voice pipeline is active and healthy, not just that credits remain available.

**How do I find my Submail AppID and AppKey?**
Log in to the [Submail Management Console](https://www.mysubmail.com/), navigate to the relevant project type (SMS, Mail, or Voice) and look for the 'AppID' and 'AppKey' in the project settings or credentials section.

**Does this server handle MD5 signatures?**
Yes! The server automatically calculates the required MD5 signature for every request using your provided AppKey, ensuring secure authorized communication with Submail APIs.

**Can I send template-based SMS?**
Yes! Use the `send_template_sms` tool. You will need the Project ID of your template and a JSON string containing the variables defined in that template.