Now I have a clear picture. Here's the simplified architecture for your use case:
Simplified Architecture
Your Goal: ElevenLabs Agent ↔ MCP Server ↔ FHIR/InSync (stubbed)
┌─────────────────────┐ SSE/HTTP ┌────────────────────┐
│ ElevenLabs Agent │ ◄──────────────────► │ MCP Server │
│ (via Widget) │ │ (insync-mcp) │
└─────────────────────┘ └─────────┬──────────┘
│
▼
┌────────────────────┐
│ Mock FHIR Data │
│ (shared package) │
└────────────────────┘
Key Concepts
1. ElevenLabs MCP Integration
ElevenLabs supports MCP servers via SSE (Server-Sent Events) transport. You register your MCP server URL with ElevenLabs:
bash
Then attach it to your agent via mcp_server_ids in the agent config.
2. Widget vs Phone
The widget is just a UI for the agent:
html
No Twilio needed — users interact through the browser widget.
3. MCP Server Requirements
Your MCP server needs to:
- Expose an SSE endpoint (ElevenLabs connects to it)
- Implement the MCP protocol (
@modelcontextprotocol/sdk)
- Provide tools like
searchPatient, getPatient, searchAppointments, createAppointment
Revised Implementation (Minimal)
| Package | Purpose | Needed? |
|---|
shared | Types + mock FHIR data | ✅ Yes |
insync-mcp | MCP server with 4 tools | ✅ Yes |
agent-server | Express for webhooks | ❌ Skip (use MCP instead) |
| Twilio/Phone | Real phone calls | ❌ Skip (use widget) |
What You'll Build
packages/shared — FHIR types + mock patients/appointments
packages/insync-mcp — MCP server (SSE transport) with 4 tools:
search_patient
get_patient
search_appointments
create_appointment
- Hosting — Deploy MCP server to a public URL (ngrok for dev, cloud for prod)
- ElevenLabs Dashboard — Register MCP server, attach to agent, use widget
Questions Before We Build
- Do you want to use the existing agent ID (
agent_4601kjh11d35f6b8qxymt1kpnyqm) or create a new one?
- Hosting preference — ngrok for local dev, or deploy somewhere (Vercel, Railway, Fly.io)?
- Any specific FHIR fields you need beyond patient name, DOB, phone, appointments?