receptionist-mcp
# receptionist-mcp
An [MCP](https://modelcontextprotocol.io) server that gives AI voice agents the skills of a front-desk receptionist for service businesses (HVAC, plumbing, restaurants, clinics): scheduling, caller recognition, callback messages, and handoff to a human.
It's extracted from a production voice receptionist I built for local service businesses (Pipecat + Whisper + n8n + Chatwoot + Supabase). Putting the business logic behind MCP means the same tools work with any agent harness, whether that's a Pipecat voice pipeline, Claude Desktop, Claude Code, or a custom agent loop, without rewriting integrations for each one.
```
Caller ──► Phone / SIP ──► Voice pipeline (STT → LLM → TTS)
│ MCP (stdio or streamable HTTP)
▼
receptionist-mcp ──► SQLite (local) or Supabase/Postgres (production)
```
## Tools
| Tool | What it does | Annotations |
|---|---|---|
| `get_business_info` | Hours, services, prices, service area, FAQ | read-only |
| `check_availability` | Open start times for a service on a date, or the next openings this week | read-only |
| `lookup_caller` | Recognize a caller by phone (any format) and list upcoming appointments | read-only |
| `book_appointment` | Book a confirmed slot; creates or updates the caller record | write |
| `reschedule_appointment` | Move a booking to a new open slot | write |
| `cancel_appointment` | Cancel a booking (idempotent) | destructive |
| `take_message` | Save a callback request with urgency | write |
| `escalate_to_human` | Log an escalation and return the number to transfer to | write |
It also exposes resources (`business://info`, `business://messages`) and a prompt (`receptionist_system_prompt`) with call-handling rules tuned for voice.
## Design decisions
- **The server enforces the rules, not the model.** Business hours, minimum notice, booking horizon, slot grid, and double-booking are all checked server-side in one transaction. An LLM that hallucinates a time gets a clear error instead of a bad booking.
- **Errors meant for the caller.** Expected failures ("That slot was just taken. Check availability again.") come back as MCP tool errors the agent can say out loud, while unexpected crashes stay hidden from the client.
- **Voice-friendly I/O.** Phone numbers are accepted in any format and normalized to E.164 so caller-ID lookups match. Times are returned in business-local ISO-8601 so the model can speak them naturally.
- **Tool annotations** (`readOnlyHint`, `destructiveHint`) let harnesses auto-approve lookups and require confirmation for cancellations.
- **Escalation number stays private.** `get_business_info` never reveals the internal transfer line. Only `escalate_to_human` returns it, to the pipeline.
- **Rules, storage, and protocol are separate layers.** `store.py` holds the booking rules and has no MCP or database imports. Storage sits behind a small `Repository` protocol, with SQLite for local use and Supabase for production. Every rule test runs against both backends.
- **Double-booking is impossible at the database level.** On Postgres, a `tstzrange` exclusion constraint rejects overlapping bookings even across several server processes or other apps writing to the same tables. The server maps that error (SQLSTATE 23P01) to the same "slot was just taken" message. CI applies the migration to a real Postgres 16 and verifies the constraints.
- **Availability costs one query per day, not one per slot.** That matters when the backend is a network hop away mid-call.
## Quick start
```bash
git clone https://github.com/Linexusai26/receptionist-mcp
cd receptionist-mcp
pip install -e ".[dev]"
pytest # rules x both backends + in-memory MCP client tests
python examples/demo_call.py # simulated inbound call over stdio
```
Run the server:
```bash
receptionist-mcp --config config/business.example.json --db receptionist.db # stdio
receptionist-mcp --transport streamable-http --host 0.0.0.0 --port 8000 # HTTP
```
### Supabase backend
1. Apply the schema: `supabase db push`, or paste `supabase/migrations/0001_receptionist.sql` into the SQL editor. It enables RLS with no policies, so only the service-role key can touch caller data.
2. Run against it:
```bash
export SUPABASE_URL=https://<project>.supabase.co
export SUPABASE_SERVICE_ROLE_KEY=... # server-side only, never ship to a browser
receptionist-mcp --backend supabase
```
The Supabase client uses only the Python standard library (PostgREST over HTTPS), so there are no extra dependencies.
### Use with Claude Desktop / Claude Code
```json
{
"mcpServers": {
"receptionist": {
"command": "receptionist-mcp",
"args": ["--config", "/path/to/business.json", "--db", "/path/to/receptionist.db"]
}
}
}
```
### Use with a Pipecat voice agent
Pipecat's `MCPClient` can load the tools straight into your LLM service:
```python
from mcp import StdioServerParameters
from pipecat.services.mcp_service import MCPClient
mcp = MCPClient(server_params=StdioServerParameters(
command="receptionist-mcp",
args=["--config", "business.json", "--db", "receptionist.db"],
))
tools = await mcp.register_tools(llm) # llm = your Pipecat LLM service
```
## Configure your business
Copy `config/business.example.json` and edit it. It sets hours per weekday, services with durations, slot size, minimum notice, booking horizon, FAQ, and the escalation number. You can also set the `RECEPTIONIST_CONFIG` and `RECEPTIONIST_DB` environment variables.
## Example call
```
--> Caller: 'My AC is blowing warm air. When can someone come out?'
check_availability(service_id="diagnostic")
slots: 2026-12-02T08:00-05:00, 08:30, 09:00, ...
--> Caller accepts 8:00
book_appointment(...) → confirmed, apt_21a3e8cec5
--> Another caller tries the same slot
error: That slot was just taken. Check availability again.
--> Caller: 'There's a gas smell near the furnace'
escalate_to_human(urgency="emergency") → transfer_to: +14045550199
```
## Roadmap
- Google Calendar sync for technician schedules
- SMS confirmations via Twilio
- Multi-location / multi-technician routing
- OAuth for the HTTP transport
## License
MIT
TDQS
Scored across 8 tools
Each tool maps to a distinct step in the call flow: info retrieval, availability check, caller lookup, booking lifecycle, escalation, and messaging. The only near-pair, escalate_to_human vs take_message, is clearly separated (live transfer vs callback message) by their descriptions and arguments.
All eight names are snake_case verb_noun (get_business_info, check_availability, lookup_caller, book_appointment, cancel_appointment, etc.) with no stylistic deviations. The pattern is immediately predictable.
Eight tools is well within the ideal 3-15 range and every tool corresponds to a real receptionist action. Nothing appears redundant or bolted on.
The surface covers the full appointment lifecycle (book, reschedule, cancel), plus info, availability, caller context, escalation, and callbacks, so no dead ends in the main workflow. Minor gaps exist around updating caller notes/details or listing all of a caller's message history, but agents can work around these via lookup_caller and take_message.