Guides

MCP Setup Guide

Connect AI agents to Trunx via MCP — step-by-step for Claude Desktop, Cursor, and any MCP client.

Give your AI assistant direct access to telecom infrastructure. The Model Context Protocol (MCP) is an open standard that lets AI agents discover and call tools on external services. Trunx exposes its full API as MCP tools — SMS, voice AI, campaigns, DIDs, IVR, compliance, and more — through a single endpoint. Any MCP-compatible client can connect and start making calls, sending messages, or managing campaigns through natural language.

For the full MCP specification, see modelcontextprotocol.io.


Prerequisites

Before connecting, you need a Trunx API key. Create one from the dashboard settings or via the signup endpoint. Your key will look like tk_live_....


Setup with Claude Desktop

Open MCP configuration

Open Claude Desktop and navigate to Settings > Developer > Edit Config. This opens the MCP configuration JSON file.

On macOS, the file is located at:

~/Library/Application Support/Claude/claude_desktop_config.json

On Windows:

%APPDATA%\Claude\claude_desktop_config.json

Add the Trunx server

Add the following to your configuration file. Replace tk_live_your_key_here with your actual API key.

{
  "mcpServers": {
    "trunx": {
      "url": "https://api.trunx.io/mcp",
      "headers": {
        "Authorization": "Bearer tk_live_your_key_here"
      }
    }
  }
}

If you already have other MCP servers configured, add the "trunx" entry inside the existing "mcpServers" object.

Verify the connection

Restart Claude Desktop. You should see a hammer icon in the chat input area indicating MCP tools are available. Click it to browse the available Trunx tools.

Try asking Claude: "What phone numbers do I have in Trunx?" — it should call the list_dids tool and return your DID inventory.


Setup with Cursor

Open MCP settings

In Cursor, go to Settings > MCP Servers (or open the command palette and search for "MCP").

Add the Trunx server

Add a new MCP server with this configuration:

{
  "mcpServers": {
    "trunx": {
      "url": "https://api.trunx.io/mcp",
      "headers": {
        "Authorization": "Bearer tk_live_your_key_here"
      }
    }
  }
}

Start using tools

Open Cursor's AI chat and ask it to interact with your Trunx account. Cursor will automatically discover and use the available tools.


Setup with any MCP client

Any client that supports the Streamable HTTP transport can connect to Trunx.

SettingValue
Endpointhttps://api.trunx.io/mcp
TransportStreamable HTTP
AuthAuthorization: Bearer tk_live_... header
MethodPOST

Programmatic connection (TypeScript)

import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";

const client = new Client({ name: "my-agent", version: "1.0.0" });

await client.connect(
  new StreamableHTTPClientTransport(
    new URL("https://api.trunx.io/mcp"),
    {
      requestInit: {
        headers: {
          Authorization: "Bearer tk_live_your_key_here",
        },
      },
    }
  )
);

// List available tools
const { tools } = await client.listTools();
console.log(tools.map((t) => t.name));

// Call a tool
const result = await client.callTool({
  name: "list_dids",
  arguments: { limit: 5 },
});
console.log(result);

Available Tools

Trunx exposes 80+ MCP tools organized by domain. Here is a complete reference.

SMS

ToolDescriptionKey Parameters
send_smsSend an SMS messagefrom, to, message
get_sms_logsGet recent SMS message logslimit

Voice

ToolDescriptionKey Parameters
create_callInitiate an outbound voice call (inline prompt or agent)from, to, systemPrompt or agentId
get_call_historyGet recent call historylimit
get_callGet call details with live transcriptcallId
end_callEnd an active callcallId

AI Agents

ToolDescriptionKey Parameters
create_agentCreate an AI voice agentname, systemPrompt, voice
get_agentGet agent details with live statusagentId
list_agentsList all AI voice agents
update_agentUpdate agent configurationagentId, fields to update
delete_agentDelete an agentagentId
create_agent_callPlace a call using a pre-configured agentagentId, from, to
list_ai_callsList AI voice callsstatus
get_call_transcriptGet full call transcriptcallId
get_call_recordingGet recording URLcallId
get_call_analysisGet call analysis (duration, summary)callId

Voices

ToolDescriptionKey Parameters
list_voicesList available voices (built-in + cloned)
clone_voiceClone a voice from audioname, audioUrl
preview_voicePreview a voicevoiceId
delete_voiceDelete a cloned voicevoiceId

Knowledge Bases

ToolDescriptionKey Parameters
create_knowledgeCreate a knowledge base for RAGname
add_knowledge_sourceAdd a URL sourceknowledgeId, url
list_knowledgeList all knowledge bases
query_knowledgeTest RAG retrievalknowledgeId, query
delete_knowledgeDelete a knowledge baseknowledgeId

Agent Tools (HTTP)

ToolDescriptionKey Parameters
create_ultravox_toolCreate an HTTP tool agents can call mid-conversationname, url, method
get_ultravox_toolGet tool detailstoolId
list_ultravox_toolsList all HTTP tools
update_ultravox_toolUpdate a tooltoolId, fields to update
delete_ultravox_toolDelete a tooltoolId
test_ultravox_toolTest a tool with sample inputtoolId

DIDs (Phone Numbers)

ToolDescriptionKey Parameters
list_didsList owned DIDs with health scoreslimit, offset
search_didsSearch available numbers by area codeareaCode
purchase_didsPurchase phone numbersnumbers
release_didsRelease numbers back to carriernumbers
configure_didConfigure webhook URLs for a DIDnumber, voiceUrl, smsUrl

DID Health

ToolDescriptionKey Parameters
did_healthGet health score and state for DIDsnumber
cool_down_didPull a DID from rotation temporarilynumber
activate_didReturn a cooled DID to active rotationnumber
burn_didPermanently remove a DID from rotationnumber

Campaigns

ToolDescriptionKey Parameters
create_campaignCreate an outbound dialing campaignname, mode, callerIds
add_prospectsAdd phone numbers to a campaigncampaignId, numbers
start_campaignStart dialingcampaignId
pause_campaignPause an active campaigncampaignId
resume_campaignResume a paused campaigncampaignId
cancel_campaignCancel a campaigncampaignId
campaign_statsGet real-time statscampaignId
list_campaignsList all campaignslimit, offset

IVR

ToolDescriptionKey Parameters
create_ivrCreate an IVR menu treename, definition
list_ivrsList all IVR definitions
delete_ivrDelete an IVRivrId
assign_ivr_to_didBind an IVR to a phone numbernumber, ivrId

Audio

ToolDescriptionKey Parameters
generate_audioGenerate TTS audio (ElevenLabs)text, voice

Compliance (DNC)

ToolDescriptionKey Parameters
add_to_dncAdd number to Do Not Call listnumber
check_dncCheck if number is suppressednumber

Reputation

ToolDescriptionKey Parameters
check_reputationCheck external reputation for a DIDnumber
trigger_reputation_auditAudit all active DIDs
list_reputationList DIDs with reputation scores

10DLC Compliance

ToolDescriptionKey Parameters
register_brandRegister a 10DLC brandname, ein, etc.
list_brandsList registered brands
update_brandUpdate brand detailsbrandId
delete_brandDelete a brandbrandId
get_brand_feedbackGet verification failure feedbackbrandId
get_brand_qualificationGet qualified use casesbrandId
apply_brand_vettingApply for external vettingbrandId
get_brand_vettingsGet vetting recordsbrandId
create_10dlc_campaignCreate a 10DLC campaignbrandId, usecase
update_10dlc_campaignUpdate a declined campaigncampaignId
nudge_campaignNudge for MNO reviewcampaignId
expedite_campaignRequest expedited vetting ($50)campaignId
get_campaign_carrier_detailsGet carrier qualification detailscampaignId
assign_campaign_didsAssign DIDs to 10DLC campaigncampaignId, numbers
remove_campaign_didsRemove DIDs from campaigncampaignId, numbers
delete_10dlc_campaignDeactivate a campaigncampaignId

Billing

ToolDescriptionKey Parameters
usage_summaryCurrent period usage breakdown
billing_portalGet Stripe billing portal URL

Webhooks

ToolDescriptionKey Parameters
register_webhookRegister a webhook endpointurl, events
list_webhooksList webhook endpoints
delete_webhookDelete a webhookwebhookId

API Keys

ToolDescriptionKey Parameters
create_api_keyCreate a new API key (shown once)name, scopes
list_api_keysList API keys (masked)
revoke_api_keyRevoke an API keykeyId

Example Conversations

These examples show the tool calls an AI agent makes behind the scenes when you interact with it in natural language.

Send an SMS

You: Text +14155551234 that their order has shipped.

Agent calls: send_sms({
  "from": "+19499905899",
  "to": "+14155551234",
  "message": "Your order has shipped! You'll receive tracking info shortly."
})
→ { "id": "sms_abc123", "status": "queued", "messageId": "SM..." }

Agent: Done — I sent the shipping notification to +14155551234.
       Message ID: sms_abc123, status: queued.

Make an AI voice call

You: Call +14155551234 and remind them about their appointment
     tomorrow at 3pm. Be friendly and confirm if they can make it.

Agent calls: create_call({
  "from": "+19499905899",
  "to": "+14155551234",
  "systemPrompt": "You are a friendly receptionist calling to remind
    the customer about their appointment tomorrow at 3:00 PM.
    Confirm whether they can make it or need to reschedule.
    Be warm and professional.",
  "voice": "terrence",
  "firstSpeaker": "agent"
})
→ { "callId": "call_xyz789", "status": "ringing" }

Agent: I'm calling +14155551234 now with an AI agent that will remind
       them about tomorrow's 3 PM appointment and confirm attendance.
       Call ID: call_xyz789.

Launch a campaign

You: I need to run a calling campaign to 500 leads in the 949 area
     code. Use our "appointment setter" agent and health-based DID
     selection.

Agent calls: list_agents({})
→ { "agents": [{ "id": "agent_apt01", "name": "appointment-setter", ... }] }

Agent calls: create_campaign({
  "name": "949 Appointment Outreach",
  "agentId": "agent_apt01",
  "callerIds": ["949"],
  "callerIdStrategy": "health_score"
})
→ { "id": "camp_abc123", "status": "created" }

Agent calls: add_prospects({
  "campaignId": "camp_abc123",
  "numbers": ["+19491234567", "+19492345678", "..."]
})
→ { "added": 500 }

Agent calls: start_campaign({ "campaignId": "camp_abc123" })
→ { "status": "active" }

Agent: Campaign "949 Appointment Outreach" is now dialing. 500
       prospects loaded, using the appointment-setter agent with
       health-score-based caller ID selection in the 949 area code.

API Key Scopes

MCP tools inherit the scopes of the API key used to authenticate. If a tool requires a scope your key does not have, the call returns a 403 Forbidden error.

ScopeTools Covered
sms:sendsend_sms
sms:readget_sms_logs
voice:callcreate_call, create_agent_call, end_call
voice:readget_call_history, get_call, get_call_transcript, get_call_recording, get_call_analysis, list_ai_calls
dids:readlist_dids, did_health, search_dids
dids:writepurchase_dids, release_dids, configure_did, cool_down_did, activate_did, burn_did
campaigns:readlist_campaigns, campaign_stats
campaigns:writecreate_campaign, add_prospects, start_campaign, pause_campaign, resume_campaign, cancel_campaign
ivr:readlist_ivrs
ivr:writecreate_ivr, delete_ivr, assign_ivr_to_did
agents:readlist_agents, get_agent, list_voices
agents:writecreate_agent, update_agent, delete_agent, clone_voice, delete_voice
compliance:readcheck_dnc, list_brands, list_reputation
compliance:writeadd_to_dnc, register_brand, create_10dlc_campaign, and other 10DLC tools
billing:readusage_summary, billing_portal
webhooks:readlist_webhooks
webhooks:writeregister_webhook, delete_webhook
keys:writecreate_api_key, revoke_api_key
keys:readlist_api_keys
*All tools (default scope for new keys)

New API keys are created with ["*"] scope by default, which grants access to all tools. For production, create keys with only the scopes your agent needs.


Troubleshooting

Connection refused or timeout

  • Verify the endpoint URL is exactly https://api.trunx.io/mcp
  • Ensure your client supports the Streamable HTTP transport (not SSE-only or stdio)
  • Check that your network allows outbound HTTPS connections

Authentication errors (401)

  • Confirm your API key starts with tk_live_ or tk_test_
  • Make sure the Authorization header is formatted as Bearer tk_live_... (with a space after "Bearer")
  • Check that the key has not been revoked in the dashboard

Tool not found

  • Trunx tools are registered server-side — your client discovers them automatically via tools/list
  • If tools are not appearing, restart your MCP client to force a fresh connection
  • Ensure you are on a recent version of your MCP client that supports Streamable HTTP

Permission denied (403)

  • The API key is valid but missing the required scope for that tool
  • Check the scopes table above and update your key's scopes in the dashboard
  • Keys with ["*"] scope have access to all tools

Tool call returns an error

  • MCP tools return the same error format as the REST API — check the error field in the response
  • Common causes: invalid phone number format (must be E.164 like +14155551234), missing required parameters, or referencing a resource that does not exist

MCP tools execute real actions. Calling send_sms sends a real text message, purchase_dids provisions real phone numbers, and start_campaign begins dialing. Use test keys and numbers during development.

On this page