KosmoKrator

communication

Twilio MCP Integration for LangGraph

Connect Twilio to LangGraph through the local KosmoKrator MCP gateway with scoped tools, credentials, and write policy.

15 functions 10 read 5 write API token auth

Connect Twilio to LangGraph

Run KosmoKrator integration calls from LangGraph nodes while preserving local credentials and permissions.

Use a graph node that calls the KosmoKrator CLI for deterministic steps or an MCP client for dynamic tool selection. The gateway is local, scoped to this integration, and starts with --write=deny so LangGraph can inspect read-capable tools without receiving write access by default.

Twilio MCP Config for LangGraph

Headless CLI calls fit repeatable graph edges; MCP fits exploratory agent nodes.

{
  "mcpServers": {
    "kosmokrator-twilio": {
      "type": "stdio",
      "command": "kosmo",
      "args": [
        "mcp:serve",
        "--integration=twilio",
        "--write=deny"
      ]
    }
  }
}

Run the Gateway Manually

kosmokrator mcp:serve --integration=twilio --write=deny

Why Use KosmoKrator Here

Scoped tools

Expose only Twilio instead of a broad multi-service tool list.

Local credentials

Reuse credentials already configured for the KosmoKrator CLI and Lua runtime.

Write policy

Start read-only, then opt into ask or allow for trusted workspaces.

Twilio Tools Visible to LangGraph

LangGraph sees stable MCP tool names generated from the Twilio integration catalog.

MCP toolSource functionTypeDescription
integration__twilio__twilio_send_sms twilio.twilio_send_sms Write Send an SMS or MMS message via Twilio. Provide "to" and "from" phone numbers in E.164 format (e.g., "+15551234567"). Optionally include media_url for MMS and status_callback for delivery tracking.
integration__twilio__twilio_get_message twilio.twilio_get_message Read Retrieve a Twilio message by its SID. Returns the full message details including status, body, timestamps, and pricing.
integration__twilio__twilio_list_messages twilio.twilio_list_messages Read List Twilio messages with optional filtering. Filter by To, From, DateSent. Use PageSize to control pagination (default 50, max 1000).
integration__twilio__twilio_make_call twilio.twilio_make_call Write Make an outbound voice call via Twilio. Provide a "url" that returns TwiML, or inline "twiml" to control the call. Optionally provide a status_callback URL for call progress events.
integration__twilio__twilio_get_call twilio.twilio_get_call Read Retrieve a Twilio call by its SID. Returns the full call details including status, duration, timestamps, and pricing.
integration__twilio__twilio_list_calls twilio.twilio_list_calls Read List Twilio calls with optional filtering. Filter by To, From, Status. Use PageSize to control pagination (default 50, max 1000).
integration__twilio__twilio_list_phone_numbers twilio.twilio_list_phone_numbers Read List incoming phone numbers on the Twilio account. Returns all phone numbers associated with the account, including capabilities.
integration__twilio__twilio_get_phone_number twilio.twilio_get_phone_number Read Retrieve a Twilio incoming phone number by its SID. Returns phone number details including capabilities and configuration.
integration__twilio__twilio_lookup_phone twilio.twilio_lookup_phone Read Lookup phone number details using the Twilio Lookup API v2. Provide a phone number in E.164 format. Optionally request additional fields like "caller_name", "line_type_intelligence", "sim_swap", or "call_forwarding".
integration__twilio__twilio_create_usage_trigger twilio.twilio_create_usage_trigger Write Create a usage trigger on the Twilio account. Twilio will notify the callback URL when usage of the specified category exceeds the trigger value. Supports recurring triggers (daily, monthly, yearly) or one-time triggers.
integration__twilio__twilio_list_usage_records twilio.twilio_list_usage_records Read List Twilio usage records with optional filtering. Filter by category and date range. Returns usage counts and pricing per category.
integration__twilio__twilio_send_whatsapp twilio.twilio_send_whatsapp Write Send a WhatsApp message via Twilio. Provide "to" and "from" phone numbers in E.164 format — they will automatically be prefixed with "whatsapp:". Supports text and media messages.
integration__twilio__twilio_get_account twilio.twilio_get_account Read Retrieve Twilio account details. Optionally provide an account SID to look up a specific subaccount, or omit to retrieve the current account.
integration__twilio__twilio_list_recordings twilio.twilio_list_recordings Read List Twilio call recordings with optional filtering. Filter by call SID, date created, or limit the number of results returned.
integration__twilio__twilio_delete_recording twilio.twilio_delete_recording Write Delete a Twilio recording by its SID. Permanently removes the recording and all associated media. This action cannot be undone.

Related Twilio Pages