MCP server

The EnvoiSMS MCP server: SMS, WhatsApp and OTP tools for AI agents

envoisms-mcp-server is EnvoiSMS.ma's official Model Context Protocol server. Add it to Claude Desktop or any MCP client and your agent can send an SMS, send and check a one-time code, and read your balance — with your API key, your Sender ID and your prepaid balance.

cURL REST API
curl -X POST https://api.envoisms.ma/v1/messages \ -H "Authorization: Bearer env_live_votretoker" \ -H "Content-Type: application/json" \ -d '{ "to": "+212661234567", "message": "Votre code de confirmation est : 849201. Expire dans 3 minutes.", "from": "VOTREMARQUE" }'
● Routes locales MarocIAM • Inwi • Orange
https://api.envoisms.ma/v1
Local Routes
Maroc Telecom (IAM) • Inwi • Orange
Verified DLR Receipts
HMAC-SHA256 Signed
Clear MAD Pricing
dès 0,60 MAD/SMS • 5 MAD offerts

Install

Run it straight from GitHub with npx github:envoisms/envoisms-mcp-server — the package builds itself on install — or clone the repository and run npm install then npm run build. The server reads your key from the ENVOISMS_API_KEY environment variable.

  • Source: github.com/envoisms/envoisms-mcp-server, MIT licence
  • A free account comes with 5 MAD of credit for your first sends

Add it to Claude Desktop

In claude_desktop_config.json, add an "envoisms" entry under mcpServers with command "npx", args ["-y", "github:envoisms/envoisms-mcp-server"], and env { "ENVOISMS_API_KEY": "your_api_key_here" }. Claude then offers the four tools below.

  • Any MCP client that starts a server over stdio can use the same command
  • Use an env_test_ sandbox key while you try it: nothing is delivered or debited

The four tools

send_sms sends a text to a Moroccan (+212) or international number. send_otp generates and sends a one-time code over SMS or WhatsApp through EnvoiSMS's shared sender, with no WhatsApp connection needed. check_otp validates the code the user typed against the pending session. get_balance returns the account balance in MAD and EUR.

  • send_sms: to, message, optional from (Sender ID), channel (sms by default) and idempotency_key
  • send_otp: to, optional brand and channel; check_otp: session_id and code
  • get_balance: no arguments

Safe for an agent to retry

Every send_sms call carries an Idempotency-Key, so an agent that retries a tool call never sends or bills the same message twice. Leave channel on sms for ordinary text: channel "whatsapp" sends from the account's own connected WhatsApp Business number, and free text only reaches a contact who wrote to that number in the last 24 hours — otherwise the API answers WHATSAPP_NOT_CONNECTED or OUT_OF_24H_WINDOW and charges nothing.

Everything you need to know about MCP server.

Which AI clients can use the EnvoiSMS MCP server?
Any client that speaks the Model Context Protocol and can start a local server, such as Claude Desktop. The configuration is the command npx -y github:envoisms/envoisms-mcp-server with ENVOISMS_API_KEY in its environment.
Can the agent send a WhatsApp code without a WhatsApp Business number?
Yes. "Send a code on WhatsApp" is send_otp with channel "whatsapp": it goes through EnvoiSMS's shared sender and needs no connection.
What does an agent's message cost?
The same as the same send through the REST API: it is debited from your prepaid balance in dirhams. get_balance lets the agent check what is left.

Ready to integrate with MCP server?

Create your account in under 2 minutes. Get 5 MAD of free credit instantly to test the API.