MCP Server

The AgentPhone MCP Server lets your AI agent buy phone numbers, send/receive SMS, and place voice calls — all through natural language in Cursor, Claude Desktop, Windsurf, or any MCP-compatible client.

npm

Your AI Assistant ⟷ agentphone-mcp (local) ⟷ AgentPhone API ⟷ Phone Network

The MCP server is a thin, stateless bridge that translates MCP tool calls into AgentPhone API requests. All state (numbers, calls, messages) lives on the AgentPhone platform.

Quick start

1. Get your API key

Sign up at agentphone.to and create an API key from Settings.

2. Add to your AI client

Add the following to your MCP configuration:

Cursor: Settings > MCP or ~/.cursor/mcp.json Claude Desktop: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)

1{
2 "mcpServers": {
3 "agentphone": {
4 "command": "npx",
5 "args": ["-y", "agentphone-mcp"],
6 "env": {
7 "AGENTPHONE_API_KEY": "your_api_key_here",
8 "AGENTPHONE_BASE_URL": "https://api.agentphone.to"
9 }
10 }
11 }
12}

You can also clone the repo and run the built server directly with node dist/index.js.

3. Start using it

Once configured, ask your AI agent things like:

  • “Buy me a US phone number”
  • “Show me my recent calls and transcripts”
  • “Call +14155551234 and have a conversation about scheduling a dentist appointment”
  • “Create an agent called Support Bot and give it a number”
  • “Show me the latest SMS messages”
  • “Set up a webhook to receive inbound messages”

Environment variables

VariableRequiredDescription
AGENTPHONE_API_KEYYesYour AgentPhone API key
AGENTPHONE_BASE_URLNoOverride the API base URL (defaults to production)

Available tools

Phone Numbers

ToolDescriptionParameters
list_numbersList all phone numbers in your accountlimit (1-100, default: 20)
buy_numberPurchase a new phone numbercountry (2-letter ISO code, default: “US”), agent_id (optional)
release_numberRelease a phone number (irreversible)number_id

SMS

ToolDescriptionParameters
get_messagesGet SMS messages for a phone numbernumber_id, limit (1-200, default: 50)
list_conversationsList SMS conversations across all numberslimit (1-100, default: 20)
get_conversationGet a conversation with full message historyconversation_id, message_limit (1-100, default: 50)

Voice Calls

ToolDescriptionParameters
list_callsList recent calls (inbound and outbound)limit (1-100, default: 20)
get_callGet call details and transcriptcall_id
make_callPlace an outbound call (uses your webhook for responses)agent_id, to_number (E.164), initial_greeting (optional)
make_conversation_callPlace a call with a built-in AI conversation on a topic you defineagent_id, to_number (E.164), topic, initial_greeting (optional)

make_call forwards speech to your webhook for processing. make_conversation_call uses a built-in LLM so the AI can hold a full conversation autonomously — no webhook setup needed.

Agents

ToolDescriptionParameters
list_agentsList all agents in your accountlimit (1-100, default: 20)
create_agentCreate a new agentname, description (optional)
get_agentGet agent details and attached numbersagent_id
attach_numberAssign a phone number to an agentagent_id, number_id

Webhooks

ToolDescriptionParameters
get_webhookGet the currently configured webhook endpoint
set_webhookSet a webhook URL for inbound eventsurl, context_limit (0-50, optional)
delete_webhookRemove the currently configured webhook

Development

$git clone https://github.com/AgentPhone-AI/agentphone-mcp.git
$cd agentphone-mcp
$npm install
$npm run dev # Run with tsx (hot reload)
$npm run build # Compile TypeScript
$npm start # Run compiled JS

npm

The package is published as agentphone-mcp on npm.

$npm install -g agentphone-mcp