Sandbox
@AgentLineHQ/AgentLine

Phone API and MCP server for AI voice agents

AgentLine gives your agent a real phone number, call control, SMS, transcripts, and IVR handling through REST and MCP. It uses FastAPI with SignalWire for telephony and Deepgram for speech-to-text, and it can run self-hosted or as a hosted service.

40 stars3 forksPythonUpdated 20d ago
Who it's for

Builders who want Claude Code, Cursor, or another agent to make and receive real phone calls.

What it delivers

You can give your agent a phone number and let it handle calls, SMS, and transcripts from one API.

What it does

Outbound and inbound calls

Place real PSTN calls and answer incoming calls through the API.

SMS handling

Receive and list inbound text messages.

IVR and DTMF

Send real touch-tone digits so agents can navigate phone menus and leave voicemail.

MCP server

Expose telephony actions as MCP tools for Claude Desktop, Claude Code, Cursor, Codex, and other clients.

Skill file

Provide a reusable skill at `skills/agentline/SKILL.md` for agent runtimes that support skill installs.

Transcripts and call history

Store full call transcripts and history for later review.

Self-hosted stack

Run the API with Docker Compose, PostgreSQL, and Redis.

Per-agent webhooks and event mailbox

Send signed webhook events or poll a durable mailbox when a live relay is not available.

How to get it

  1. 1Run
    git clone https://github.com/agentlineHQ/AgentLine.git
    cd AgentLine
    cp .env.example .env
    # Fill in your API keys in .env (see Configuration below)
    docker-compose up -d
  2. 2Run
    git clone https://github.com/agentlineHQ/AgentLine.git
    cd AgentLine
    python -m venv venv
    source venv/bin/activate  # or venv\Scripts\activate on Windows
    pip install -r requirements.txt
    cp .env.example .env
    # Fill in your API keys
    uvicorn agentline.main:app --reload
  3. 3AgentLine ships with a skill file that lets any AI agent gain telephony powers instantly
    https://agentline.cloud/skill.md

README

AgentLine Logo

AgentLine — Phone API for AI Voice Agents

Open-source AI phone agent platform — real phone numbers, outbound & inbound voice calls, SMS, MCP, and IVR

Give Claude, Cursor, OpenClaw, Hermes, or any LLM a real phone number. Make and receive PSTN calls, navigate phone menus, and read transcripts — one FastAPI, no telecom expertise.


License: MIT Python 3.12+ FastAPI MCP Compatible Docker Ready Discord


Website · Docs · Skill File · Discord



What is AgentLine?

AgentLine is an open-source AI phone agent / voice agent telephony API. It gives coding agents and LLM apps a real US phone number, a voice pipeline (STT + LLM + TTS), and the ability to place outbound calls, answer inbound calls, handle SMS, and walk IVR / DTMF menus — over REST or MCP.

Use it as a self-hosted alternative to stitching Twilio Programmable Voice + Deepgram + a voice LLM yourself, or as an open-source counterpart to hosted voice-agent products (Vapi, Retell, Bland).

Your AI Agent (Claude, Cursor, OpenClaw, Hermes, Codex)
        →  AgentLine REST / MCP
        →  Real PSTN phone calls, SMS, transcripts

Works with Claude Code, Claude Desktop, Cursor, OpenClaw, Hermes, Codex, and any MCP or HTTP client.

Why AgentLine?

AgentLineTwilio / VonageVapi / Retell
Built for AI agents✅ Phone number + voice pipeline❌ Call-center APIs, BYO AI✅ Hosted voice agents
MCP + skill file✅ Native❌ None❌ Rare
Self-host / MIT✅ Your keys, your data❌ Proprietary❌ Proprietary SaaS
SetupMinutesHours of stitchingMinutes, vendor lock-in
Outbound + inbound + SMSVaries

Use cases

  • AI receptionist — answer inbound calls with a custom greeting and system prompt
  • Outbound voice agent — reminders, follow-ups, feedback, and business inquiries
  • MCP telephony — “call this number” from Claude Code, Cursor, or OpenClaw
  • IVR navigation — press real DTMF keys on phone menus and leave voicemail
  • Owner task line — call your agent from a registered number and give it work to run after hangup

Features

  • 📞 Voice Calls — Make and receive real phone calls through a simple API
  • 🎙️ AI Voice Pipeline — Built-in STT (Deepgram) + LLM (GPT-4o) + TTS (Cartesia) pipeline
  • 🎛️ DTMF / IVR — Real touch-tone audio so outbound agents can navigate phone menus and leave voicemail
  • Semantic turn-taking — Adaptive end-of-turn detection with fast barge-in instead of a fixed pause
  • 👤 Owner task mode — Calls from a registered owner number capture instructions for later execution
  • 💬 SMS — Receive and read inbound text messages
  • 🔌 MCP Server — Native Model Context Protocol tools for Claude Desktop, Claude Code, Cursor, OpenClaw, and Codex
  • 📋 Skill File — One-file install for Claude Code, Cursor, OpenClaw, Hermes, and similar runtimes
  • 🌍 PSTN via SignalWire — US numbers, Twilio-compatible LaML, pluggable provider architecture
  • 📝 Transcripts — Automatic call transcription with full conversation history
  • 🔄 Persistent Agent Relay — outbound WebSocket with reconnect, ACK/replay, turn-safe context, and runtime-aware setup
  • 🪝 Per-agent webhooks — Signed JSON POSTs as a fallback when a relay cannot run
  • 📬 Event Mailbox — durable fallback for agents without a relay or webhook
  • 💰 Built-in Billing — Per-second call billing with balance tracking
  • 🐳 Docker Ready — One command to run the entire stack locally

Architecture

graph LR
    A["🤖 AI Agent"] -->|REST API / MCP| B["⚡ AgentLine API"]
    B -->|Provision Numbers| C["📱 SignalWire"]
    B -->|Speech-to-Text| D["🎤 Deepgram"]
    B -->|Text-to-Speech| E["🔊 Cartesia"]
    B -->|LLM Reasoning| F["🧠 OpenAI"]
    C -->|Voice & SMS| G["📞 PSTN Network"]
    B -->|Events & Transcripts| A

Voice Pipeline

Live calls stream audio over SignalWire <Connect><Stream>:

Caller audio → Deepgram STT → semantic turn-taking
  → hosted LLM (or live relay context) → Cartesia TTS → caller
  • Semantic turn-taking waits longer when the caller is mid-thought and answers immediately on a complete question.
  • Barge-in flushes playback as soon as the caller starts speaking.
  • DTMF turns [DTMF:1] markers into real touch-tone audio for IVR menus.
  • Relay mode (optional) pushes each caller turn to a local agent over an outbound WebSocket and speaks the returned context verbatim.

Quick Start

Option 1: Docker Compose (Recommended)

git clone https://github.com/agentlineHQ/AgentLine.git
cd AgentLine
cp .env.example .env
# Fill in your API keys in .env (see Configuration below)
docker-compose up -d

This starts:

  • API server at http://localhost:8000
  • PostgreSQL at localhost:5432 (schema auto-applied)
  • Redis at localhost:6379

Option 2: Local Development

git clone https://github.com/agentlineHQ/AgentLine.git
cd AgentLine
python -m venv venv
source venv/bin/activate  # or venv\Scripts\activate on Windows
pip install -r requirements.txt
cp .env.example .env
# Fill in your API keys
uvicorn agentline.main:app --reload

Option 3: Use the Hosted Version

Skip self-hosting — sign up at agentline.cloud and get an API key instantly.


Configuration

Copy .env.example to .env and fill in your credentials:

VariableRequiredDescription
SUPABASE_URLYesYour Supabase project URL
SUPABASE_ANON_KEYYesSupabase anonymous key
SUPABASE_SERVICE_ROLE_KEYYesSupabase service role key (server-side)
DATABASE_URLYesPostgreSQL connection string
SIGNALWIRE_PROJECT_IDYesSignalWire project ID
SIGNALWIRE_TOKENYesSignalWire API token
SIGNALWIRE_SPACE_URLYesYour SignalWire space URL
DEEPGRAM_API_KEYYesDeepgram API key (STT)
CARTESIA_API_KEYYesCartesia API key (TTS)
OPENAI_API_KEYYesOpenAI API key (LLM)
TURN_TAKING_MODELNoFast OpenAI-compatible model for end-of-turn detection (defaults to gpt-4o-mini)
REDIS_URLNoRedis URL (defaults to localhost:6379)
SECRET_KEYYesApp secret key
BASE_URLYesPublic URL of your deployment

API Reference

Once running, visit http://localhost:8000/docs for the interactive Swagger UI.

Core Endpoints

MethodPathDescription
POST/v1/agentsCreate a new AI voice agent
GET/v1/agentsList all agents
PATCH/v1/agents/{id}Update agent (prompt, voice, greeting)
POST/v1/numbersProvision a phone number
GET/v1/numbersList phone numbers
POST/v1/callsMake an outbound call
GET/v1/callsList calls
GET/v1/calls/{id}/transcriptGet call transcript
POST/v1/calls/{id}/hangupEnd an active call
POST/v1/calls/{id}/contextPush live relay context for a caller turn
GET/.well-known/agentline.jsonDiscover relay, webhook, and runtime setup
GET/v1/eventsPoll event mailbox (fallback)
WS/v1/events/wsPersistent outbound agent relay
GET/v1/events/peekPeek at events (non-destructive)
GET/POST/DELETE/v1/webhooksConfigure a per-agent signed webhook
GET/v1/messagesList SMS messages
GET/v1/billing/balanceCheck account balance
GET/v1/billing/expenditureSpending breakdown

Authentication

All requests require an API key (al_live_...; legacy sk_live_... keys are still accepted):

curl -H "Authorization: Bearer al_live_YOUR_KEY" \
     -H "Content-Type: application/json" \
     https://api.agentline.cloud/v1/agents

MCP Server Integration

AgentLine includes a built-in MCP (Model Context Protocol) server, so AI agents like Claude Desktop and Cursor can use telephony tools natively.

Connect from Claude Desktop

Add to your Claude Desktop config:

Windows: %APPDATA%\Claude\claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "agentline": {
      "command": "npx",
      "args": [
        "-y", "mcp-remote@latest",
        "http://localhost:8000/mcp",
        "--header", "Authorization: Bearer al_live_YOUR_KEY"
      ]
    }
  }
}

Available MCP Tools

ToolDescription
create_agentCreate a new AI voice agent
list_agentsList all agents
update_agentUpdate agent config/prompt/voice
make_outbound_callInitiate an outbound phone call
list_callsList call history
get_call_transcriptGet the full transcript of a call
hangup_callEnd an active call
push_call_contextPush live relay context for a caller turn
set_webhookCreate or replace a per-agent webhook
buy_phone_numberProvision a new phone number
list_phone_numbersList all phone numbers
poll_eventsPoll event mailbox
peek_eventsPeek at pending events
get_account_balanceCheck account balance
list_available_voicesList voice presets

Test with MCP Inspector

npx @modelcontextprotocol/inspector http://localhost:8000/mcp

Skill File — Install in 30 Seconds

AgentLine ships with a skill file that lets any AI agent gain telephony powers instantly:

https://agentline.cloud/skill.md

How to use:

  1. Copy the skill URL above
  2. Add it to your AI agent (Claude Code, Cursor, OpenClaw, etc.)
  3. Set your AGENTLINE_API_KEY environment variable
  4. Tell your agent: "Call +1234567890" — it just works!

The skill file is also included in this repo at skills/agentline/SKILL.md.


Tech Stack

ComponentTechnology
API FrameworkFastAPI (async Python)
DatabasePostgreSQL (Supabase)
CacheRedis
Phone Numbers & CallsSignalWire
Speech-to-TextDeepgram Nova-2
Text-to-SpeechCartesia Sonic
LLMOpenAI GPT-4o / GPT-4o-mini
MCP ServerFastAPI-MCP
DeploymentDocker, Railway

Deployment

Docker

docker build -t agentline .
docker run -p 8000:8000 --env-file .env agentline

Any Cloud Provider

AgentLine runs anywhere that supports Python 3.12+ and Docker: AWS, GCP, Azure, Fly.io, Render, Railway, etc.


Database Schema

The database schema is in schema.sql. It creates tables for:

  • accounts — User accounts with balance tracking
  • api_keys — Hashed API keys for authentication
  • agents — AI voice agent configurations
  • phone_numbers — Provisioned phone numbers
  • calls — Call records with transcripts
  • messages — SMS message records
  • event_mailbox — Server-side event queue
  • billing_ledger — Immutable billing transaction log

Migrations are in the migrations/ directory.


Pricing (Hosted Version)

If using the hosted version at agentline.cloud:

ItemCost
Voice calls (inbound/outbound)$0.10/min (billed per second)
Phone number$2.00 (one-time)
SMS (inbound)Free

Self-hosted: you pay only your provider costs (SignalWire, Deepgram, Cartesia, OpenAI).


Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.


Community

  • 💬 Discord — Chat with the team and other builders
  • 🐦 Twitter — Updates and announcements
  • 📖 Docs — Full API documentation
  • 📝 Blog — Guides and tutorials

License

MIT — use it for anything. Commercial use welcome.


Built with ❤️ by the AgentLine team

Give your AI agent a voice. ☎️

Files in the repo

Repository payload22 top-level entries
  • .github
  • agentline
  • migrations
  • skills
  • .env.example
  • .gitignore
  • agentline-logo-200.png
  • agentline-logo.png
  • claude_desktop_config_example.json
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • docker-compose.yml
  • Dockerfile
  • LICENSE
  • railway.toml
  • README.md
  • requirements.txt
  • schema.sql
  • SECURITY.md
  • test_dtmf.py
  • test_owner_mode.py
  • test_relay_protocol.py

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More connectors

Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface

86k

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

43k

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama…) with Codex CLI, App, SDK, and Claude Code

14k
okf-memory/
okf-agent-memory

Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.

547
tirth8205/
code-review-graph

Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.

31k
2akouwu/
reverify

Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.

1.1k