┌─────────────────────┐ SSE/HTTP ┌────────────────────┐│ ElevenLabs Agent │ ◄──────────────────► │ MCP Server ││ (via Widget) │ │ (insync-mcp) │└─────────────────────┘ └─────────┬──────────┘ │ ▼ ┌────────────────────┐ │ Mock FHIR Data │ │ (shared package) │ └────────────────────┘# Create MCP server in ElevenLabsPOST /v1/convai/mcp-servers{ "config": { "url": "https://your-server.com/mcp", # Your hosted MCP server "name": "insync-mcp", "transport": "SSE" }}<elevenlabs-convai agent-id="YOUR_AGENT_ID"></elevenlabs-convai><script src="https://unpkg.com/@elevenlabs/convai-widget-embed" async></script>Phone Call (Twilio) → ElevenLabs Agent → Webhooks → agent-server → Mock FHIR Data ↑Claude/MCP clients → insync-mcp ───────────────────┘INFO: 199.247.196.34:0 - "GET /sse HTTP/1.1" 200 OKfrom mcp.server.transport_security import TransportSecuritySettings
security_settings = TransportSecuritySettings( enable_dns_rebinding_protection=False,)
mcp = FastMCP( name="InSync EHR", transport_security=security_settings,)pip install modalmodal auth loginmodal serve insync_mcp_modal.pynpx @modelcontextprotocol/inspectormodal deploy insync_mcp_modal.pycd .. && rm -rf ai-receptionist && git clone <repo-url> ai-receptionistgit initgit remote add origin <repo-url>git fetch origingit checkout -b main origin/main # or whatever the default branch is# modal_app.pyimport modal
app = modal.App("insync-mcp")
image = modal.Image.from_registry( "python:3.11-slim").pip_install( "mcp[cli]", "pydantic",)
@app.function(image=image, allow_concurrent_inputs=10)@modal.asgi_app()def serve(): from insync_mcp import mcp return mcp.sse_app()pip install modalmodal auth loginmodal deploy modal_app.pyElevenLabs Widget → ElevenLabs Agent → MCP Server (SSE) → Mock FHIR Data# Create MCP server projectnpm create cloudflare@latest -- insync-mcp --template=cloudflare/ai/demos/remote-mcp-authless
# Deploycd insync-mcpnpx wrangler@latest deployuv run mcp dev packages/insync-mcp/src/insync_mcp/__init__.py# Start server on port 8000uv run insync-mcp --transport sse --port 8000# In another terminalngrok http 8000uv run python -c "from insync_shared import search_patients, MOCK_PATIENTS
# List all mock patientsprint('=== Mock Patients ===')for p in MOCK_PATIENTS: print(f'{p.id}: {p.get_display_name()} - {p.birthDate}')
# Search by family nameprint('\n=== Search: family=Rodriguez ===')results = search_patients(family='Rodriguez')for p in results: print(p.get_display_name())"eleven-insync/├── pyproject.toml # uv workspace root├── README.md└── packages/ ├── shared/ # FHIR types + mock data │ ├── pyproject.toml │ └── src/insync_shared/ │ ├── __init__.py │ ├── fhir_types.py │ ├── mock_patients.py # 5 patients │ └── mock_appointments.py # 8 appointments └── insync-mcp/ # MCP server ├── pyproject.toml └── src/insync_mcp/ └── __init__.py # FastMCP server with 4 toolseleven/├── pyproject.toml # Root workspace├── packages/│ ├── shared/ # FHIR types + mock data│ │ └── pyproject.toml│ └── insync-mcp/ # MCP server│ └── pyproject.toml# In the window running the server, press Ctrl+C to stop it# Then run:uv run insync-mcp --transport sse --port 8000curl -L https://fly.io/install.sh | shfly auth login