An omnichannel client outreach and communication hub powered by Nitro, Notion CRM, Vue Email, and LiveKit.
MConnect is a unified communication and engagement engine built with Nitro 3. It connects multi-tenant organizations to an omnichannel gateway spanning transactional email, SMS, WhatsApp, and WebRTC/SIP telephony—orchestrating all inbound and outbound client touchpoints into a unified Notion CRM directory and ledger.
Equipped with dynamic Vue-based email rendering, anti-bot email telemetry (featuring Apple Mail Privacy Protection filtering and honeypot traps), multi-vendor carrier routing (SMTP/IMAP, Fast2SMS, Vobiz, Twilio, LiveKit), and Model Context Protocol (MCP) toolkits, MConnect powers comprehensive client relationship workflows with zero vendor lock-in.
- 🌐 Omnichannel Communication Layer: Unified dispatch and ingestion pipelines across Email (SMTP/IMAP), SMS (Fast2SMS, Vobiz, Twilio), WhatsApp (Vobiz / Meta Cloud API), and Telephony (LiveKit SIP Carrier Bridge).
- 🗄️ Unified Notion CRM Core: Smart contact deduplication (matching sequentially on phone and email), automatic profile enrichment, and consolidated omnichannel interaction timelines across all channels.
- 🎨 10 Type-Safe Vue Email Templates: Rich, responsive email layouts rendered via
@vue-email/renderwith dynamic variable schemas, brand customizability, and JSON schema inspection. - 🛡️ Advanced Anti-Bot Telemetry: Open/click tracking pixel engine with Apple Mail Privacy Protection (MPP) egress IP filtering, known security scanner detection, offline IP geolocation (
geoip-lite), and honeypot traps that retroactively invalidate crawler noise. - 📞 Programmable SIP & WebRTC Voice Engine: LiveKit media room provisioning, two-leg outbound SIP bridging, agent priority routing from CRM rows, and call duration ledger sync.
- 🤖 Model Context Protocol (MCP) Ready: Integrated with
nitro-mcp-toolkitto expose system diagnostics and service tools directly to AI coding and assistant agents. - ⚡ Automated Task Scheduling: Nitro cron workers executing periodic telemetry syncs, IMAP inbox polling, and multi-database Notion caching at scheduled intervals.
+---------------------------+ +-------------------------------+
| 👤 External Client/Lead | | 💼 Internal Agent/Dashboard |
+---------------------------+ +-------------------------------+
^ ^ ^
| Email / SMS / WhatsApp / SIP | REST/WS | AI Prompts
v v v
+-------------------------------+ +-------------------------------+
| 📡 Omnichannel Carriers | | 🚀 MConnect Gateway (Nitro) |
| - Email: SMTP / IMAP |<------->| - API Gateway & Route Engine |
| - SMS: Fast2SMS/Vobiz/Twilio | Webhook | - MCP Server Toolkit |
| - WhatsApp: Meta Cloud/Vobiz | Ingest/ | - Vue-Email Rendering Engine |
| - Voice: LiveKit SIP Bridge | Outbound| - Anti-Bot Telemetry Hub |
+-------------------------------+ | - Local Cache (unstorage fs) |
| - Cron Worker (sync:*) |
+-------------------------------+
|
| Direct Upsert /
| Scheduled Sync
v
+-------------------------------+
| 🏢 Notion CRM Core (DBs) |
| - Contacts & Unified Ledger |
| - Emails & Communications |
| - Messages (SMS / WhatsApp) |
| - Voice Calls & Recordings |
| - Verified Telemetry Events |
+-------------------------------+
- Runtime: Bun
^1.2.9(recommended) or Node.js^22.11.0 || ^24.14.0 - Package Manager:
bun@1.4.1(configured viapackageManager) - Notion Integration: API Key and Database IDs for Contacts, Users, Emails, Messages, Calls, and Telemetry
# Clone the repository
git clone https://github.com/Modest-Human-Brands/mconnect.git
cd mconnect
# Install dependencies using Bun
bun installCreate .env in the root directory:
NODE_ENV=development
PORT=3000
# Notion Integration
NOTION_API_KEY=secret_your_notion_api_key
# Public & Private Runtime Config
NITRO_PUBLIC_CONNECT_URL=http://localhost:3000
NITRO_PRIVATE_NOTION_DB_ID={"contact":"<id>","user":"<id>","email":"<id>","message":"<id>","call":"<id>","telemetry":"<id>"}
NITRO_PRIVATE_API_KEY=<long-random-secret>
# Versioning & Host Identifiers
NITRO_APP_VERSION=0.5.16
NITRO_APP_BUILD_TIME=2026-10-16T00:00:00Z
HOSTNAME=mconnect-local-1# Start local Nitro development server (with live reload)
bun run dev
# Expose local server via secure Untun tunnel (for receiving remote webhooks)
bun run tunnel# Build for production with Nitro
bun run build
# Start compiled server
bun run start
# Or build and launch via Docker
bun run docker:build
bun run docker:startAuthentication. Every
/api/**route requires anx-api-keyheader matchingNITRO_PRIVATE_API_KEY(401 if missing or wrong, 503 if the server has no key configured). Exempt routes:GET /api/health,/api/track/*(opened by email clients),POST /api/interaction/phone/status(verified by the LiveKit signature), the OAuth callback/api/email/accounts/oauth/:provider/callback, and the SMS/WhatsApp template-preview WebSockets.Inbound SMS/WhatsApp webhooks (
POST /api/interaction/sms/receive,/whatsapp/receive) also accept?secret=<NITRO_PRIVATE_WEBHOOK_SECRET>in the URL for providers that cannot send headers. The LiveKit webhook takes its organization from?org=<slug>(orNITRO_PRIVATE_VOICE_ORG_SLUG).
All /api/** endpoints have Cross-Origin Resource Sharing (CORS) enabled by default.
Returns deployment readiness and active compute node information.
- Response (
200 OK):{ "status": "OK", "version": "0.5.16", "buildTime": "2026-10-16T00:00:00Z", "node": "mconnect-node-1" }
Note: Also exposed as a Model Context Protocol (MCP) tool named health.
Retrieves a paginated list of contacts enriched with reachability channels (platforms), latest message snippets, unread counts, and timestamps.
-
Query Parameters:
Parameter Type Default Description limitnumber50Maximum number of contact records to return. offsetnumber0Number of records to skip for pagination. -
Response (
200 OK):{ "results": [ { "id": "189c4e20-3b1a-4c22-98a1-8d2a3c9b7e54", "name": "Sarah Liu", "company": "WaveLength Creative Co.", "jobTitle": "Marketing Director", "email": "sarah.liu@wavelength.co", "phone": "+15551234567", "instagram": "sarah_creative", "status": "Active", "lastActive": "2026-10-15T14:20:00.000Z", "lastMessageSnippet": "Looking forward to reviewing the proposal.", "platforms": ["email", "sms", "phone", "whatsapp"], "unreadCount": 0 } ], "pagination": { "total": 142, "limit": 50, "offset": 0 } }
Smart contact upsert. If contactId is omitted, deduplicates against existing CRM pages by matching phone first, then email. If no record matches, creates a new Notion contact page.
-
Request Body (JSON):
Field Type Required Description brandstringYes Brand or primary trading name. companystringYes Full company/legal entity name. addressstringYes Physical or business address. pocPersonstringYes Point of Contact primary person name. phonestringOptional Phone number (at least one of phoneoremailis required).emailstringOptional Valid email address (at least one of phoneoremailis required).contactIdstringNo Target Notion page ID. When provided, updates the existing record directly. statusenumNo Status: Unverified,Researched,Verified,Initiate,Communicate,Converted,Cancelled,Active,Inactive,On Hold.typeenumNo Company type: Brand,Product,Agency,Food,FMCG,Sweet,Real Estate,Hotel,Home Decor,Leather,Garment,Cosmetics,Jewellery,Accessories.tagsstring[]No Categorical tags. whatsappstringNo Dedicated WhatsApp phone number. websiteurlNo Organization website URL. linkedInurlNo LinkedIn profile URL. instagramurlNo Instagram profile URL. -
Response (
200 OK):{ "contactId": "367ee3b0-289a-81c9-b502-d21a1ed375b0", "status": "created" }
Retrieves a unified chronological history (newest first) across Emails, Messages (SMS/WhatsApp), and Phone Calls for a given contact.
-
Path Parameters:
contactId(string, required): Notion contact page ID.
-
Query Parameters:
limit(number, optional): Maximum interactions to return.offset(number, default:0): Pagination skip offset.
-
Response (
200 OK):{ "client_id": "189c4e20-3b1a-4c22-98a1-8d2a3c9b7e54", "results": [ { "interactionId": "msg_90123", "channel": "whatsapp", "direction": "inbound", "timestamp": "2026-10-15T12:00:00.000Z", "summary": "Can you resend the updated contract?", "status": "delivered", "metadata": { "hasAttachments": false, "mediaUrl": null } }, { "interactionId": "eml_88214", "channel": "email", "direction": "outbound", "timestamp": "2026-10-14T09:30:00.000Z", "content": "<p>Hi Sarah, here is the updated proposal...</p>", "status": "sent", "metadata": { "subject": "Proposal - Retainer 2026", "hasAttachments": true } } ], "pagination": { "total": 2, "limit": 50, "skip": 0 } }
Dispatches an email via the configured SMTP provider, compiles Vue email templates (or delivers raw text/HTML), tracks recipient engagement, and creates a Notion email record.
-
Headers:
x-org-id(string, required): Tenant organization slug (e.g.modest-human-brands).
-
Request Body (JSON):
{ "userId": "307ee3b0289a8179a8a8d2efcdb67bbf", "contactId": "367ee3b0-289a-81c9-b502-d21a1ed375b0", "recipientEmail": "client@example.com", "displayName": "Shirsendu from Modest Human", "template": "quotation", "subject": "Quotation for Q4 Production", "variables": { "recipientName": "Alex Mercer", "quotationNumber": "QT-2026-001", "dateOfIssue": "2026-10-16", "validUntil": "2026-11-16", "currency": "INR", "lineItems": [{ "name": "Brand Identity Redesign", "quantity": 1, "rate": 50000 }], "financials": { "subtotal": 50000, "discountPercentage": 10, "taxPercentage": 18 }, "ctaUrl": "https://modesthumanbrands.com/proposals/QT-2026-001", "organization": { "id": "org_1", "name": "Modest Human Brands", "legalName": "Modest Human Brands LLP", "entityType": "LLP", "tradeRelationship": "Primary", "address": "Kolkata, India", "foundedYear": 2024, "accountDetails": { "accountName": "Modest Human Brands LLP", "accountNumber": 1234567890, "bankName": "HDFC Bank", "ifscCode": "HDFC0001234" }, "branding": { "logo": "https://modesthumanbrands.com/logo.svg", "color": { "primary": "#111827", "accent": "#3B82F6" }, "font": "Exo2" }, "contactEmail": "contact@modesthumanbrands.com", "billingEmail": "billing@modesthumanbrands.com", "primaryContactId": "user_1", "organizationMemberIds": ["user_1"], "createdAt": "2024-01-01T00:00:00Z", "updatedAt": "2024-01-01T00:00:00Z" } } }For raw emails without a template, pass
"template": "none","text": "Your plain text message", and optional"html": "<p>HTML</p>", with"variables": undefined. -
Response (
200 OK):{ "success": true, "dispatchId": "<b978aaa-50eb-99df-9ded-aa04750f76d0@modesthumanbrands.com>", "emailId": "36bee3b0289a8030a6f9c0eea0708f12" }
Inbound email ingestion webhook. Parses multi-part MIME payloads, upserts the contact, and logs the email directly into the Notion Email database with status Received and direction Inbound.
-
Request Body (JSON):
{ "from": "John Doe <john.doe@example.com>", "to": "contact@modesthumanbrands.com", "subject": "Re: Project Scope Inquiry", "text": "Hi team, I had a follow-up regarding the milestone schedule.", "html": "<p>Hi team, I had a follow-up regarding the milestone schedule.</p>" } -
Response (
200 OK):{ "success": true, "interactionId": "36bee3b0289a8030a6f9c0eea0708f12" }
Retrieves all emails associated with a specific organization. Requires x-org-id header.
Retrieves all emails across the workspace, sorted with latest first.
Retrieves full details and sanitized HTML for a single email interaction by its Notion page ID.
Dispatches SMS via Fast2SMS, Vobiz, or Twilio, and creates a Notion message page.
-
Headers:
x-org-id(string, required): Tenant organization slug (e.g.modest-human-brands).
-
Request Body (JSON):
{ "userId": "307ee3b0289a8179a8a8d2efcdb67bbf", "contactId": "367ee3b0-289a-81c9-b502-d21a1ed375b0", "recipientPhone": "+919876543210", "template": "none", "text": "Your verification code is 482910. Valid for 10 minutes." } -
Response (
200 OK):{ "interactionId": "36bee3b0289a8030a6f9c0eea0708f12", "dispatchId": "fast2sms-req-8832199" }
Inbound SMS webhook target. Upserts the contact and appends an inbound message record to Notion.
-
Request Body (JSON):
{ "from": "+919876543210", "to": "+918012345678", "text": "YES, confirm my appointment." } -
Response (
200 OK):{ "success": true, "interactionId": "36bee3b0289a8030a6f9c0eea0708f12" }
Dispatches WhatsApp messages or approved template structures via Meta Cloud API / Vobiz.
-
Headers:
x-org-id(string, required): Tenant organization slug (e.g.modest-human-brands).
-
Request Body (JSON):
{ "userId": "307ee3b0289a8179a8a8d2efcdb67bbf", "contactId": "367ee3b0-289a-81c9-b502-d21a1ed375b0", "template": "none", "text": "Hi Alex, your requested quotation has been generated and sent to your email." } -
Response (
200 OK):{ "interactionId": "36bee3b0289a8030a6f9c0eea0708f12", "dispatchId": "wamid.HBgLOTE5ODc2NTQzMjEwFQIAERg2..." }
Inbound webhook listener for WhatsApp messages.
-
Request Body (JSON):
{ "from": "+919876543210", "to": "+918012345678", "text": "Thanks! Reviewing now." } -
Response (
200 OK):{ "interactionId": "36bee3b0289a8030a6f9c0eea0708f12" }
Initiates a dual-leg voice call by creating a LiveKit media room, issuing an agent session token, and launching an outbound SIP trunk bridge to the destination party.
-
Headers:
x-org-id(string, required): Tenant organization slug (e.g.modest-human-brands).
-
Request Body (JSON):
{ "contactId": "36bee3b0289a8030a6f9c0eea0708f12", "userId": "307ee3b0289a8179a8a8d2efcdb67bbf", "recordCall": true, "webCall": false } -
Response (
200 OK):{ "status": "bridging_initiated", "provider": "livekit-sip", "callUuid": "call_98fbc123-e456" }
Webhook receiver for LiveKit room lifecycle events (room_started, room_finished). Validates cryptographic signatures via the Authorization header, handles automatic agent hunt routing (Sales/Marketing priority queues), and logs call durations back to Notion.
GET /api/interaction/email/template: Returns an array of all 10 registered templates with labels, descriptions, and thumbnail URLs.GET /api/interaction/email/template/:id: Returns the JSON Schema representation of the template's required variables.POST /api/interaction/email/template/preview: Dynamically compiles a template with provided variables and returns{ "contentHtml": "<...>" }.
| Template Slug | Description |
|---|---|
content-release |
Formal talent and media copyright release agreement. |
internship-completion-certificate |
Verification of internship completion with signatory details. |
invoice |
Detailed commercial invoice with tax, discounts, and itemized billing. |
otp |
Clean transactional one-time password verification code email. |
outreach |
Personalized cold outreach and partnership proposal email. |
project-delivery |
Production deliverable handover with cloud asset download links. |
quotation |
Formal quotation / estimate with line items and acceptance CTA. |
receipt |
Payment acknowledgment receipt with transaction and bank details. |
retainer-contract |
Monthly agency retainer contract terms and deliverables. |
shoot-contract |
Production shoot agreement with logistics, schedule, and deliverables. |
GET /api/interaction/sms/template: Catalog of registered SMS templates.GET /api/interaction/whatsapp/template: Catalog of registered WhatsApp templates.- WebSocket Previews:
ws://localhost:3000/api/interaction/sms/template/previewws://localhost:3000/api/interaction/whatsapp/template/preview
- Interactive Browser Studios:
GET /dev/sms/:id: Live visual in-browser SMS editor and live preview.GET /dev/whatsapp/:id: Live visual in-browser WhatsApp message renderer.
MConnect includes an enterprise-grade telemetry engine designed to measure genuine human interaction while filtering out automated security scanners and crawlers.
GET /api/track/open?e=<emailId>Returns a1x1transparent GIF withCache-Control: no-store, no-cache. Logs IP, user-agent, device classification (desktop/mobile), and geolocation. Automatically filters out known bots and Apple Mail Privacy Protection (MPP) proxy requests.GET /api/track/click?url=<targetUrl>&e=<emailId>Records genuine link click-throughs and issues an HTTP302redirect to the destination URL (falls back tohttps://modesthumanbrands.com).GET /api/track/trap?e=<emailId>Invisible honeypot link placed in emails. When an automated crawler follows the trap, MConnect immediately tags the session as a bot and retroactively invalidates all past opens and clicks associated with thatemailId.GET /api/interaction/email/:id/telemetryRetrieves deep telemetry analytics for an email, including aggregated metrics (totalOpens,totalClicks,botFiltered,isHoneypotTriggered,deviceBreakdown,locations) and a chronological event timeline.
View Development & Build Scripts
All scripts are executed using Bun:
| Script | Command | Purpose |
|---|---|---|
bun run dev |
nitro dev |
Starts local development server on port 3000 with HMR. |
bun run build |
nitro build |
Builds optimized standalone production output in .output/. |
bun run start |
node --env-file=.env.prod .output/server/index.mjs |
Runs production build with Node.js. |
bun run preview |
nitro preview |
Previews the compiled production build locally. |
bun run test |
vitest run |
Runs unit and integration test suite via Vitest. |
bun run test:load |
k6 run tests/load.test.ts |
Runs performance load tests with k6. |
bun run lint |
eslint . --fix |
Runs ESLint and automatically fixes formatting errors. |
bun run format |
prettier . --write |
Formats all code with Prettier. |
bun run generate |
nitro task run thumbnail:template |
Renders template sample PNGs to public/templates (needs bun run dev running). |
bun run tunnel |
bunx untun tunnel http://localhost:3000 |
Creates an HTTP tunnel to receive external webhooks. |
bun run detect |
gitleaks git --verbose |
Scans git repository history for leaked secrets. |
bun run clean |
nitro cleanup |
Cleans temporary Nitro caches and artifacts. |
bun run docker:build |
docker build ... -t mconnect:dev . |
Builds the multi-stage Alpine Docker container. |
bun run docker:start |
docker run ... mconnect:dev |
Runs container with mapped port 3500:3000. |
Published under the MIT license.