thaibulksms
OfficialClick on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@thaibulksms Check my SMS credit balance"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@thaibulksms/tbs
Zero-dependency MCP & CLI for ThaiBulkSMS and ThaiBulkMail APIs.
Install
npm install -g @thaibulksms/tbsRelated MCP server: seven-mcp
Quick Start
# 1. Save credentials (from developer.thaibulksms.com)
tbs login
# 2. Use it
tbs send 0812345678 "Hello" --sender OTP_SMS # Send SMS
tbs email a@b.com "Subject" --from s@d.com --template <uuid> # Send email
tbs credit # Check balance
tbs otp 0812345678 # SMS OTP
tbs email-otp a@b.com --template <uuid> # Email OTPNo install needed with npx:
npx @thaibulksms/tbs login
npx @thaibulksms/tbs send 0812345678 "Hello"Add to AI Agent (MCP)
Claude Code
claude mcp add thaibulksms \
-e THAIBULKSMS_API_KEY=xxx \
-e THAIBULKSMS_API_SECRET=xxx \
-e THAIBULKSMS_OTP_KEY=xxx \
-e THAIBULKSMS_OTP_SECRET=xxx \
-- npx -y @thaibulksms/tbsOr .mcp.json (project-scoped, commit to git):
{
"mcpServers": {
"thaibulksms": {
"command": "npx",
"args": ["-y", "@thaibulksms/tbs"],
"env": {
"THAIBULKSMS_API_KEY": "${THAIBULKSMS_API_KEY}",
"THAIBULKSMS_API_SECRET": "${THAIBULKSMS_API_SECRET}",
"THAIBULKSMS_OTP_KEY": "${THAIBULKSMS_OTP_KEY}",
"THAIBULKSMS_OTP_SECRET": "${THAIBULKSMS_OTP_SECRET}"
}
}
}
}Gemini CLI
gemini mcp add thaibulksms -- npx -y @thaibulksms/tbsOpenCode
{
"mcp": {
"thaibulksms": {
"type": "local",
"command": ["npx", "-y", "@thaibulksms/tbs"],
"environment": {
"THAIBULKSMS_API_KEY": "{env:THAIBULKSMS_API_KEY}",
"THAIBULKSMS_API_SECRET": "{env:THAIBULKSMS_API_SECRET}",
"THAIBULKSMS_OTP_KEY": "{env:THAIBULKSMS_OTP_KEY}",
"THAIBULKSMS_OTP_SECRET": "{env:THAIBULKSMS_OTP_SECRET}"
},
"enabled": true
}
}
}OpenClaw
OpenClaw reads .mcp.json (same as Claude Code). Drop the .mcp.json file in your project root — OpenClaw picks it up automatically.
Claude Desktop
Config: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
{
"mcpServers": {
"thaibulksms": {
"command": "npx",
"args": ["-y", "@thaibulksms/tbs"],
"env": {
"THAIBULKSMS_API_KEY": "your_key",
"THAIBULKSMS_API_SECRET": "your_secret",
"THAIBULKSMS_OTP_KEY": "your_otp_key",
"THAIBULKSMS_OTP_SECRET": "your_otp_secret"
}
}
}
}Then ask your agent: "Check my SMS credit balance"
CLI Commands
tbs login Save API credentials
tbs credit Check SMS + email credit
tbs send <to> <message> Send SMS
tbs email <to> <subject> Send email (template)
tbs otp <to> Request SMS OTP
tbs verify <token> <pin> Verify SMS OTP
tbs email-otp <to> Request email OTP
tbs email-verify <token> <code> Verify email OTP
tbs profiles List saved profiles
tbs help <command> Per-command helpFlags
Flag | Description | Commands |
| SMS sender ID (default: |
|
| Sender email address |
|
| Template UUID |
|
| Machine-readable output | all |
| Use specific profile | all |
Examples
tbs send 0812345678 "Hello" --sender OTP_SMS
tbs send 0812345678 "Hello" --json
tbs email user@example.com "Subject" --from sender@domain.com --template <uuid>
tbs credit --json
tbs otp 0812345678
tbs verify <token> 1234
tbs email-otp user@example.com --template <uuid>
tbs email-verify <token> 733923
tbs login --profile production
tbs credit --profile productionMCP Tools (8)
Tool | Description |
| Send SMS to one Thai mobile number |
| Send email via ThaiBulkMail template |
| Check SMS credit balance |
| Check email credit balance |
| Send OTP PIN via SMS |
| Verify SMS OTP PIN |
| Send OTP code via email |
| Verify email OTP code |
Credentials & Setup
API Keys
What | Where to get it |
SMS/Email API Key & Secret | |
SMS OTP Key & Secret | |
SMS Sender Name | Dashboard > Sender Name (must register before use) |
Email Template | Dashboard > Email Templates (create and copy template UUID) |
Email OTP Template | Dashboard > Email OTP (create and copy template UUID) |
Environment Variables
Variable | For | Required |
| SMS, Email | Yes |
| SMS, Email | Yes |
| SMS OTP | For OTP |
| SMS OTP | For OTP |
Precedence: --profile flag > env vars > ~/.config/tbs/default.json
SMS/Email use HTTP Basic Auth. SMS OTP uses separate key/secret in request body. Email OTP uses the same Basic Auth as email.
Architecture
src/
index.ts Entry point — CLI commands or MCP (no args)
cli.ts Twilio-style CLI handlers
profile.ts Credential storage (~/.config/tbs/, chmod 0600)
transport.ts MCP JSON-RPC stdio transport (~80 lines)
server.ts MCP tool definitions (raw JSON Schema) + handlers
client.ts ThaiBulk HTTP client (fetch + Basic Auth)
validators.ts Phone/email validation (pure regex)Zero runtime dependencies. No @modelcontextprotocol/sdk (26MB, 91 packages). Just ~80 lines of JSON-RPC stdio transport using Node.js built-ins.
Development
npm install # Dev deps only
npm test # Node.js
npm run test:bun # Bun
npm run build # CompileSecurity
Credentials in
~/.config/tbs/(chmod 0600) or env vars — never hardcodedSingle-recipient only — no bulk sends
Thai mobile validation, email header injection prevention
Human-in-the-loop for destructive MCP tools
Zero runtime deps = zero supply chain risk
Links
GitHub: github.com/thaibulksms/tbs
API Docs: developer.thaibulksms.com
License
Available Tools
8 toolscheck_email_creditARead-only
Check remaining email credit balance on ThaiBulkMail.
Inputs: no named parameters.
check_sms_creditARead-only
Check remaining SMS credit balance on ThaiBulkSMS.
Inputs: no named parameters.
request_email_otpADestructive
Send an OTP code via email using a ThaiBulkMail OTP template.
Inputs: template_uuid (required), recipient_email (required).
request_otpADestructive
Request an OTP code via SMS to a Thai mobile number.
Inputs: msisdn (required).
send_emailADestructive
Send email via ThaiBulkMail using a template. Requires user confirmation.
Inputs: to (required), subject (required), mail_from (required), template_uuid (required).
send_smsADestructive
Send a single SMS via ThaiBulkSMS. Requires user confirmation before sending.
Inputs: message (required), recipient (required), sender.
verify_email_otpAIdempotent
Verify an email OTP code against a token from a previous request_email_otp call.
Inputs: token (required), otp_code (required).
verify_otpAIdempotent
Verify an OTP PIN against a token from a previous request_otp call.
Inputs: pin (required), token (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a distinct action and resource: sending SMS, checking credits, and OTP flows are clearly separated. Even send_sms vs request_otp are distinguishable by purpose, with descriptions clarifying the OTP-specific nature.
All tools follow a consistent verb_noun pattern in snake_case, such as send_sms, check_sms_credit, request_otp, and verify_email_otp. The naming is uniform and predictable.
With 8 tools, the server is well-scoped, covering SMS and email sending, credit checks, and OTP verification. This is within the ideal range for a focused API integration.
The server covers core operations for SMS and email, including send, credit check, and OTP flows. However, given the 'bulk' in the server name, a bulk send operation is missing, though single operations are adequately covered.
Maintenance
Related MCP Connectors
The Mobile Text Alerts SMS MCP server enables your AI to send SMS messages & manage contacts
Unified messaging MCP server: WhatsApp, Instagram, Telegram, SMS, Messenger & email support inbox
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
WhatsApp (Web + Business API), SMS, contacts, and call records via 2Chat's MCP server.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceMCP Server that enables natural language interaction with iSendPro's SMS messaging platform, allowing users to send and manage SMS communications through conversational commands.-
- AlicenseBqualityDmaintenanceMCP server for the seven.io API, enabling SMS, voice, RCS messaging, and account management through natural language.447 npm1MIT
- FlicenseCqualityDmaintenanceMCP server enabling interaction with Telnyx telephony, messaging, and AI assistant APIs through natural language.46-
- AlicenseNot gradedqualityBmaintenanceMCP server that provides SMS sending, CSV bulk SMS, and voice calling capabilities via the Vonage API.Apache 2.0