Datasynx Agentic CRM The CRM your AI agents actually run. local-first · MCP-native · 78 tools · zero telemetry

Datasynx Agentic CRM

local-first MCP-native open source enterprise-ready

The CRM your AI agents actually run. Every customer lives on your machine as plain Markdown — no cloud, no SaaS pricing, no vendor lock-in. Your AI agents read, reason about, and update it directly via the Model Context Protocol. 78 MCP tools, hybrid search, deal & revenue intelligence, RBAC, GDPR erasure, an encrypted vault, SSO — and zero telemetry. All built in.

5-Minute Quickstart — 3 commands to your first AI-powered customer brief.
# 1. Install globally
npm install -g @datasynx/agentic-crm

# 2. Initialize (auto-detects Claude Code, Codex, Cursor, Grok, ...)
dxcrm init

# 3. Create your first customer
dxcrm create "Acme Corp" --domain acme.com --email ceo@acme.com

# Your AI agent can now answer:
# "What's going on with Acme Corp?" → answer in <3 seconds

vs. a typical SaaS CRM

FeatureTypical SaaS CRMdxcrm
Pricing modelPer-seat subscriptionFree & open source
AI integrationAdd-on or APINative MCP
Data locationVendor cloudYour machine
Offline accessRequires connectionFully offline
GDPR erasureCloud processingBuilt-in

What's included

  • 16 MCP tools for AI agents
  • 9 CRM import connectors
  • Gmail, Outlook, Drive, Teams, Meet sync
  • RBAC with 3 roles
  • GDPR erasure + audit trail
  • AES-256-GCM field encryption
  • WorkOS SSO integration
  • Plugin system (Slack, Stripe, Linear)
  • Custom pipeline stages
  • Deal health scoring (A–F)
  • Webhook receiver (HMAC-SHA256)

Installation

Requirements

  • Node.js 18+ (for native fetch and crypto)
  • An AI framework: Claude Code, Codex CLI, Cursor, or any MCP-compatible client

Install

# Global install (recommended)
npm install -g @datasynx/agentic-crm

# Or local to a project
npm install datasynx-opencrm
npx dxcrm init

Initialize

# Solo developer
dxcrm init

# Team (connects to shared HTTP server)
dxcrm init --team http://vm-ip:3847/mcp

dxcrm init auto-detects all installed AI frameworks and registers the MCP server. No manual config needed for Claude Code, Codex, Grok, Cursor, Windsurf, Cline, Claude Desktop, Hermes, or OpenClaw.

Data Structure

your-project/
├── customers/
│   └── acme-corp/
│       ├── main_facts.md      # Customer profile (YAML frontmatter)
│       ├── interactions.md    # All calls/emails/meetings (newest first)
│       ├── pipeline.md        # Deal stages
│       ├── sources.json       # Gmail query, transcript paths
│       ├── attachments/       # PDFs, contracts, proposals
│       └── transcripts/       # Meeting recordings
│
└── .agentic/
    ├── config.json            # CRM configuration
    ├── sources.json           # Global sync sources
    ├── audit.log              # Append-only audit trail
    ├── rbac.json              # Role assignments
    ├── gdpr-erasures.json     # Erasure protocol
    ├── pipeline-stages.json   # Custom stage config
    ├── server.pid             # HTTP server PID (team mode)
    ├── lancedb/               # Vector search index (auto-managed)
    └── agents/                # Per-customer agent configs
        └── acme-corp.agent.json
All data is plain text. You can read, edit, and back it up with standard tools. git add customers/ is a valid backup strategy.

dxcrm init

Initialize Datasynx Agentic CRM. Detects AI frameworks and registers the MCP server in all of them.

dxcrm init
dxcrm init --team http://vm-ip:3847/mcp   # Team mode
FrameworkTierConfig written
Claude Code1~/.claude.json + CLAUDE.md + .claude/settings.json
Codex CLI1~/.codex/config.toml + AGENTS.md
Grok Build (xAI)1~/.grok/user-settings.json + .grok/settings.json + AGENTS.md
OpenClaw1SOUL.md + AGENTS.md + TOOLS.md
Hermes Agent1SOUL.md + Skill
Antigravity CLI1GEMINI.md + AGENTS.md + SKILL.md
Cursor2.cursor/rules/datasynx-crm.mdc
Windsurf2.windsurf/mcp.json
Cline2MCP config
Claude Desktop2Platform-specific config

dxcrm create

dxcrm create "Acme Corp" --domain acme.com --email ceo@acme.com

Creates customers/acme-corp/ with all required files. Slug is auto-generated from the name (lowercase, hyphens).

dxcrm sync

Sync emails, transcripts, and cloud files into LanceDB for semantic search.

dxcrm sync                                 # Gmail (default)
dxcrm sync --provider gmail                # Explicit Gmail
dxcrm sync --provider microsoft            # Outlook via Graph API
dxcrm sync --provider google-drive        # Google Drive/Docs
dxcrm sync --provider teams-transcripts   # Microsoft Teams
dxcrm sync --provider google-meet         # Google Meet
dxcrm sync --provider transcripts         # Local transcript files
ProviderAuth filesourceRef format
gmail.agentic/gmail-token.jsongmail://message/<id>
microsoft.agentic/microsoft-token.jsonmicrosoft://message/<id>
google-driveGOOGLE_SERVICE_ACCOUNT_KEYgdrive://file/<id>
teams-transcripts.agentic/microsoft-token.jsonteams://transcript/<id>
google-meetGOOGLE_SERVICE_ACCOUNT_KEYmeet://transcript/<id>

dxcrm session

dxcrm session open acme-corp           # Set active customer
dxcrm session open acme-corp --owner alice
dxcrm session close
dxcrm session status

The active session is returned by get_active_session(). Set DXCRM_ACTOR to attribute writes to a team member.

dxcrm import

Import customers and interactions from any CRM. Two-pass: creates customers first, then imports activities. Idempotent — re-running skips already-imported rows.

# CSV / HubSpot export file
dxcrm import contacts.csv
dxcrm import hubspot-export.csv --from hubspot --dry-run

# HubSpot API (v4 Associations — full history)
dxcrm import --from hubspot --mode api --token $HUBSPOT_TOKEN

# Salesforce REST API (contacts + tasks)
dxcrm import --from salesforce --mode api \
  --token $SFDC_TOKEN --url https://myco.salesforce.com

# Pipedrive REST API (persons + activities)
dxcrm import --from pipedrive --mode api \
  --token $PIPEDRIVE_TOKEN --url https://myco.pipedrive.com
SourceContacts → CustomersActivities → InteractionsAPI Version
HubSpot (API)Contacts APIv4 Associations (notes/calls/emails/meetings)v4
SalesforceContact SOQLTask SOQL (linked via WhoId)v58.0
PipedrivePersons APIActivities API (cursor pagination)v2
Dynamics 365OData contactsOData activitiesv9.2
Zoho CRMContacts moduleActivities modulev3
Monday.comGraphQL boardsGraphQL items/updates2024-01
FreshsalesContacts RESTActivities RESTv2
Zendesk SellContacts RESTActivities RESTv2
Copper CRMPeople RESTActivities RESTv1

dxcrm stages

Manage custom pipeline stages. Stored in .agentic/pipeline-stages.json.

dxcrm stages list                                                  # List all stages
dxcrm stages set discovery "Discovery" --order 3 --probability 40  # Create/update
dxcrm stages set signed "Signed" --final --color "#3fb950"          # Terminal stage
dxcrm stages delete discovery                                       # Remove stage
dxcrm stages reset                                                   # Back to defaults

Default stages

IDLabelOrderProbability
leadLead110%
qualifiedQualified230%
proposalProposal350%
negotiationNegotiation475%
wonWon5100%
lostLost60%

dxcrm plugin

Manage the plugin registry.

dxcrm plugin list              # List all registered plugins
dxcrm plugin info slack        # Show plugin details + MCP tools it exposes
PluginWhat it adds
slackSlack DM after every interaction; channel alert after deal update
stripeget_stripe_context MCP tool — revenue, subscriptions per customer
linearget_linear_issues MCP tool — open issues linked to customer

dxcrm status

dxcrm status                # Daemon state, sync ages, customer count
dxcrm status --unmatched    # List unmatched transcript queue

dxcrm agent

Spawn a wake-triggered agent that sends Telegram notifications on new email activity.

dxcrm agent spawn acme-corp --channel telegram
dxcrm agent spawn acme-corp --channel telegram --chat-id 12345
dxcrm agent status
dxcrm agent remove acme-corp

Requires: TELEGRAM_BOT_TOKEN + TELEGRAM_CHAT_ID environment variables.

dxcrm server

Start a shared HTTP MCP server for team use.

dxcrm server start                                # Port 3847
dxcrm server start --port 3847 --data /mnt/crm-data
dxcrm server status

Each team member adds url: http://vm-ip:3847/mcp to their framework config, then sets export DXCRM_ACTOR=alice.

dxcrm audit

Append-only audit trail. Every write operation is logged with actor, tool, customer, and summary.

dxcrm audit                          # Last 20 entries
dxcrm audit --slug acme-corp         # Filter by customer
dxcrm audit --actor alice            # Filter by actor
dxcrm audit --limit 100

# Log format:
# 2026-06-01T09:14:00Z | alice | log_interaction | acme-corp | Renewal call

dxcrm forecast

Weighted pipeline forecast — total, by stage, and per owner. RBAC-aware: a rep sees only their own customers' deals; manager/admin see the full team rollup.

dxcrm forecast                  # total + by-stage
dxcrm forecast --by-owner        # per-owner rollup
dxcrm forecast --owner alice      # drill into one rep

dxcrm rbac

Role-based access control. Roles are stored in .agentic/rbac.json. Config is optional — without it all calls are allowed (solo mode).

dxcrm rbac set alice admin
dxcrm rbac set bob rep
dxcrm rbac show
dxcrm rbac check alice update_deal    # Exit 0 = allowed
Rolelog_interactionupdate_dealupdate_customer_factsexport_customer
admin
manager
rep

Actor identity: export DXCRM_ACTOR=alice. Default role when no rbac.json exists: unrestricted (solo mode).

dxcrm gdpr

GDPR erasure with dry-run safety. Always run without --confirm first.

dxcrm gdpr erase acme-corp              # Dry-run: shows plan
dxcrm gdpr erase acme-corp --confirm    # Permanent deletion
dxcrm gdpr list-erasures               # Erasure history

On confirmed erasure: deletes customers/<slug>/, drops LanceDB vector table, writes audit entry, appends to gdpr-erasures.json.

dxcrm backup / restore

dxcrm backup                                  # ./backup-YYYY-MM-DD.zip
dxcrm backup ./my-backup.zip
dxcrm backup schedule --every day --keep 7   # Auto-backup via daemon
dxcrm backup schedule --status
dxcrm restore ./backup.zip

MCP Tool: get_capabilities

Returns the complete tool guide. Call this first in a new session.

get_capabilities()
// Returns: this documentation as a Markdown string

MCP Tool: get_customer_context

Full customer brief in under 3 seconds.

get_customer_context({ slug: "acme-corp" })

// Returns: structured Markdown with:
// - Quick Reference (name, domain, stage, deal value)
// - Contacts
// - Critical Context
// - Recent Activity (last 10 interactions)
// - Pipeline (all deals)
// - Open Questions / Next Steps

MCP Tool: list_customers

list_customers({ filter: "acme" })   // filter is optional

// Returns: [{ slug, name, stage, lastInteraction, dealValue }]

MCP Tool: log_interaction

Record a call, email, or meeting. Use after every customer touchpoint.

log_interaction({
  slug: "acme-corp",
  type: "Call",              // Call | Email | Meeting | Note | Demo | Proposal | Contract | Other
  summary: "Discussed renewal. Budget confirmed at €50k.",
  with: "Alice Smith",
  nextSteps: ["Send proposal by Friday"],
  direction: "inbound"      // inbound | outbound — optional
})

// Returns: { success, path, entry }
// RBAC: rep+ · writes audit entry

MCP Tool: update_deal

Update or create a pipeline deal. Upserts by deal name.

update_deal({
  slug: "acme-corp",
  dealName: "Enterprise License 2026",
  stage: "negotiation",
  value: 75000,
  probability: 75,
  closeDate: "2026-09-30",
  notes: "Legal review pending"
})

// Returns: { success, deal }
// RBAC: rep+ · writes audit entry

MCP Tool: update_customer_facts

Update fields in a customer's profile. Merges patch; preserves unmentioned fields.

update_customer_facts({
  slug: "acme-corp",
  domain: "new-acme.io",
  primaryContact: "Bob Jones",
  relationshipStage: "active",  // prospect | active | churned | paused
  tags: ["enterprise", "strategic"],
  industry: "SaaS"
})

// Returns: { success, facts }
// RBAC: admin only · writes audit entry

MCP Tool: export_customer

export_customer({ slug: "acme-corp", format: "json" })  // json | markdown

// JSON: { slug, exportedAt, mainFacts, interactionsCount, pipeline }
// Markdown: formatted briefing document

MCP Tool: get_active_session

get_active_session()

// Returns: { hasSession, customerSlug?, customerName?, startedAt?, owner? }

MCP Tool: get_deal_health

Score all deals for a customer. Useful for prioritization and pipeline reviews.

get_deal_health({ slug: "acme-corp" })

// Returns:
{
  deals: [
    {
      name: "Enterprise License 2026",
      stage: "negotiation",
      value: 75000,
      score: 82,       // 0–100
      grade: "B",      // A ≥90, B ≥75, C ≥60, D ≥40, F <40
      warnings: ["No interaction in 14 days"]
    }
  ]
}

MCP Tool: get_pipeline_forecast

Aggregate weighted pipeline revenue across all customers by stage.

get_pipeline_forecast()

// Returns:
{
  total: 347500,
  weighted: 189250,
  byStage: {
    lead:        { count: 3, raw: 45000,  weighted: 4500  },
    qualified:   { count: 2, raw: 80000,  weighted: 24000 },
    negotiation: { count: 2, raw: 75000,  weighted: 56250 },
    won:         { count: 1, raw: 27500,  weighted: 27500 }
  }
}

MCP Tool: summarize_meeting

Summarize a transcript via LLM and log the interaction automatically.

summarize_meeting({
  slug: "acme-corp",
  transcript: "Alice: Thanks for joining. We discussed the Q3 renewal...",
  with: "Alice Smith",
  date: "2026-05-27"   // optional
})

// Returns: { success, summary, nextSteps[], interactionLogged }
// Requires: ANTHROPIC_API_KEY or OPENAI_API_KEY
// RBAC: rep+

MCP Tool: get_pipeline_stages

Returns all configured pipeline stages. Reflects custom stages set via dxcrm stages set.

get_pipeline_stages()

// Returns:
{
  stages: [
    { id: "lead", label: "Lead", order: 1, probability: 10, color: "#8b949e" },
    { id: "qualified", label: "Qualified", order: 2, probability: 30 },
    // ...
  ]
}

MCP Tool: get_market_intelligence

Search interaction history across all customers for patterns, competitor mentions, or objection themes.

get_market_intelligence({
  query: "competitor pricing objection",
  limit: 10    // optional
})

// Returns:
{
  results: [
    { customer: "acme-corp", content: "Mentioned Salesforce...", score: 0.91, source: "gmail://..." },
    { customer: "beta-gmbh", content: "Asked for HubSpot comparison...", score: 0.87 }
  ]
}

MCP Tool: get_relationship_health

Returns health scores for all contacts. Scores decay automatically when communication cadence breaks — no manual input required. Auto-updates after every log_interaction.

get_relationship_health({ slug: "acme-corp" })

// Returns:
{
  overallHealth: 58,
  atRiskContacts: ["cfo@acme.com"],
  coldContacts:   ["cfo@acme.com"],
  contacts: [
    { name: "Max Miller",    score: 72, grade: "B", trend: "stable",   riskFlags: [],                         recommendation: "..." },
    { name: "Thomas Berger", score: 18, grade: "F", trend: "cold",    riskFlags: ["NO_CONTACT_30D", "CHAMPION_SILENT"], recommendation: "Re-engage urgently..." }
  ]
}

Score formula: Recency 35% · Cadence 25% · Sentiment 20% · Response 10% · Momentum 10%. Grades: A ≥ 80 · B ≥ 60 · C ≥ 40 · D ≥ 20 · F < 20.

MCP Tool: get_relationship_graph

Returns the knowledge graph for a customer — contacts, companies, and their relationships. Auto-populated from every log_interaction call. No setup required.

get_relationship_graph({ slug: "acme-corp" })

// Returns:
{
  nodeCount: 4, edgeCount: 3,
  stakeholders: {
    champions:      [{ id: "person:alice@acme.com", name: "Alice", email: "alice@acme.com" }],
    blockers:       [],
    economicBuyers: [{ id: "person:cfo@acme.com",   name: "Thomas", email: "cfo@acme.com" }],
    allContacts:    [ ... ],
    missingRoles:   []          // or [{ role: "champion", urgency: "important", suggestion: "..." }]
  },
  nodes: [ ... ],  // full GraphNode[]
  edges: [ ... ]   // full GraphEdge[] with weight (0–1), sentiment, contactCount
}

Edge weight grows +0.05 per interaction (max 1.0). Edge types: WORKS_AT, IS_CHAMPION, IS_BLOCKER, IS_ECONOMIC_BUYER, KNOWS, INTRODUCED_BY, OWNS_DEAL, COMPETES_WITH.

Graph is stored in customers/<slug>/graph.json and erased by dxcrm gdpr erase.

MCP Tool: run_deal_agent

Analyze a specific deal and generate a prioritized action plan. Supports three autonomy levels — from read-only analysis to autonomous action execution.

run_deal_agent({
  slug: "acme-corp",
  dealName: "Q3 Renewal",
  autonomyLevel: "suggest",    // "observe" | "suggest" | "act"
  instruction: "Focus on close date risk",  // optional
  valueThreshold: 50000         // EUR — no auto-exec above this (default: 50000)
})

// Returns:
{
  assessment: "Deal in negotiation, close date approaching in 19 days...",
  riskLevel: "medium",
  plan: [{ step: 1, action: "Send final proposal", priority: "high", reason: "..." }],
  actionsQueued:   [ ... ],  // suggest/act mode: pending approval
  actionsExecuted: [ ... ],  // act mode: auto-executed
  trace: { timestamp, observation, plan, actionsConsidered, outcome }
}

Autonomy levels:

  • observe — read-only analysis, no side effects, no queue writes
  • suggest (default) — queues all actions in agent-queue.json for human review
  • act — auto-executes actions with confidence ≥ 0.7 and value < valueThreshold

Signals analyzed: deal health (A–F grade), relationship health per contact, stakeholder gaps (missing champion / economic buyer), recent interaction summary.

LLM fallback: rule-based analysis when ANTHROPIC_API_KEY is unset or LLM fails — always returns a valid result.

Glass-box trace: every decision is in result.trace — inspectable for EU AI Act Art. 13 compliance.

MCP Tool: approve_agent_action

Approve or reject a pending action from the deal agent queue. Find actionId in run_deal_agent response.

// Approve: executes the action immediately
approve_agent_action({
  slug: "acme-corp",
  actionId: "da_1748346900000_a3f7x2",
  approved: true
})
// → { success: true, actionId: "da_...", status: "executed" }

// Reject: marks action as rejected, no execution
approve_agent_action({
  slug: "acme-corp",
  actionId: "da_1748346900000_a3f7x2",
  approved: false
})
// → { success: true, actionId: "da_...", status: "rejected" }

Queue is persisted at customers/<slug>/agent-queue.json. Erased by dxcrm gdpr erase.

Supported action types: log_interaction, update_deal, alert, schedule_meeting.

MCP Tool: simulate_revenue

Monte Carlo pipeline revenue simulation with P10/P50/P90 confidence intervals. Adjusts deal win probabilities using relationship health (D12) and champion presence (D11).

simulate_revenue({ horizon: "quarter", iterations: 10000 })

// Returns:
{
  forecast: {
    p10: 145000, p50: 287500, p90: 412000,
    expected: 289300, stdDev: 82000,
    atRiskRevenue: 75000,
    byCloseMonth: { "2026-06": { p50: 120000, range: [80000, 165000] } },
    topRisks: [ "acme-corp/Enterprise License: health 38 — €75k at risk" ],
    sensitivityMap: { "Enterprise License": 56250 }
  },
  confidence: "P50 forecast: €287.5k with ±€133.5k uncertainty. 28% at risk.",
  dealCount: 5,
  horizon: "quarter"
}

Probability adjustment: Base stage probability + health adjustment (health 60 = neutral) + champion bonus (+5%). External signals ready for D18.

sensitivityMap: Expected revenue contribution per deal. Sort descending to find which deal matters most for the forecast.

topRisks: Top 5 at-risk deals (health < 60 or 14+ days no contact), sorted by forecast impact.

MCP Tool: get_playbook

Retrieve playbooks matching the current deal situation. Without deal context, returns all playbooks for the customer. Sorted by success rate (highest first). run_deal_agent uses this automatically.

get_playbook({ slug: "acme-corp", stage: "negotiation", value: 75000, daysSinceContact: 10 })

// Returns:
{
  matches: [{ name: "enterprise-renewal", score: 1.0, trigger: "deal_stage_negotiation AND value > 50000", successRate: 0.73, usedCount: 8, content: "..." }],
  totalPlaybooks: 3,
  slug: "acme-corp"
}

Trigger DSL: AND-only conditions. Tokens: deal_stage_<s>, value > N, value < N, days_stalled > N, days_stalled < N, health < N, health > N, no_champion, has_champion. Only score=1.0 matches returned.

MCP Tool: create_playbook

Create or update a playbook encoding proven tactics for a specific deal situation. Upserts by name. Stored at customers/<slug>/playbooks/<kebab-name>.md.

create_playbook({
  slug: "acme-corp",
  name: "enterprise-renewal",
  trigger: "deal_stage_negotiation AND value > 50000 AND days_stalled > 7",
  content: "# Enterprise Renewal\n\n## Steps\n1. Call economic buyer.",
  successRate: 0.73
})
// Returns: { success: true, playbook: { name, trigger, successRate, path } }

MCP Tool: list_playbooks

List all playbooks for a customer (metadata only — no body content for performance).

list_playbooks({ slug: "acme-corp" })
// Returns: { playbooks: [{ name, trigger, successRate, usedCount, lastUpdated }], count, slug }

MCP Tool: distill_playbook

Use LLM to extract a reusable playbook from a won or lost deal's interaction history. Run after every won or lost deal to build procedural memory. Analyzes interactions.md and writes a structured playbook file.

distill_playbook({ slug: "acme-corp", dealName: "Q3 Enterprise License", outcome: "won" })

// Returns:
{
  success: true,
  playbook: { name: "enterprise-q3-renewal", trigger: "deal_stage_negotiation AND value > 50000", successRate: 1.0, path: "..." },
  reasoning: "Deal won by ROI framing. Champion was CEO."
}

Fallback successRate: won → 1.0, lost → 0.0 when LLM omits the field. Error cases: missing interactions.md or unparseable LLM response.

MCP Tool: pursue_goal

Set a revenue or pipeline goal and get a decomposed action plan. Analyzes current pipeline P50 (Monte Carlo, D14), calculates the gap, and ranks deals by weighted leverage (value × probability × health). Persists goal to .agentic/goals.json. RBAC: manager+

pursue_goal({ goal: "Close €500k ARR this quarter", deadline: "2026-09-30" })

// Returns:
{
  goalId: "goal_1748697600000_a3f7x2",
  target: 500000,
  decomposition: {
    analysis: "Current pipeline P50: €287k. Gap: €213k. 3 deal(s) identified.",
    currentPipeline: 287000, gap: 213000,
    subGoals: [{ priority: 1, action: "Accelerate acme-corp/Enterprise License", targetDelta: 75000, nextStep: "..." }],
    probabilisticOutcome: "If all recommended deals close: ~€512k"
  }
}

Target parsing: €500k → 500000, $2M → 2000000, €1.5 million → 1500000. Goal type auto-inferred: revenue / pipeline / relationship / churn_prevention.

MCP Tool: get_goal_status

Get all active goals or a specific goal by ID. Returns progress, days remaining, and top sub-goals.

get_goal_status()                              // all active goals
get_goal_status({ goalId: "goal_abc123" })   // specific goal

// Returns:
{ goals: [{ id, description, target, progress, status, deadline, daysRemaining, subGoals }], activeCount, completedCount }

CLI: dxcrm goal set "..." --deadline YYYY-MM-DD · dxcrm goal status · dxcrm goal update <id> --progress N · dxcrm goal cancel <id>

MCP Tool: register_push_subscription

Register a real-time push subscription so providers send events to dxcrm within seconds — instead of polling every 30 minutes. Supports Gmail Pub/Sub, Microsoft Graph webhooks, and Slack Events API.

// Gmail Pub/Sub
register_push_subscription({
  provider: "gmail",
  slug: "acme-corp",
  webhookUrl: "https://myserver.com/webhooks/gmail",
  gmailTopicName: "projects/my-project/topics/gmail-push"
})

// Microsoft Graph
register_push_subscription({
  provider: "microsoft-graph",
  slug: "acme-corp",
  webhookUrl: "https://myserver.com/webhooks/microsoft",
  microsoftClientState: "my-hmac-secret"
})

// Slack Events
register_push_subscription({
  provider: "slack",
  slug: "acme-corp",
  webhookUrl: "https://myserver.com/webhooks/slack",
  slackTeamId: "T12345"
})

// Returns:
{ subscriptionId, provider, slug, status, expiresAt, warning? }

RBAC: admin only · Webhook endpoints: POST /webhooks/gmail · ALL /webhooks/microsoft · POST /webhooks/slack

CLI: dxcrm push register <slug> --provider gmail --webhook-url <url>

MCP Tool: get_push_status

Show all active push subscriptions with expiry countdown, events processed, and renewal status.

get_push_status()                              // all subscriptions
get_push_status({ slug: "acme-corp" })       // filter by customer
get_push_status({ provider: "gmail" })       // filter by provider

// Returns:
{
  subscriptions: [{ id, provider, slug, status, expiresInHours, needsRenewal, eventsProcessed }],
  summary: { total, active, expiringSoon, expired }
}

needsRenewal: true when fewer than 24 hours until expiry. Gmail subscriptions auto-renew via daemon cron at 06:00 daily.

CLI: dxcrm push status · dxcrm push revoke <id> · dxcrm push renew --all


Gmail Integration

Requires Google OAuth2 credentials.
# Place OAuth credentials:
.agentic/gmail-credentials.json   # OAuth2 client credentials
.agentic/gmail-token.json         # Access token (auto-refreshed)

# Per-customer Gmail query (in customers/acme-corp/sources.json):
{ "gmail": { "query": "from:acme.com OR to:acme.com", "enabled": true } }

Gmail sync uses push notifications (registerGmailWatch) for real-time delivery, with fetchNewMessagesFromHistory on each webhook. MIME parsing handles quoted replies and base64url-encoded bodies. Dedup by message ID + normalized subject.

Microsoft Outlook Integration

# Write your Microsoft Graph access token:
echo '{"accessToken":"ey..."}' > .agentic/microsoft-token.json

dxcrm sync --provider microsoft

# sourceRef format: microsoft://message/<message-id>

Uses the Microsoft Graph calendarView API with @odata.nextLink pagination. Supports both accessToken (camelCase) and access_token (snake_case) in the token file.

Google Drive Integration

dxcrm sync --provider google-drive

# Auth via service account:
export GOOGLE_SERVICE_ACCOUNT_KEY='{"type":"service_account","project_id":"..."}'

Exports Google Docs as plain text via the Drive export API. Tracks modifiedTime for incremental sync. All file content is indexed into LanceDB under the matching customer slug.

Microsoft Teams & Google Meet

# Teams (requires OnlineMeetings.Read + CallRecords.Read.All)
dxcrm sync --provider teams-transcripts

# Google Meet (requires service account with Meet API)
dxcrm sync --provider google-meet

Both providers use page-token/nextLink pagination and write transcripts as Meeting interactions.

HubSpot Integration (v4 API)

dxcrm import --from hubspot --mode api --token $HUBSPOT_TOKEN

Uses the HubSpot v4 Associations API to fetch all engagements (notes, calls, emails, meetings) linked to each contact. Cursor-based pagination handles any account size. Rate-limit retry via RateLimiter (10 req/s). Dedup by sourceRef.

Required HubSpot private app scopes

  • crm.objects.contacts.read
  • crm.objects.engagements.read
  • crm.associations.read

Salesforce Integration

dxcrm import --from salesforce --mode api \
  --token $SFDC_TOKEN --url https://myco.salesforce.com

Two-pass: Contact SOQL → customers, Task SOQL (linked via WhoId) → interactions. Also supports Bulk API v2 for large exports: POST job → poll until jobComplete → stream CSV with Sforce-Locator pagination.

Pipedrive Integration

dxcrm import --from pipedrive --mode api \
  --token $PIPEDRIVE_TOKEN --url https://myco.pipedrive.com

Uses cursor pagination via additional_data.next_cursor (Pipedrive v2). Persons → customers, Activities → interactions.

Other CRM Connectors

All connectors implement the CrmConnector interface and support the same --from <name> --mode api import syntax:

CRMFlagAPIPagination
Microsoft Dynamics 365--from dynamicsOData REST v9.2@odata.nextLink
Zoho CRM--from zohoREST v3more_records cursor
Monday.com--from mondayGraphQLcursor
Freshsales--from freshsalesREST v2page
Zendesk Sell--from zendeskREST v2page
SugarCRM--from sugarcrmREST v11offset
Copper CRM--from copperREST v1page

AI Framework Configuration

dxcrm init handles this automatically. Manual config if needed:

Claude Code (~/.claude.json)

{
  "mcpServers": {
    "datasynx-opencrm": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/node_modules/@datasynx/agentic-crm/dist/mcp.js"]
    }
  }
}

Grok Build (~/.grok/user-settings.json)

Note: Grok uses an array for mcpServers, not an object map.

{
  "mcpServers": [
    {
      "name": "datasynx-opencrm",
      "transport": {
        "type": "stdio",
        "command": "node",
        "args": ["/path/to/node_modules/@datasynx/agentic-crm/dist/mcp.js"],
        "env": { "DXCRM_DATA_DIR": "/path/to/.dxcrm" }
      }
    }
  ]
}

Team / HTTP Mode

{
  "mcpServers": {
    "datasynx-opencrm": {
      "type": "http",
      "url": "http://vm-ip:3847/mcp"
    }
  }
}

Plugin: Slack

Get a Slack message after every interaction and deal update.

import { createSlackPlugin } from "datasynx-opencrm/dist/plugins/slack.js";
import { registerPlugin } from "datasynx-opencrm/dist/core/plugin-registry.js";

registerPlugin(createSlackPlugin({
  webhookUrl: process.env.SLACK_WEBHOOK_URL!,
  channel: "#crm-updates"    // optional
}));

The plugin hooks afterLogInteraction and afterDealUpdate. Messages include customer name, interaction type, summary, and next steps.

Plugin: Stripe

Adds get_stripe_context MCP tool — look up subscription revenue for any customer.

import { createStripePlugin } from "datasynx-opencrm/dist/plugins/stripe.js";

registerPlugin(createStripePlugin({
  apiKey: process.env.STRIPE_SECRET_KEY!
}));

// AI agent can then call:
get_stripe_context({ slug: "acme-corp" })
// Returns: { customer, subscriptions[], mrr, currency }

Plugin: Linear

Adds get_linear_issues MCP tool — fetch open engineering issues linked to a customer.

import { createLinearPlugin } from "datasynx-opencrm/dist/plugins/linear.js";

registerPlugin(createLinearPlugin({
  apiKey: process.env.LINEAR_API_KEY!
}));

// AI agent can then call:
get_linear_issues({ slug: "acme-corp" })
// Returns: { issues: [{ id, title, status, priority, url }] }

Uses the Linear GraphQL API. Issues are matched by customer name or domain tag.

Custom Plugins

Implement the DxcrmPlugin interface:

import { registerPlugin, DxcrmPlugin } from "datasynx-opencrm/dist/core/plugin-registry.js";

const myPlugin: DxcrmPlugin = {
  name: "my-plugin",
  version: "1.0.0",
  description: "My custom integration",
  mcpTools: [],           // additional MCP tools this plugin exposes
  onInstall: async () => { /* setup logic */ },
  onUninstall: async () => { /* teardown logic */ },
};

registerPlugin(myPlugin);

Team Setup

Run one shared server on a VM. All team members connect via URL.

1. Start Server (VM)

dxcrm server start --data /mnt/crm-data --port 3847

2. Configure Roles

dxcrm rbac set alice admin
dxcrm rbac set bob manager
dxcrm rbac set carol rep

3. Each Team Member

dxcrm init --team http://vm-ip:3847/mcp
export DXCRM_ACTOR=alice   # Add to ~/.bashrc or ~/.zshrc

Role-Based Access Control

Config: .agentic/rbac.json. Actor: DXCRM_ACTOR env var. When no rbac.json exists, all calls are allowed (solo mode — backward compatible).

{ "actors": { "alice": "admin", "bob": "manager", "carol": "rep" }, "default": "rep" }

RBAC is enforced at MCP tool call time. Denied calls return an error with the actor name and required role.

GDPR Compliance

Datasynx Agentic CRM never sends data to external servers. All data stays on your machine — eliminating the cloud GDPR risk that affects every SaaS CRM.

# Always dry-run first:
dxcrm gdpr erase acme-corp

# Permanent deletion after review:
dxcrm gdpr erase acme-corp --confirm

# Audit trail of all erasures:
dxcrm gdpr list-erasures

Erasure deletes: customers/<slug>/ directory (recursive), LanceDB vector table for the customer, audit entry in audit.log, record in gdpr-erasures.json.

Field Encryption (AES-256-GCM)

Sensitive fields can be encrypted at rest using AES-256-GCM with scrypt key derivation.

import { encryptField, decryptField } from "datasynx-opencrm/dist/core/encryption.js";

const secret = process.env.DXCRM_ENCRYPTION_SECRET!;  // 32+ char secret

// Encrypt before writing to disk:
const encrypted = await encryptField(secret, "sensitive value");
// encrypted = Buffer (iv + authTag + ciphertext)

// Decrypt on read:
const plain = await decryptField(secret, encrypted);

Key derivation: scrypt(secret, salt, 32). Each field gets a unique 16-byte IV. Authentication tag prevents tampering. Set DXCRM_ENCRYPTION_SECRET env var to enable.

Webhook Receiver

Receive and verify signed webhooks from external systems (Stripe, GitHub, custom).

import { verifyHmacSha256, WebhookQueue } from "datasynx-opencrm/dist/core/webhook-receiver.js";

// Verify HMAC-SHA256 signature (timing-safe):
const ok = verifyHmacSha256(secret, payload, signature);

// Queue-based delivery with dedup:
const queue = new WebhookQueue();
queue.enqueue({ provider: "stripe", payload, signature });

// Stripe-specific verification (checks timestamp tolerance):
import { verifyStripeSignature } from "datasynx-opencrm/dist/core/webhook-receiver.js";
verifyStripeSignature(webhookSecret, rawBody, stripeSignatureHeader);

SSO via WorkOS

Enterprise SSO using WorkOS as the identity provider. Supports SAML and OIDC via any major IdP (Okta, Azure AD, Google Workspace, etc.).

# Required environment variables:
export WORKOS_API_KEY=sk_...
export WORKOS_CLIENT_ID=client_...
export WORKOS_REDIRECT_URI=https://your-app.com/auth/callback
export WORKOS_ORGANIZATION_ID=org_...
import { getSsoAuthorizationUrl, authenticateWithCode, isSsoConfigured }
  from "datasynx-opencrm/dist/core/sso.js";

// Check if SSO is configured:
if (isSsoConfigured()) {
  // Redirect user to IdP:
  const url = getSsoAuthorizationUrl();

  // Exchange code for profile after callback:
  const { profile } = await authenticateWithCode(code);
  // profile = { id, email, firstName, lastName, organizationId }
}

Map SSO user email to DXCRM_ACTOR for RBAC attribution. Combine with dxcrm rbac set <email> <role>.

Security Report

dxcrm security-report
dxcrm security-report --output sec-report.md

Generates a Markdown questionnaire covering: data storage location, authentication, AES-256-GCM encryption at rest, append-only audit trail, network call inventory, GDPR erasure controls, SOC 2 readiness, and dependency management. Useful for procurement and security reviews.


Schema: main_facts.md

---
name: Acme Corp              # required
domain: acme.com
email: ceo@acme.com
phone: "+1 555 0100"
industry: SaaS
relationship_stage: active   # prospect | active | churned | paused
deal_value: 50000
currency: EUR
primary_contact: Alice Smith
timezone: Europe/Berlin
tags: [enterprise, strategic]
created: 2026-01-15
updated: 2026-05-27
---

# Customer: Acme Corp

Any free-form notes here are preserved by update_customer_facts.

Schema: interactions.md

## 2026-05-27 · Call · inbound
**With:** Alice Smith
**Summary:** Discussed Q3 renewal. Budget confirmed at €50k.
**Next Steps:**
- [ ] Send proposal by Friday
- [ ] CC legal team
**Source:** gmail://message/abc123
**Synced:** 2026-05-27T09:14:00Z
---

Entries are newest-first. Written by log_interaction(), summarize_meeting(), and all sync engines. Deduplication via sourceRef prevents re-importing the same email or transcript.

Schema: pipeline.md

# Pipeline — Acme Corp

| Deal | Stage | Value | Currency | Probability | Close Date | Updated | Notes |
|---|---|---|---|---|---|---|---|
| Enterprise License 2026 | negotiation | 75000 | EUR | 75 | 2026-09-30 | 2026-05-27 | Budget confirmed |

Stages are configurable via dxcrm stages set. Default stages: lead · qualified · proposal · negotiation · won · lost.

Full CLI Reference — 69 commands

CommandDescription
dxcrm agentManage per-customer agents
dxcrm approvalsHuman-in-the-loop approval queue
dxcrm archiveArchive old interactions out of the hot interactions.md (search stays intact)
dxcrm askAsk your CRM a natural-language question
dxcrm attachAttach a file to a customer (copies to customers/<slug>/attachments/)
dxcrm auditShow CRM audit trail — who changed what and when
dxcrm autofillExtract structured CRM fields from a transcript file
dxcrm backupBackup customers/ + .agentic/ directories
dxcrm bookingNative meeting scheduler (availability + round-robin)
dxcrm churnChurn early-warning (relationship-health based)
dxcrm coachConversation-intelligence: analyze a call transcript
dxcrm compliancePrivacy/compliance posture (AI-Act Art. 50, local-LLM, PII, guardrails)
dxcrm createCreate a new customer
dxcrm daemonManage the background sync daemon
dxcrm dashboardRead-only web dashboard (forecast, funnel, velocity, goals)
dxcrm doctorRun self-diagnostics: data integrity, temp files, log errors, backups — or per-provider integration readiness
dxcrm enrichEnrich a customer's facts (offline domain-from-email + plugins)
dxcrm eval-embeddingsMeasure retrieval quality (recall@k, MRR) of the configured embedding model
dxcrm fieldsManage custom fields (metadata-driven extensibility)
dxcrm forecastWeighted pipeline forecast — total, by stage, and per owner (RBAC-aware)
dxcrm formInbound lead-capture web forms (POST /forms/:id)
dxcrm gdprGDPR compliance tools
dxcrm goalManage goals and action plans
dxcrm guideFull CRM documentation in terminal
dxcrm hygieneData-quality scanning
dxcrm identityIdentity resolution / deduplication (CDP)
dxcrm importImport customers and interactions from HubSpot, Salesforce, Pipedrive, or CSV
dxcrm inboxOmnichannel conversations inbox (web-chat, WhatsApp)
dxcrm initInitialize CRM and configure AI frameworks
dxcrm kbManage the knowledge base
dxcrm leadscorePredictive lead scoring (logistic regression on won/lost history)
dxcrm listList all customers
dxcrm logsView and analyze the structured application log
dxcrm mailboxSync any IMAP mailbox (Gmail, Outlook, custom) into the CRM
dxcrm mcpMCP server management and documentation
dxcrm memoryAgent memories (per customer + global)
dxcrm metricsCommand-center metrics from the audit trail
dxcrm nbaNext-best-action recommendations for a customer
dxcrm objectManage custom objects (runtime-defined entities, no-migration)
dxcrm pipelinePipelines: create named pipelines, daily snapshots and 'what changed?' diffs
dxcrm pluginManage dxcrm plugins
dxcrm policyAutonomy policy per tool/customer (auto|approve|block)
dxcrm portalCustomer self-service portal (tickets & public KB)
dxcrm productReusable product & price catalog for quotes
dxcrm pushManage real-time push subscriptions (Gmail Pub/Sub, MS Graph, Slack Events)
dxcrm quoteManage customer quotes
dxcrm rbacManage role-based access control
dxcrm reindexRebuild a customer's vector index from stored text (after an embedding-model switch)
dxcrm restoreRestore from backup zip
dxcrm security-reportGenerate security questionnaire answer document for enterprise reviews
dxcrm segmentManage customer segments (marketing lists)
dxcrm sequenceManage email sequences
dxcrm serverStart the shared HTTP MCP server for team use
dxcrm sessionManage the active customer session
dxcrm sopStandard Operating Procedures (global / per customer)
dxcrm stagesManage custom pipeline stages
dxcrm statusShow CRM status: daemon, sync state, customer counts
dxcrm surveyManage NPS/CSAT surveys
dxcrm syncSync Gmail and transcripts for a customer
dxcrm taskFirst-class tasks & reminders with due dates
dxcrm templateManage email templates
dxcrm ticketManage support tickets
dxcrm toneCustomer tonality profiles (per customer + global)
dxcrm transcriptsAuto-discovered meeting transcripts (Teams/Meet): subscriptions & unmatched queue
dxcrm usageLLM token usage & cost (per customer)
dxcrm validateValidate all customer data against schemas
dxcrm vaultLocal encrypted credential vault (AES-256-GCM)
dxcrm webhookManage outbound webhooks (event-driven integrations)
dxcrm workflowDeclarative if-then automation rules over internal events

Full MCP Tool Reference — 82 tools

ToolPurposeRBAC
get_capabilitiesReturns this guide — understand what the CRM can doany
get_active_sessionCheck which customer session is currently activeany
get_customer_contextFull LLM-ready briefing for a customer (last 10 interactions, pipeline, contacts)any (rep: own only)
search_customer_knowledgeHybrid vector + full-text search across emails and transcripts for a customerany
list_customersList all customers with stage, last interaction date, and deal valueany (rep: own only)
log_interactionWrite a new interaction entry (call, email, meeting, note) — immediately searchablerep+
update_dealCreate or update a deal — upserts by name; pipeline-aware stage validation (pipelineId)rep+
export_customerExport all customer data (incl. attachment contents) as JSON or Markdownadmin
update_customer_factsUpdate fields in customer profile (domain, contact, stage, tags)admin
get_deal_healthScore deal health 0–100 (A–F): weighted blend of stakeholder coverage, recency, stage dwell, sentiment, probability, close dateany
get_pipeline_forecastAggregate weighted pipeline revenue, grouped by stage, owner and pipeline (RBAC-aware)any
summarize_meetingLLM-summarize a transcript and log it as a Meeting interactionrep+
get_pipeline_stagesPipeline stages — per pipeline (#47); without pipelineId also lists all pipelinesany
get_market_intelligenceSemantic search across all customers for patterns and common topicsany
get_relationship_graphStakeholder map: champions, blockers, economic buyers, warm intro pathsany
get_relationship_healthHealth scores (0–100, A–F, trend) per contact with decay detection and risk flagsany
run_deal_agentAnalyze deal and generate prioritized action plan (observe/suggest/act autonomy levels)rep+
approve_agent_actionApprove or reject a pending action from the deal agent queuerep+
simulate_revenueMonte Carlo pipeline forecast — P10/P50/P90, sensitivity map, at-risk revenueany
get_org_intelligenceStakeholder map with champions, buyers, blockers, health scores, risk flags, recommendationany
get_playbookRetrieve playbooks matching current deal situation (trigger-matched, sorted by success rate)any
create_playbookCreate or update a playbook with trigger DSL encoding proven tacticsrep+
list_playbooksList all playbooks for a customer (metadata only, no body)any
distill_playbookLLM-extract a reusable playbook from a won or lost deal's interaction historyrep+
pursue_goalSet a revenue/pipeline goal and get an AI-decomposed action plan with sub-goalsmanager+
get_goal_statusGet all active goals or a specific goal with progress, days remaining, sub-goalsany
register_push_subscriptionRegister real-time push subscription (Gmail Pub/Sub, MS Graph, Slack Events)admin
get_push_statusShow all push subscriptions: expiry, events processed, renewal needsany
open_deal_roomMulti-agent deal brief: graph + health + deal health + simulation + playbook in one callany
get_proactive_briefingDaily briefing: urgent alerts, opportunities, P50/P90 forecast, top actionany
list_email_templatesList all saved email templates with id, name, category, subjectany
get_email_templateRetrieve a single email template with full body and detected variablesany
draft_emailDraft a personalized email from a template with auto-filled customer variablesrep+
enroll_in_sequenceEnroll a contact in a multi-step email sequencerep+
list_sequence_enrollmentsList active sequence enrollments filtered by customer or statusany
unenroll_from_sequencePause (soft-unenroll) a contact from an active sequencerep+
list_sequencesList all defined email sequences with step count and enrollment countany
generate_quoteGenerate a professional HTML quote with line items, VAT, subtotal, totalrep+
get_quote_statusRetrieve a generated quote by number or list all quotes for a customerany
send_quoteMint the public accept/decline quote link (e-signature, optional Stripe payment link)rep+
create_productCreate/update a catalog product (upsert by SKU) for reuse in quotesmanager+
list_productsList catalog products (SKU, name, price, tax, recurring)any
update_productUpdate fields of a catalog product by SKUmanager+
get_booking_linkGet a Calendly booking link for a customer — optionally pre-fills name/emailrep+
create_booking_pageNative scheduler: public booking page with real free slots + round-robin (#53)manager+
create_ticketCreate a support ticket — auto-SLA due date + skills-based auto-routing (#59)rep+
update_ticketUpdate ticket status or assignee (resolved auto-sets resolution date)rep+
list_ticketsList tickets filtered by customer, status, priority, or assigneeany
close_ticketClose a ticket and optionally log resolution as an interactionrep+
create_taskCreate a first-class task / dated reminder ("remind me Friday about Acme")rep+
list_tasksList tasks — "what is due today?" (due: today/overdue, slug, assignee, status), RBAC-awareany
complete_taskMark a task as donerep+
snooze_taskDefer a task; it resurfaces on the given daterep+
get_email_engagementOutbound email opens/clicks/replies + reply latency per contact (tracking default off)any
create_workflowDeclarative if-then automation rule on internal events (policy-gated, audited)manager+
list_workflowsList automation rules with run countersany
toggle_workflowEnable/disable an automation rulemanager+
get_dashboard_linkToken-secured read-only web dashboard (forecast, funnel, velocity, goals)any
create_formEmbeddable lead-capture web form (honeypot, rate-limit, optional double-opt-in)manager+
list_formsList inbound lead-capture formsany
get_portal_linkMagic link to the customer self-service portal (own tickets + public KB)rep+
list_conversationsList omnichannel inbox threads (web-chat, WhatsApp) by status/slug/channelany
reply_conversationReply on an inbox conversation; delivers back on the channel, can closerep+
assign_conversationAssign/link/close or escalate an inbox conversation to a ticketrep+
send_nps_surveyGenerate NPS/CSAT survey token + HTML email draft (does not send automatically)rep+
get_survey_resultsNPS score, promoter/passive/detractor breakdown, all responses for a surveyany
search_knowledge_baseFull-text search across KB articles (title, body, tags) with category and public filtersany
create_kb_articleCreate a new knowledge base article stored as Markdown in .agentic/knowledge-base/rep+
backup_nowTrigger immediate backup of customers/ + .agentic/ with SHA-256 integrity checkadmin
list_backupsList available backups with date, size, verification status, and customer countany
trigger_syncForce immediate Gmail sync for one or all customersrep+
get_audit_logRead audit log — all write operations with actor, tool, customeradmin
get_logsQuery/aggregate the structured application log (level, component, errors)admin
get_diagnosticsSelf-diagnostic health check (data integrity, temp files, log errors, backups)admin
get_pipeline_changesPipeline time-travel: what changed (won/lost/moved/value) since a dateany
get_pipeline_velocityStage dwell times, sales cycle, and stalled deals from snapshot historyany
get_pipeline_funnelConversion funnel & win rate: where deals leak out of the pipelineany
get_vault_linkGet a browser link to the local credential-vault GUI — enter/manage secrets without sending them through the LLMadmin
define_custom_objectDefine a runtime custom object type with typed fields (no migration)admin
create_recordCreate a record of a custom object (validated against its schema)rep+
list_recordsList records of a custom objectany
list_custom_objectsList all defined custom objects and their schemasany