MCP serveris
MCP (Model Context Protocol) serveris leidžia AI asistentams, tokiems kaip Claude, tiesiogiai naudotis šia platforma: siųsti SMS, valdyti kontaktus, įrenginius ir kampanijas per įrankius. Jis veikia MCP Streamable HTTP transportu (JSON režimu be sesijų) ir apgaubia REST API, todėl visi plano limitai galioja kaip įprasta.
--header parametro ir Claude Code lange paleiskite /mcp, kad prisijungtumėte.
--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?"
}
]
}
MCP jungtis yra Messages API beta funkcija: siųskite anthropic-beta: mcp-client-2025-11-20 antraštę, aprašykite serverį mcp_servers masyve ir įjunkite jo įrankius mcp_toolset įrašu tools masyve. Veikia per Claude API, Claude Platform on AWS ir Microsoft Foundry, bet ne per Amazon Bedrock ar 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 pateikia įterptas SMS grupes: insert_id yra pirmosios grupės SMS sms_id, o rows – kiek SMS grupėje sukurta; jų ID eina iš eilės.
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 atitikmuo: 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.
| Parametrai | Išsamiau | Aprašymas |
|---|---|---|
| content | Reikalinga Tekstas | Message text, max 1000 characters. Supports spintax {option A|option B} and contact variables {{NAME}}, {{PHONE_NUMBER}}, {{COUNTRY_NAME}}, {{CUSTOM_PARAMETERS:KEY}}. |
| phone_numbers | Reikalinga Masyvas | Recipient phone numbers in E.164 format, e.g. +37060000000. |
| device_id | Pasirinktinai Sveikasis skaičius | Android device to send from. Required together with sim_subscription_id unless gateway is used. |
| sim_subscription_id | Pasirinktinai Sveikasis skaičius | SIM card of the device, from the sims array of list_devices. |
| gateway | Pasirinktinai Tekstas |
Send through the hosted VertexSMS gateway with the "ASMS.lt" sender ID instead of a device. Leidžiamos vertės: vertexsms |
| is_scheduled | Pasirinktinai Loginis | Set true to schedule instead of sending immediately. |
| scheduled_datetime | Pasirinktinai Tekstas | 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.
| Parametrai | Išsamiau | Aprašymas |
|---|---|---|
| type | Pasirinktinai Tekstas |
Message direction. Leidžiamos vertės: sent, received |
| status | Pasirinktinai Tekstas |
Delivery status. Leidžiamos vertės: sent, pending, failed, received |
| contact_id | Pasirinktinai Sveikasis skaičius | |
| device_id | Pasirinktinai Sveikasis skaičius | |
| campaign_id | Pasirinktinai Sveikasis skaičius | |
| search | Pasirinktinai Tekstas | Search term. |
| search_by | Pasirinktinai Tekstas |
Leidžiamos vertės: phone_number, content |
| datetime_field | Pasirinktinai Tekstas |
Leidžiamos vertės: scheduled_datetime, datetime |
| datetime_start | Pasirinktinai Tekstas | "Y-m-d H:i:s" range start for datetime_field. |
| datetime_end | Pasirinktinai Tekstas | "Y-m-d H:i:s" range end for datetime_field. |
| order_by | Pasirinktinai Tekstas |
Leidžiamos vertės: sms_id, scheduled_datetime, datetime |
| order_type | Pasirinktinai Tekstas |
Leidžiamos vertės: ASC, DESC |
| page | Pasirinktinai Sveikasis skaičius | Page number, starting at 1. |
| results_per_page | Pasirinktinai Sveikasis skaičius |
Results per page. Leidžiamos vertės: 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).
| Parametrai | Išsamiau | Aprašymas |
|---|---|---|
| sms_id | Reikalinga Sveikasis skaičius |
Permanently delete one SMS message by its sms_id. A pending message is removed from the sending queue. This cannot be undone.
| Parametrai | Išsamiau | Aprašymas |
|---|---|---|
| sms_id | Reikalinga Sveikasis skaičius |
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.
| Parametrai | Išsamiau | Aprašymas |
|---|---|---|
| page | Pasirinktinai Sveikasis skaičius | Page number, starting at 1. |
| results_per_page | Pasirinktinai Sveikasis skaičius |
Results per page. Leidžiamos vertės: 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.
| Parametrai | Išsamiau | Aprašymas |
|---|---|---|
| device_id | Reikalinga Sveikasis skaičius |
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).
| Parametrai | Išsamiau | Aprašymas |
|---|---|---|
| device_id | Reikalinga Sveikasis skaičius |
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.
| Parametrai | Išsamiau | Aprašymas |
|---|---|---|
| device_id | Reikalinga Sveikasis skaičius |
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.
| Parametrai | Išsamiau | Aprašymas |
|---|---|---|
| search | Pasirinktinai Tekstas | Search term. |
| search_by | Pasirinktinai Tekstas |
Field to search in. custom_parameters_key / custom_parameters_value match custom parameter names / values. Leidžiamos vertės: phone_number, name, custom_parameters_key, custom_parameters_value |
| page | Pasirinktinai Sveikasis skaičius | Page number, starting at 1. |
| results_per_page | Pasirinktinai Sveikasis skaičius |
Results per page. Leidžiamos vertės: 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.
| Parametrai | Išsamiau | Aprašymas |
|---|---|---|
| contact_id | Reikalinga Sveikasis skaičius |
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}}.
| Parametrai | Išsamiau | Aprašymas |
|---|---|---|
| phone_number | Reikalinga Tekstas | E.164 format, e.g. +37060000000. |
| name | Pasirinktinai Tekstas | |
| custom_parameters | Pasirinktinai Objektas | 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.
| Parametrai | Išsamiau | Aprašymas |
|---|---|---|
| contact_id | Reikalinga Sveikasis skaičius | |
| phone_number | Pasirinktinai Tekstas | E.164 format. |
| name | Pasirinktinai Tekstas | |
| custom_parameters | Pasirinktinai Objektas |
Permanently delete one contact by its contact_id. This cannot be undone.
| Parametrai | Išsamiau | Aprašymas |
|---|---|---|
| contact_id | Reikalinga Sveikasis skaičius |
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.
| Parametrai | Išsamiau | Aprašymas |
|---|---|---|
| type | Pasirinktinai Tekstas |
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. Leidžiamos vertės: overview, continent_code, country_code, has_opted_out, activity, timezone, phone_type |
| start_date | Pasirinktinai Tekstas | Range start in "Y-m-d" format. Defaults to 30 days ago. |
| end_date | Pasirinktinai Tekstas | 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.
| Parametrai | Išsamiau | Aprašymas |
|---|---|---|
| page | Pasirinktinai Sveikasis skaičius | Page number, starting at 1. |
| results_per_page | Pasirinktinai Sveikasis skaičius |
Results per page. Leidžiamos vertės: 10, 25, 50, 100, 250, 500, 1000 |
Get one campaign by its campaign_id, including status, content and total/sent/failed SMS counters.
| Parametrai | Išsamiau | Aprašymas |
|---|---|---|
| campaign_id | Reikalinga Sveikasis skaičius |
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.
| Parametrai | Išsamiau | Aprašymas |
|---|---|---|
| name | Reikalinga Tekstas | Internal campaign name. |
| content | Reikalinga Tekstas | Message text, max 1000 characters. Supports spintax and contact variables. |
| device_id | Reikalinga Sveikasis skaičius | Android device to send from (see list_devices). |
| sim_subscription_id | Reikalinga Sveikasis skaičius | SIM card of the device. |
| segment | Pasirinktinai Tekstas | "all", "custom" (with contacts_ids), "bulk" (with phone_numbers), or a saved segment id as a numeric string. |
| contacts_ids | Pasirinktinai Masyvas | Target contact ids, used with segment="custom". |
| phone_numbers | Pasirinktinai Masyvas | Target phone numbers in E.164 format, used with segment="bulk". |
| is_scheduled | Pasirinktinai Loginis | |
| scheduled_datetime | Pasirinktinai Tekstas | "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.
| Parametrai | Išsamiau | Aprašymas |
|---|---|---|
| campaign_id | Reikalinga Sveikasis skaičius |