Agents

Claude Code + AgentLine

Claude Code

Let Claude Code make phone calls

How do I let Claude Code make phone calls?

Connect Claude Code to the AgentLine MCP server with one command, then ask it to get a number and call. Plans start at $20 a month and include a US or Canada number and 100 minutes; extra minutes are $0.12. Claude Code starts the call, AgentLine's hosted voice talks, and Claude Code reads the transcript.

  1. 01

    Get an API key at https://agentline.cloud/signup, choose a plan, and export the key.

    bash
    export AGENTLINE_API_KEY="al_live_..."
  2. 02

    Add the AgentLine MCP server to Claude Code.

    bash
    claude mcp add agentline -- npx -y mcp-remote@latest https://api.agentline.cloud/mcp --header "Authorization: Bearer $AGENTLINE_API_KEY"
  3. 03

    Ask Claude Code: "Get yourself a phone number and call me at +1..."

A simple outbound call does not need the relay. Claude Code places the call through the MCP server, AgentLine's hosted voice agent holds the conversation, and Claude Code reads the transcript afterwards. The relay is for live in-session call turns: inbound calls and mid-call lookups while someone is still on the line. Calls beyond your plan are $0.12 a minute, billed per second after a one-minute minimum. The same number can send and receive SMS through the REST API at $0.02 a message.

Get an API key

One skill file

The steps above are the shortest path: an API key, one command, then ask Claude Code to call. Point it at https://agentline.cloud/skill.md when you want it to follow the full skill.

text
Get yourself a phone number and call me. Follow https://agentline.cloud/skill.md

Why give Claude Code a phone number

MCP or skill, your choice

Use the skill file for Claude Code, or https://api.agentline.cloud/mcp with a bearer header. Same API underneath.

Calls from the repo you are already in

Claude Code can create the agent, buy a number, and dial as part of the same session that writes your app.

Templates included

Open any template on this site and paste the prompt. Claude Code will apply it to a new AgentLine agent.

Set up Claude Code

How the skill and the service land on this runtime.

1. Add the MCP server

Registers AgentLine as a Claude Code MCP server. This is the same command as in the steps above. After it, buying a number, placing a call, and reading the transcript are normal tool uses.

bash
claude mcp add agentline -- npx -y mcp-remote@latest https://api.agentline.cloud/mcp --header "Authorization: Bearer $AGENTLINE_API_KEY"

2. Install the relay service

Not required for a simple outbound call. Install it on the machine where the Claude Code CLI is installed and authenticated when you want live call turns in the session: inbound calls and mid-call lookups while someone is still on the line. Replace agt_xxx with your agent ID.

bash
python -c "import urllib.request; urllib.request.urlretrieve('https://api.agentline.cloud/static/agentline_relay.py','agentline_relay.py')"
python agentline_relay.py install --agent-id agt_xxx --runtime claude-code

Make a first phone call from Claude Code

Guide updated

Before you start

  • An AgentLine account with an API key, an active US or Canada number and available plan allowance or wallet credit. Check current terms on the pricing page.
  • A destination number you control for the first test, plus a short approved instruction for the hosted phone agent.
  • Claude Code with permission to use the AgentLine MCP server or read the skill and run API requests. This guide covers Claude Code, not the Claude web app.

1. Confirm the connection

Add the MCP server using the setup command, then ask Claude Code to list the available AgentLine tools and check your account. If your client uses the skill instead, let it read the current API instructions before making changes.

2. Prepare the hosted phone agent

Ask Claude Code to create a phone agent with a short greeting and a complete system prompt. Review the prompt and number cost before provisioning. Reuse your existing number when testing an existing agent.

3. Call and inspect the result

Ask: Call my test number using this agent, introduce yourself, ask which callback time I prefer, then retrieve the final status and transcript. Supply your number privately and verify the time in the transcript.

4. Connect live tools only when needed

Add the relay if the caller needs a lookup or task in your running Claude Code environment. Return short facts for that request; AgentLine hosts the voice conversation.

Check the result

  • Keep the agent ID, assigned number and call ID. A successful create-call response means the call was requested, not that someone answered.
  • Check the final call status and transcript. Compare the transcript with the task you asked the phone agent to complete.
  • For a booking, payment or other external action, check the destination system too. Spoken agreement is not proof that a calendar or database was updated.

Troubleshooting

Tools are missing or authentication fails
Check that the MCP connection is enabled in this client and that AGENTLINE_API_KEY is available to its process. Do not paste your key into a public prompt or example.
The call works but live lookups do not
Test the relay or webhook separately. The hosted phone agent can speak without your runtime; live tools require a reachable, authenticated integration. Follow the skill for call.utterance and turn-scoped context replies.

Related guides

FAQ

How do I let Claude Code make phone calls?

Get an AgentLine API key, run claude mcp add agentline -- npx -y mcp-remote@latest https://api.agentline.cloud/mcp --header "Authorization: Bearer $AGENTLINE_API_KEY", then ask Claude Code: "Get yourself a phone number and call me at +1...". Plans start at $20 a month with a US or Canada number and 100 minutes included; calls beyond the plan are $0.12 a minute.

Do I need a Twilio account?

No. AgentLine provisions the US or Canada number, places the call, runs the voice and transcribes it. Claude Code only needs an AgentLine API key.

Can Claude Code receive calls and text messages?

Yes. The number answers inbound calls with the hosted voice agent, and Claude Code can read the transcripts. Texts to and from the same number go through the REST API (POST /v1/messages) at $0.02 a message beyond the plan allowance; the MCP server covers calls, numbers and transcripts.

Does AgentLine work with Claude Code?

Yes. Add the skill or the MCP server, set AGENTLINE_API_KEY, and ask Claude Code to buy a number and call you.

What does the MCP server expose?

Twenty-plus tools: create_agent, buy numbers, make_outbound_call, push_call_context, transcripts, webhooks, and billing.

Can I use the SDK alongside MCP?

Yes. Use the Python SDK or call the REST API from Node.js in production services Claude Code generates. MCP exposes the same service as tools in your agent environment.

Clone a template next