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.jsonOn Windows:
%APPDATA%\Claude\claude_desktop_config.jsonAdd 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.
| Setting | Value |
|---|---|
| Endpoint | https://api.trunx.io/mcp |
| Transport | Streamable HTTP |
| Auth | Authorization: Bearer tk_live_... header |
| Method | POST |
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
| Tool | Description | Key Parameters |
|---|---|---|
send_sms | Send an SMS message | from, to, message |
get_sms_logs | Get recent SMS message logs | limit |
Voice
| Tool | Description | Key Parameters |
|---|---|---|
create_call | Initiate an outbound voice call (inline prompt or agent) | from, to, systemPrompt or agentId |
get_call_history | Get recent call history | limit |
get_call | Get call details with live transcript | callId |
end_call | End an active call | callId |
AI Agents
| Tool | Description | Key Parameters |
|---|---|---|
create_agent | Create an AI voice agent | name, systemPrompt, voice |
get_agent | Get agent details with live status | agentId |
list_agents | List all AI voice agents | — |
update_agent | Update agent configuration | agentId, fields to update |
delete_agent | Delete an agent | agentId |
create_agent_call | Place a call using a pre-configured agent | agentId, from, to |
list_ai_calls | List AI voice calls | status |
get_call_transcript | Get full call transcript | callId |
get_call_recording | Get recording URL | callId |
get_call_analysis | Get call analysis (duration, summary) | callId |
Voices
| Tool | Description | Key Parameters |
|---|---|---|
list_voices | List available voices (built-in + cloned) | — |
clone_voice | Clone a voice from audio | name, audioUrl |
preview_voice | Preview a voice | voiceId |
delete_voice | Delete a cloned voice | voiceId |
Knowledge Bases
| Tool | Description | Key Parameters |
|---|---|---|
create_knowledge | Create a knowledge base for RAG | name |
add_knowledge_source | Add a URL source | knowledgeId, url |
list_knowledge | List all knowledge bases | — |
query_knowledge | Test RAG retrieval | knowledgeId, query |
delete_knowledge | Delete a knowledge base | knowledgeId |
Agent Tools (HTTP)
| Tool | Description | Key Parameters |
|---|---|---|
create_ultravox_tool | Create an HTTP tool agents can call mid-conversation | name, url, method |
get_ultravox_tool | Get tool details | toolId |
list_ultravox_tools | List all HTTP tools | — |
update_ultravox_tool | Update a tool | toolId, fields to update |
delete_ultravox_tool | Delete a tool | toolId |
test_ultravox_tool | Test a tool with sample input | toolId |
DIDs (Phone Numbers)
| Tool | Description | Key Parameters |
|---|---|---|
list_dids | List owned DIDs with health scores | limit, offset |
search_dids | Search available numbers by area code | areaCode |
purchase_dids | Purchase phone numbers | numbers |
release_dids | Release numbers back to carrier | numbers |
configure_did | Configure webhook URLs for a DID | number, voiceUrl, smsUrl |
DID Health
| Tool | Description | Key Parameters |
|---|---|---|
did_health | Get health score and state for DIDs | number |
cool_down_did | Pull a DID from rotation temporarily | number |
activate_did | Return a cooled DID to active rotation | number |
burn_did | Permanently remove a DID from rotation | number |
Campaigns
| Tool | Description | Key Parameters |
|---|---|---|
create_campaign | Create an outbound dialing campaign | name, mode, callerIds |
add_prospects | Add phone numbers to a campaign | campaignId, numbers |
start_campaign | Start dialing | campaignId |
pause_campaign | Pause an active campaign | campaignId |
resume_campaign | Resume a paused campaign | campaignId |
cancel_campaign | Cancel a campaign | campaignId |
campaign_stats | Get real-time stats | campaignId |
list_campaigns | List all campaigns | limit, offset |
IVR
| Tool | Description | Key Parameters |
|---|---|---|
create_ivr | Create an IVR menu tree | name, definition |
list_ivrs | List all IVR definitions | — |
delete_ivr | Delete an IVR | ivrId |
assign_ivr_to_did | Bind an IVR to a phone number | number, ivrId |
Audio
| Tool | Description | Key Parameters |
|---|---|---|
generate_audio | Generate TTS audio (ElevenLabs) | text, voice |
Compliance (DNC)
| Tool | Description | Key Parameters |
|---|---|---|
add_to_dnc | Add number to Do Not Call list | number |
check_dnc | Check if number is suppressed | number |
Reputation
| Tool | Description | Key Parameters |
|---|---|---|
check_reputation | Check external reputation for a DID | number |
trigger_reputation_audit | Audit all active DIDs | — |
list_reputation | List DIDs with reputation scores | — |
10DLC Compliance
| Tool | Description | Key Parameters |
|---|---|---|
register_brand | Register a 10DLC brand | name, ein, etc. |
list_brands | List registered brands | — |
update_brand | Update brand details | brandId |
delete_brand | Delete a brand | brandId |
get_brand_feedback | Get verification failure feedback | brandId |
get_brand_qualification | Get qualified use cases | brandId |
apply_brand_vetting | Apply for external vetting | brandId |
get_brand_vettings | Get vetting records | brandId |
create_10dlc_campaign | Create a 10DLC campaign | brandId, usecase |
update_10dlc_campaign | Update a declined campaign | campaignId |
nudge_campaign | Nudge for MNO review | campaignId |
expedite_campaign | Request expedited vetting ($50) | campaignId |
get_campaign_carrier_details | Get carrier qualification details | campaignId |
assign_campaign_dids | Assign DIDs to 10DLC campaign | campaignId, numbers |
remove_campaign_dids | Remove DIDs from campaign | campaignId, numbers |
delete_10dlc_campaign | Deactivate a campaign | campaignId |
Billing
| Tool | Description | Key Parameters |
|---|---|---|
usage_summary | Current period usage breakdown | — |
billing_portal | Get Stripe billing portal URL | — |
Webhooks
| Tool | Description | Key Parameters |
|---|---|---|
register_webhook | Register a webhook endpoint | url, events |
list_webhooks | List webhook endpoints | — |
delete_webhook | Delete a webhook | webhookId |
API Keys
| Tool | Description | Key Parameters |
|---|---|---|
create_api_key | Create a new API key (shown once) | name, scopes |
list_api_keys | List API keys (masked) | — |
revoke_api_key | Revoke an API key | keyId |
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.
| Scope | Tools Covered |
|---|---|
sms:send | send_sms |
sms:read | get_sms_logs |
voice:call | create_call, create_agent_call, end_call |
voice:read | get_call_history, get_call, get_call_transcript, get_call_recording, get_call_analysis, list_ai_calls |
dids:read | list_dids, did_health, search_dids |
dids:write | purchase_dids, release_dids, configure_did, cool_down_did, activate_did, burn_did |
campaigns:read | list_campaigns, campaign_stats |
campaigns:write | create_campaign, add_prospects, start_campaign, pause_campaign, resume_campaign, cancel_campaign |
ivr:read | list_ivrs |
ivr:write | create_ivr, delete_ivr, assign_ivr_to_did |
agents:read | list_agents, get_agent, list_voices |
agents:write | create_agent, update_agent, delete_agent, clone_voice, delete_voice |
compliance:read | check_dnc, list_brands, list_reputation |
compliance:write | add_to_dnc, register_brand, create_10dlc_campaign, and other 10DLC tools |
billing:read | usage_summary, billing_portal |
webhooks:read | list_webhooks |
webhooks:write | register_webhook, delete_webhook |
keys:write | create_api_key, revoke_api_key |
keys:read | list_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_ortk_test_ - Make sure the
Authorizationheader is formatted asBearer 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
errorfield 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.