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

Give your Replit Agent a phone number

Replit Agent connects to remote MCP servers from Settings, no config file. Add AgentPhone there and the agent can provision a number for the app it is building, send texts and place calls while you watch.

AgentPhone TeamFounders
Give your Replit Agent a phone number

Replit Agent builds and deploys whole apps from a prompt, and since late 2025 it can connect to custom MCP servers. There is no file to edit; the connection lives in your Replit settings and the agent uses it in any project. The hosted AgentPhone server is exactly the kind of remote HTTPS endpoint Replit expects, so setup is a form.

Setup

  1. 1Open Settings → Integrations → Your integrations.
  2. 2Choose Add custom, then Add personal MCP server (or a workspace server if you want teammates to share it).
  3. 3Display name: AgentPhone. HTTPS endpoint: https://mcp.agentphone.ai/mcp.
  4. 4Under Advanced settings, add a custom header: Authorization with the value Bearer sk_live_.... Or leave headers empty and let Replit walk you through the OAuth sign-in when you test.
  5. 5Click Test & save. The test should list tools including account_overview.

Replit only supports remote servers, which suits the hosted endpoint. The local npm package is not an option here, and does not need to be.

What to ask the agent

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.

Replit Agent is at its best building a product, so the useful prompts are about the app:

“Add SMS order updates to this store. Create an AgentPhone agent, buy a US number, and write a server route that calls POST /v1/messages when an order ships. Text my phone +1 415 555 0123 a test message.”

The agent uses the MCP tools for the account work (create agent, buy number, attach), then writes application code against the REST API for the runtime behaviour, which is the right split. Your deployed app should talk to the API with its own key stored in Replit Secrets, not through the agent's MCP connection.

Other prompts that work well:

  • "Set the AgentPhone webhook to this app's /webhook route and send a test event, then handle inbound messages by replying with the order status."
  • "Make the support bot answer calls in hosted mode with this system prompt."

The runtime side

Inside the app, two calls cover most of it. Sending:

js
await fetch("https://api.agentphone.ai/v1/messages", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.AGENTPHONE_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({ number_id: process.env.AGENTPHONE_NUMBER_ID, to_number: customer.phone, body: `Order ${order.id} shipped.` }),
});

Receiving: a POST route that verifies X-Webhook-Signature (an HMAC over {X-Webhook-Timestamp}.{raw body} with your webhook secret) and reads data.message, data.from and recentHistory from the agent.message event.

Things to know

  • The $5 signup credit covers the first number and about 100 inbound or outbound segments for testing. A number is $3 a month, SMS $0.02 a segment.
  • Inbound works right away. Outbound SMS from a US number needs 10DLC registration, submitted by us from the dashboard. Plan for one to three business days of carrier approval before launch.
  • Keep the agent's MCP key and the app's runtime key separate. The agent's can buy numbers; the app's only needs to send and read.

FAQ

Does Replit support a local MCP server? No. Replit Agent connects to remote HTTPS endpoints only, which is what the hosted AgentPhone server at mcp.agentphone.ai is.

Where do I put the API key? For the agent, in the custom header on the MCP integration (or use OAuth). For the deployed app, in Replit Secrets as AGENTPHONE_API_KEY, read by your server code.

Can the app the agent builds receive texts? Yes. Expose a POST route, set it as the AgentPhone webhook, and every inbound message arrives as an agent.message event with the conversation history.

How much does it cost to try? For receiving, nothing beyond the $5 signup credit: a $3 number and about 100 messages. Sending SMS from a US number adds 10DLC registration at $25 for a sole proprietor or standard brand, and outbound calls need a paid balance.

Does the agent need 10DLC before it can text? Receiving, no. Sending from a US number, yes; we submit the registration for you and carrier approval usually takes one to three business days.

Ready to give your AI Agent a phone number?