Back to build guides
Integration4 min read· Nov 18, 2026

Give your Cursor agent a phone number

Add the AgentPhone MCP server to Cursor with one JSON block and the agent in Composer can buy numbers, send texts and place calls. Works with OAuth or an API key, in the editor and in Cloud Agents.

AgentPhone TeamFounders
Give your Cursor agent a phone number

Cursor's agent can already run commands and edit across the repo. Point it at the AgentPhone MCP server and it can also provision a phone number for the app you are building, send a test message to your own phone, and read the reply back into the chat. Setup is a JSON block; the interesting part is what you do with it.

Setup

Cursor reads MCP servers from .cursor/mcp.json in the project or ~/.cursor/mcp.json for everything. The hosted server needs only a URL.

json
{
"mcpServers": {
"agentphone": {
"url": "https://mcp.agentphone.ai/mcp",
"headers": { "Authorization": "Bearer ${env:AGENTPHONE_API_KEY}" }
}
}
}

Cursor expands ${env:NAME} from your environment, so the key stays out of the file. Drop the headers block entirely to use browser sign-in; Cursor handles OAuth with PKCE by default and opens a window the first time a tool is called.

If you prefer a local process, the npm package works too:

json
{
"mcpServers": {
"agentphone": {
"command": "npx",
"args": ["-y", "agentphone-mcp"],
"env": { "AGENTPHONE_API_KEY": "${env:AGENTPHONE_API_KEY}" }
}
}
}

Restart Cursor, open Settings → MCP, and check that agentphone lists its tools. account_overview should be among them.

What to try first

The phone numbers in the examples are placeholders from the reserved 555 range. Replace each with the number you actually mean: your own mobile for the text test, the real business for a call.

In Composer or Chat:

“Create an agent called Support Bot, buy it a US number, and text my phone +1 415 555 0123 to confirm it works.”

Cursor will call create_agent, buy_number (which asks you to confirm, since it spends $3), attach_number and send_message, then show the message ID. Reply from your phone and ask Cursor to read the conversation.

Other things that are useful while building:

  • "Set my project webhook to the ngrok URL and send a test event" to exercise your inbound handler.
  • "List my recent calls and show the transcript of the last one."
  • "What voices are available, and switch the agent to a British one."

Cloud Agents and skills

Cursor's Cloud Agents run away from your machine, so a local stdio server is not available there. Use the hosted URL with an API key header, which is why the first JSON block above is the one to commit. Skills in ~/.cursor/skills/ sync to Cloud Agents; the AgentPhone skill installs with npx skills add AgentPhone-AI/skills and gives the agent the REST reference as a /agentphone command alongside the MCP tools.

Things to know

  • The first number and about 100 one-segment texts fit inside the $5 signup credit. Outbound calls need a paid balance.
  • Inbound SMS works right away. Outbound SMS on a US number needs 10DLC registration, which we submit for you from the dashboard.
  • Buying a number asks for confirmation, so the agent cannot buy ten by accident. Sends and calls run as soon as the tool is called.

FAQ

Where does the config file go? .cursor/mcp.json in the project for one repo, or ~/.cursor/mcp.json to make the server available everywhere. Both accept the same mcpServers block.

Do I have to put my API key in the file? No. Use ${env:AGENTPHONE_API_KEY} and Cursor reads it from your environment, or leave the headers out and sign in through the browser when the first tool runs.

Does it work in Cursor Cloud Agents? Yes, with the hosted URL and a bearer header. Cloud Agents cannot run a local npx server, so use the remote form of the config.

What can the agent actually do? Buy and attach numbers, send and read messages, watch for replies, place and review calls, manage agents and voices, set webhooks and check usage. 28 tools in total.

How much does it cost to try? $5 of free credit on signup, no card. A number is $3 a month and SMS is $0.02 a segment.

Ready to give your AI Agent a phone number?