# Msg91 — how to use (mcp.ai)

Connect your Msg91 account and use 8 tools for communication straight from your AI agent. Connect with your own API key. MSG91 is a cloud communication platform offering secure and robust APIs for SMS, WhatsApp, Email, Voice, and more, enabling businesses to connect with their customers across multiple channels.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_msg91?ms=1787293680000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `msg91_create_user_events`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/msg91`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/msg91/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/msg91/create/user/events` — Create and track user events in MSG91 Segmento for customer behavior analysis and segmentation. Use this tool to record user actions and behaviors such as logins, purchases, page views, button clicks,
  - body: { events: object[], identifier: string }
- `POST https://api.mcp.ai/api/msg91/get/event/types` — Retrieves all event types configured in MSG91 Segmento. Event types represent different user actions and behaviors that can be tracked (e.g., purchases, signups, page views). Use this action to discov
- `POST https://api.mcp.ai/api/msg91/get/failed/events` — Retrieve failed user events from a MSG91 Segmento campaign. This tool fetches events that failed to process during campaign execution, helping you identify and debug issues such as validation errors, 
  - body: { page?: integer, limit?: integer, end_date?: string, start_date?: string, campaign_id: string }
- `POST https://api.mcp.ai/api/msg91/list/campaigns` — Tool to list all campaigns in Segmento. Use when you need to retrieve campaigns with pagination support.
  - body: { page?: integer, limit?: integer }
- `POST https://api.mcp.ai/api/msg91/resend/otp` — Resend OTP to the same mobile number via text message or voice call. Use when the original OTP was not received or expired, and the user needs a new code sent to the same number.
  - body: { mobile: string, retrytype: string }
- `POST https://api.mcp.ai/api/msg91/send/otp` — Tool to send OTP (One-Time Password) to a mobile number using a pre-configured MSG91 template. Use when you need to verify user phone numbers for authentication, account registration, password reset, 
  - body: { otp?: string, mobile: string, userip?: string, unicode?: integer, invisible?: integer, otp_expiry: integer, otp_length?: integer, template_id: string, realTimeResponse: integer }
- `POST https://api.mcp.ai/api/msg91/send/sms/v5` — Send SMS messages using pre-defined templates via MSG91 Flow API v5. Use when you need to send template-based SMS with dynamic variable substitution to single or multiple recipients. Templates must be
  - body: { short_url?: string, recipients: object[], template_id: string, realTimeResponse?: string, short_url_expiry?: integer }
- `POST https://api.mcp.ai/api/msg91/verify/otp` — Tool to verify an OTP (One-Time Password) sent to a mobile number. Use when you need to confirm that the OTP code entered by the user matches the one sent via Send OTP API.
  - body: { otp: string, mobile: string, otp_expiry?: integer }

## Example prompts
- "What can I do in Msg91?"
- "Show me a summary of my Msg91 account"

## More
- Page: https://mcp.ai/msg91
- Agent spec (llms.txt): https://mcp.ai/msg91/llms.txt
- Postman collection: https://mcp.ai/msg91/postman.json
