MCP server
The MCP (Model Context Protocol) server lets AI assistants such as Claude use this platform directly: sending SMS, managing contacts, devices and campaigns through tools. It speaks MCP over Streamable HTTP in stateless JSON mode and wraps the REST API, so all plan limits apply as usual.
--header option and run /mcp inside Claude Code to log in.
--header 'x-api-key: {anthropic_api_key}' \
--header 'anthropic-version: 2026-10-21' \
--header 'anthropic-beta: mcp-client-2025-11-20' \
--header 'content-type: application/json' \
--data @request.json
{
"model": "claude-opus-5-5",
"max_tokens": 16000,
"mcp_servers": [
{
"type": "url",
"url": "https://asms.lt/mcp",
"name": "asms",
"authorization_token": "{api_key}"
}
],
"tools": [
{
"type": "mcp_toolset",
"mcp_server_name": "asms"
}
],
"messages": [
{
"role": "user",
"content": "How many SMS did I send this month?"
}
]
}
The MCP connector is a beta of the Messages API: send the anthropic-beta: mcp-client-2025-11-20 header, declare the server in mcp_servers and enable its tools with an mcp_toolset entry in tools. Available on the Claude API, Claude Platform on AWS and Microsoft Foundry, not on Amazon Bedrock or Google Vertex AI.
--url 'https://asms.lt/mcp' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"0"}}}'
--url 'https://asms.lt/mcp' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
--url 'https://asms.lt/mcp' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"send_sms","arguments":{"content":"Hello from MCP","phone_numbers":["+37060000000"],"gateway":"vertexsms"}}}'
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"content": [
{
"type": "text",
"text": "{\n \"data\": {\n \"sms_ids\": [\n {\n \"insert_id\": 1,\n \"affected_rows\": 1,\n \"rows\": 1\n }\n ]\n }\n}"
}
],
"isError": false
}
}
sms_ids lists the inserted batches: insert_id is the sms_id of the first SMS of a batch and rows the number of SMS it created, with consecutive IDs.
Get the authenticated account profile: plan limits (monthly SMS quota, contacts and devices limits), timezone, current usage counters and preferences. Call this first to learn the timezone used by scheduled_datetime fields and the remaining quotas.
REST equivalent: GET api/userSend an SMS to one or more recipients. Two sending modes: (1) through a connected Android device - pass device_id and sim_subscription_id (discover both with list_devices; if get_device_status reports is_online=false, call wake_device first); (2) through the hosted gateway - pass gateway="vertexsms" to send with the alphanumeric sender ID "ASMS.lt" and no device (availability and daily quota depend on the account plan). To schedule for later, set is_scheduled=true and scheduled_datetime. The response lists data.sms_ids as insert batches: insert_id is the sms_id of the first SMS created and rows how many were created (consecutive ids). Delivery happens asynchronously, check status with get_sms or list_sms.
| Parameters | Details | Description |
|---|---|---|
| content | Required String | Message text, max 1000 characters. Supports spintax {option A|option B} and contact variables {{NAME}}, {{PHONE_NUMBER}}, {{COUNTRY_NAME}}, {{CUSTOM_PARAMETERS:KEY}}. |
| phone_numbers | Required Array | Recipient phone numbers in E.164 format, e.g. +37060000000. |
| device_id | Optional Integer | Android device to send from. Required together with sim_subscription_id unless gateway is used. |
| sim_subscription_id | Optional Integer | SIM card of the device, from the sims array of list_devices. |
| gateway | Optional String |
Send through the hosted VertexSMS gateway with the "ASMS.lt" sender ID instead of a device. Allowed values: vertexsms |
| is_scheduled | Optional Boolean | Set true to schedule instead of sending immediately. |
| scheduled_datetime | Optional String | When to send, "Y-m-d H:i:s" in the account timezone (see account_info). Requires is_scheduled=true. |
List sent and received SMS messages of the account, paginated and filterable. Use get_sms when a single sms_id is already known. The status field shows delivery state: pending (queued), sent, failed, received.
| Parameters | Details | Description |
|---|---|---|
| type | Optional String |
Message direction. Allowed values: sent, received |
| status | Optional String |
Delivery status. Allowed values: sent, pending, failed, received |
| contact_id | Optional Integer | |
| device_id | Optional Integer | |
| campaign_id | Optional Integer | |
| search | Optional String | Search term. |
| search_by | Optional String |
Allowed values: phone_number, content |
| datetime_field | Optional String |
Allowed values: scheduled_datetime, datetime |
| datetime_start | Optional String | "Y-m-d H:i:s" range start for datetime_field. |
| datetime_end | Optional String | "Y-m-d H:i:s" range end for datetime_field. |
| order_by | Optional String |
Allowed values: sms_id, scheduled_datetime, datetime |
| order_type | Optional String |
Allowed values: ASC, DESC |
| page | Optional Integer | Page number, starting at 1. |
| results_per_page | Optional Integer |
Results per page. Allowed values: 10, 25, 50, 100, 250, 500, 1000 |
Get one SMS message by its sms_id, including delivery status, error (when failed), content, and the device and SIM it was sent from, plus the gateway field (null = sent via Android device, "vertexsms" = sent via the hosted gateway).
| Parameters | Details | Description |
|---|---|---|
| sms_id | Required Integer |
Permanently delete one SMS message by its sms_id. A pending message is removed from the sending queue. This cannot be undone.
| Parameters | Details | Description |
|---|---|---|
| sms_id | Required Integer |
List the connected Android devices of the account. Each device includes its sims array (use subscription_id as sim_subscription_id for send_sms), battery level, and last_ping_datetime. The app checks in about every 15 minutes while idle, so use get_device_status for a computed is_online flag and wake_device to wake a sleeping device.
| Parameters | Details | Description |
|---|---|---|
| page | Optional Integer | Page number, starting at 1. |
| results_per_page | Optional Integer |
Results per page. Allowed values: 10, 25, 50, 100, 250, 500, 1000 |
Get one Android device by its device_id, including SIM cards, battery, online status (last_ping_datetime) and sending counters.
| Parameters | Details | Description |
|---|---|---|
| device_id | Required Integer |
Get the live connection status of one Android device: last_ping_datetime, seconds_since_last_ping, is_online (pinged within the last 20 minutes - the app checks in about every 15 minutes while idle and right after a wake up), battery, pending SMS count and can_wake. After a wake_device call it also returns last_wake_datetime, last_wake_push_status and pinged_since_last_wake (true once the device answered the wake up).
| Parameters | Details | Description |
|---|---|---|
| device_id | Required Integer |
Wake up a sleeping Android device with a high priority push: the app starts, sends its pending SMS and pings back. Use it when get_device_status reports is_online=false or SMS stay pending. Then call get_device_status after about 5-15 seconds: pinged_since_last_wake=true confirms the device is awake. Limited to one wake up per device every 30 seconds (HTTP 429 with the remaining wait otherwise). Errors explain when the device has no push token (the app must be reconnected) or the push service rejected the wake up.
| Parameters | Details | Description |
|---|---|---|
| device_id | Required Integer |
List the contacts of the account, paginated and searchable by phone number, name or custom parameters. Use contacts_statistics for aggregate counts instead of paging through this list.
| Parameters | Details | Description |
|---|---|---|
| search | Optional String | Search term. |
| search_by | Optional String |
Field to search in. custom_parameters_key / custom_parameters_value match custom parameter names / values. Allowed values: phone_number, name, custom_parameters_key, custom_parameters_value |
| page | Optional Integer | Page number, starting at 1. |
| results_per_page | Optional Integer |
Results per page. Allowed values: 10, 25, 50, 100, 250, 500, 1000 |
Get one contact by its contact_id, including phone number, name, country, custom parameters, opt-out flag and SMS counters.
| Parameters | Details | Description |
|---|---|---|
| contact_id | Required Integer |
Create a new contact. The phone number must be unique within the account and in E.164 format. Custom parameters are free-form key/value pairs usable in SMS content as {{CUSTOM_PARAMETERS:KEY}}.
| Parameters | Details | Description |
|---|---|---|
| phone_number | Required String | E.164 format, e.g. +37060000000. |
| name | Optional String | |
| custom_parameters | Optional Object | Key/value pairs, e.g. {"city": "Vilnius"}. |
Update an existing contact by its contact_id. Only the provided fields change; note that providing custom_parameters replaces the whole custom parameters set.
| Parameters | Details | Description |
|---|---|---|
| contact_id | Required Integer | |
| phone_number | Optional String | E.164 format. |
| name | Optional String | |
| custom_parameters | Optional Object |
Permanently delete one contact by its contact_id. This cannot be undone.
| Parameters | Details | Description |
|---|---|---|
| contact_id | Required Integer |
Get aggregate statistics about the contacts of the account. Use this for counts and breakdowns instead of paging through list_contacts. Except for type=activity, only contacts created between start_date and end_date are counted (default: the last 30 days), so widen the range for all-time figures.
| Parameters | Details | Description |
|---|---|---|
| type | Optional String |
overview (default) = new contacts per day; continent_code, country_code, has_opted_out, timezone, phone_type = contact counts broken down by that dimension; activity = all contacts grouped by last activity bucket. Allowed values: overview, continent_code, country_code, has_opted_out, activity, timezone, phone_type |
| start_date | Optional String | Range start in "Y-m-d" format. Defaults to 30 days ago. |
| end_date | Optional String | Range end in "Y-m-d" format. Defaults to today. |
List the bulk SMS campaigns of the account with their status and sending counters, paginated.
| Parameters | Details | Description |
|---|---|---|
| page | Optional Integer | Page number, starting at 1. |
| results_per_page | Optional Integer |
Results per page. Allowed values: 10, 25, 50, 100, 250, 500, 1000 |
Get one campaign by its campaign_id, including status, content and total/sent/failed SMS counters.
| Parameters | Details | Description |
|---|---|---|
| campaign_id | Required Integer |
Create a bulk SMS campaign sent through a connected Android device. Target audience: segment="all" targets every contact; segment="custom" targets contacts_ids; segment="bulk" targets phone_numbers; a numeric segment value targets a saved segment. Campaigns count against the monthly campaigns plan limit and each SMS against the monthly SMS limit. To schedule, set is_scheduled=true and scheduled_datetime.
| Parameters | Details | Description |
|---|---|---|
| name | Required String | Internal campaign name. |
| content | Required String | Message text, max 1000 characters. Supports spintax and contact variables. |
| device_id | Required Integer | Android device to send from (see list_devices). |
| sim_subscription_id | Required Integer | SIM card of the device. |
| segment | Optional String | "all", "custom" (with contacts_ids), "bulk" (with phone_numbers), or a saved segment id as a numeric string. |
| contacts_ids | Optional Array | Target contact ids, used with segment="custom". |
| phone_numbers | Optional Array | Target phone numbers in E.164 format, used with segment="bulk". |
| is_scheduled | Optional Boolean | |
| scheduled_datetime | Optional String | "Y-m-d H:i:s" in the account timezone. |
Permanently delete one campaign by its campaign_id, including its pending queued SMS. This cannot be undone.
| Parameters | Details | Description |
|---|---|---|
| campaign_id | Required Integer |