hail
Phone, SMS & email for AI agents. One remote MCP server (Streamable HTTP, OAuth or API-key auth, no local install) exposing call, sms, email, and event tools; also usable via CLI, Python SDK, and OpenAPI. Self-hostable, AGPLv3.
README
Hail
Universal communication platform for AI agents. Phone calls, SMS, email — outbound first, inbound next. Self-hostable. Open source (AGPLv3).
Your agent wants to place a call: "Call +1… and ask if they want to reschedule." Hail does the carrier glue, runs the voice pipeline, and lets the agent plug in its own brain (or fall back to OpenAI → Gemini → Claude).
Quickstart
git clone https://github.com/hail-hq/hail
cd hail
cp .env.example .env
# fill in Twilio, LiveKit Cloud, Deepgram, Cartesia, and one of OpenAI / Gemini / Anthropic
docker compose up
Authenticate:
- Hail Cloud (managed at hail.so):
hail loginruns the device-flow and saves an API key to~/.hail/credentials.json. - Self-host: seed an API key directly into your local stack — see docs/operations.md "First-run DB seed". Then export
HAIL_API_KEY(or pass--api-key).
Use it — CLI (for humans scripting Hail):
hail login # authenticate (device flow)
hail auth logout # remove local credentials
hail auth token # print bare API key for scripting
hail call +14155550100 --prompt "be brief"
hail call list
hail call tail <id> # follow events for one call
hail email send --to a@b.com --subject hi --body "hello"
hail email list
hail email get <id>
hail email tail <id> # follow events for one email
hail email raw <id> # RFC 5322 source
hail email attachment <id> <att-id> --output file.pdf
hail email domain register --kind hail_mail
hail email domain register --kind custom --domain acme.com # send + receive on your own domain
hail email domain list
hail tail # cross-channel event stream
hail tail call:<id> # narrow by resource type
hail mcp endpoint # Streamable HTTP URL for the MCP server
hail completion zsh # source <(hail completion zsh)
hail version
Or over HTTP / MCP:
# HTTP
curl -X POST http://localhost:8080/calls \
-H "Authorization: Bearer $HAIL_API_KEY" \
-d '{"to":"+15551234567","system_prompt":"..."}'
curl -X POST http://localhost:8080/emails \
-H "Authorization: Bearer $HAIL_API_KEY" \
-d '{"to":["alice@example.com"],"subject":"hi","body_text":"hello"}'
# MCP (for AI agents — Claude.ai, ChatGPT, Claude Code, Cursor, …)
# Add a remote MCP connector in your client pointing at:
# http://<your-host>:8081 (self-hosted)
# https://mcp.hail.so (Hail Cloud, later)
hail tail in action:

Full setup: docs/setup/twilio.md, docs/setup/livekit-cloud.md, docs/setup/aws-ses.md, docs/setup/mcp.md.
Tenets
- Clear comms. Explicit OpenAPI contracts. No magic.
- Simple code. Boring is best. No abstractions without two uses.
- Brief docs. One screen per page. Setup ≤ 10 minutes from a fresh clone.
- Self-hostable.
docker compose upruns everything except LiveKit Cloud. - Pluggable brain. BYO endpoint compatible with OpenAI's completions API, or use Hail's bundled fallback (OpenAI → Gemini → Anthropic). Voice pipeline + transport are always Hail's.
- Agent-first docs. AI agents are first-class readers. Lead with concrete, runnable examples; link to canonical sources (OpenAPI spec, MCP tool schemas, code paths) rather than paraphrase them. Every page should let a reader — human or agent — take the next action.
Milestones
Checked = shipped. Per-artifact changelogs (GitHub Releases for the CLI, PyPI release notes for the SDK) own the "shipped in which version" question.
Phone calls
- Outbound
- [x] Twilio
- [ ] Telnyx
- Inbound
- [ ] Twilio
SMS
- Outbound
- [ ] Twilio
- Inbound
- [ ] Twilio
- Outbound
- [x] AWS SES
- [x] Custom sender domains (own DNS, auto DKIM + MAIL FROM)
- Inbound
- [x] AWS SES
- [x] Custom domains (receive on verified domains)
Voice pipeline
- STT
- [x] Deepgram
- [ ] Whisper
- [ ] AssemblyAI
- TTS
- [x] Cartesia
- [x] ElevenLabs
- [ ] Deepgram Aura
- VAD
- [x] Silero
- Turn detection
- [x] LiveKit turn-detector
- LLM — system-prompt mode
- [x] Fallback: OpenAI → Gemini → Anthropic, fast models
- LLM — BYO-endpoint mode
- [x] OpenAI chat-completions-compatible
- Recording
- [ ] S3 upload
- [ ] Diarization
Distribution
- API
- [x] OpenAPI spec
- CLI
- [x]
hailbinary via GitHub Releases
- [x]
- MCP server
- [x] Remote Streamable HTTP endpoint bundled with every Hail deploy
PyPI stdio package— intentionally not shipped; see docs/setup/mcp.md
- Python SDK
- [x]
hail-sdkon PyPI, imports ashail
- [x]
Infrastructure
- [x] Docker Compose scaffold
- Self-hosted LiveKit SFU
- [ ] docker compose integration
Architecture
AI agent ──► Hail API ──dispatch──► Voicebot ──► LiveKit Cloud ──SIP──► Twilio ──► 📞
Full diagram: docs/architecture.md.
Contributing
See docs/contributing.md. TL;DR: fork, branch, conventional-commit, PR. Provider adapters go in core/hailhq/core/providers/. Update .env.example for any new env var.
License
Source code: AGPL-3.0-or-later — if you run a modified Hail as a service, you must release your source.
Pricing dataset (costs/): CC-BY-4.0 — reuse the pricing JSON freely with attribution.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.