CRM MCP Server

$git clone <repository-url> && cd mcp-crm && npm install && npm run build && npm run start:crm
README.md

A production-ready MCP server for CRM built with TypeScript and SQLite.

CRM MCP Server

A production-ready Model Context Protocol (MCP) server for Customer Relationship Management (CRM) functionality, built with TypeScript and SQLite.

šŸš€ Features

Core CRM Tools (18 Total)

  • Contact Management: Add, update, search, list, and archive contacts
  • Organization Management: Filter contacts by organization
  • Contact History: Track, update, and manage interactions, calls, emails, meetings, and notes
  • Entry Management: Full CRUD operations on contact history entries
  • Todo Management: Add, update, filter, and track action items for contacts
  • Data Export: CSV exports for contacts, history, and full CRM data
  • Recent Activities: Track and retrieve recent CRM activities

Technical Excellence

  • āœ… 100% Test Coverage - Comprehensive 3-phase test suite with database isolation
  • āœ… Production Ready - Robust error handling and input validation
  • āœ… High Performance - Optimized for bulk operations and large datasets
  • āœ… Security Focused - SQL injection protection and input sanitization
  • āœ… Edge Case Handling - Thoroughly tested boundary conditions
  • āœ… Database Management - Safe archive/restore system with zero data loss
  • āœ… Entry Management - Complete contact history CRUD with database scripts
  • āœ… Modular Testing - Isolated test phases with automatic state management

šŸ“¦ Installation

Prerequisites

  • Node.js 18+
  • npm or yarn

Setup

# Clone the repository
git clone <repository-url>
cd mcp-crm

# Install dependencies
npm install

# Build the project
npm run build

# Start the server
npm run start:crm

šŸ”§ Configuration

MCP Integration

Add to your .cursor/mcp.json or MCP client configuration:

{
  "mcpServers": {
    "mcp-crm": {
      "command": "node",
      "args": ["./build/crm-server.js"],
      "cwd": "/path/to/mcp-crm"
    }
  }
}

Database

  • Location: data/crm.sqlite
  • Type: SQLite 3
  • Auto-created: Database and tables are automatically initialized
  • Git Ignored: Database files and archives are excluded from version control for security and size reasons

šŸ—„ļø Database Management

The CRM system includes powerful database management commands for safely resetting, archiving, and restoring your data.

Quick Commands

# Reset database (archive current, create fresh)
npm run db:reset

# Archive current database (backup without reset)
npm run db:archive

# List all archived databases
npm run db:list

# Show current database statistics
npm run db:stats

# Contact entry management
npm run db:list-entries        # List all contact entries
npm run db:list-entries 1      # List entries for contact ID 1
npm run db:list-entries "" 10  # List 10 most recent entries (all contacts)
npm run db:view-entry 1        # View detailed entry
npm run db:delete-entry 1      # Delete entry by ID
npm run db:update-entry 1 content "Updated content"  # Update entry field

# Show help for database commands
npm run db:help

Detailed Usage

Reset Database

Safely archives your current database and creates a fresh empty one.

# Basic reset
npm run db:reset

# Reset with reason (helpful for tracking)
npm run db:reset cleanup
npm run db:reset "testing-new-features"

What happens:

  1. šŸ“¦ Current database is archived with timestamp
  2. šŸ—‘ļø Current database is removed
  3. āœ… Fresh empty database is created
  4. šŸ›”ļø Your data is safely preserved in archives
Archive Database

Create a backup without resetting (keeps current database).

# Basic archive
npm run db:archive

# Archive with reason
npm run db:archive "before-major-update"
List Archives

View all your database backups.

npm run db:list

Example output:

šŸ“¦ Database Archives
==================================================
šŸ“ crm-backup-2025-06-04T19-15-35-cleanup.sqlite
   Created: 6/4/2025, 7:15:35 PM
   Size: 45.32 KB
   Path: /data/archives/crm-backup-2025-06-04T19-15-35-cleanup.sqlite

šŸ“ crm-backup-2025-06-03T14-22-18.sqlite
   Created: 6/3/2025, 2:22:18 PM
   Size: 42.17 KB
   Path: /data/archives/crm-backup-2025-06-03T14-22-18.sqlite
Restore from Archive

Restore a previous database from archive.

npm run db:list  # First, see available archives
# Then restore specific archive (replace with actual filename):
npx tsx scripts/database-manager.ts restore crm-backup-2025-06-04T19-15-35.sqlite

What happens:

  1. šŸ“¦ Current database is archived (safety backup)
  2. šŸ”„ Selected archive is restored as current database
  3. āœ… Your data is back to the archived state
Database Statistics

Check your current database status.

npm run db:stats

Example output:

šŸ“Š Current Database Statistics
==================================================
Contacts: 546
Entries: 1,234
Size: 45.32 KB

Contact Entry Management

Manage contact history entries with full CRUD operations.

# List

Tools (7)

contact_managementAdd, update, search, list, and archive contacts.
organization_managementFilter contacts by organization.
contact_historyTrack, update, and manage interactions, calls, emails, meetings, and notes.
entry_managementFull CRUD operations on contact history entries.
todo_managementAdd, update, filter, and track action items for contacts.
data_exportCSV exports for contacts, history, and full CRM data.
recent_activitiesTrack and retrieve recent CRM activities.

Configuration

claude_desktop_config.json
{
  "mcpServers": {
    "mcp-crm": {
      "command": "node",
      "args": ["./build/crm-server.js"],
      "cwd": "/path/to/mcp-crm"
    }
  }
}

Try it

→Add a new contact named John Doe from Acme Corp with his email and phone number.
→Show me the recent interaction history for the contact with ID 1.
→Create a todo item to follow up with Sarah Jenkins next Tuesday regarding the contract.
→Export all my CRM contacts and interaction history to a CSV file.
→Search for all contacts associated with the organization 'TechFlow Inc'.

Frequently Asked Questions

What are the key features of CRM MCP Server?

18 Core CRM Tools covering contact, organization, and todo management.. SQLite 3 database with automatic initialization and safe archive/restore system.. Full CRUD operations for contact history entries and interaction tracking.. Data export capabilities for CSV generation of contacts and history.. Production-ready architecture with 100% test coverage and SQL injection protection..

What can I use CRM MCP Server for?

Local-first contact management for individuals or small teams who want to keep data private.. Automated interaction logging where an AI assistant records meeting notes and emails into a structured database.. Sales pipeline tracking by managing todos and follow-up actions directly through a chat interface.. Data analysis and reporting by exporting CRM history to CSV for external processing..

How do I install CRM MCP Server?

Install CRM MCP Server by running: git clone <repository-url> && cd mcp-crm && npm install && npm run build && npm run start:crm

What MCP clients work with CRM MCP Server?

CRM MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Use CRM MCP Server with Conare

Manage MCP servers visually, upload persistent context, and never start from zero with Claude Code & Codex.

Try Free