CRM MCP Server
About
A production-ready MCP server for Customer Relationship Management (CRM) functionality, built with TypeScript and SQLite.
Details
- Author
- nxt3d
- Categories
- Database, Other
Jump to
Setup
Install CRM MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/nxt3d/mcp-crm
Follow the installation instructions in the repository README, then restart your MCP client.
A production-readyModel Context Protocol (MCP) serverfor Customer Relationship Management (CRM) functionality, built with TypeScript and SQLite.
- 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
- ✅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
# 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
Add to your.cursor/mcp.jsonor MCP client configuration:
{ "mcpServers": { "mcp-crm": { "command": "node", "args": ["./build/crm-server.js"], "cwd": "/path/to/mcp-crm" } } }
- 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
The CRM system includes powerful database management commands for safely resetting, archiving, and restoring your data.
# 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
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"
- 📦 Current database is archived with timestamp
- 🗑️ Current database is removed
- ✅ Fresh empty database is created
- 🛡️ Your data is safely preserved in archives
Create a backup without resetting (keeps current database).
# Basic archive npm run db:archive # Archive with reason npm run db:archive "before-major-update"
📦 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 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
- 📦 Current database is archived (safety backup)
- 🔄 Selected archive is restored as current database
- ✅ Your data is back to the archived state
📊 Current Database Statistics ================================================== Contacts: 546 Entries: 1,234 Size: 45.32 KB
Manage contact history entries with full CRUD operations.
# List contact entries npm run db:list-entries # All entries (newest first) npm run db:list-entries 1 # All entries for contact 1 npm run db:list-entries "" 10 # 10 most recent entries (all contacts) npm run db:list-entries 1 5 # 5 most recent entries for contact 1 # View detailed entry npm run db:view-entry 2 # View entry ID 2 with full content # Update entry npm run db:update-entry 2 content "New content here" # Update content npm run db:update-entry 2 subject "New subject" # Update subject npm run db:update-entry 2 entry_type note # Update type # Delete entry npm run db:delete-entry 2 # Delete entry ID 2 (with confirmation)
- entry_type: call, email, meeting, note, task
- subject: Brief title/subject of the entry
- content: Detailed content of the entry
📝 Contact Entries Showing 3 most recent entries (limited to 10) ================================================================================ Entry #5 (Jane Smith) Type: CALL Subject: Follow-up discussion Date: 2025-06-04 15:30:00 Content: Discussed project requirements and timeline. Next meeting scheduled... Entry #4 (John Doe) Type: EMAIL Subject: Proposal sent Date: 2025-06-04 14:15:00 Content: Sent project proposal via email. Awaiting feedback by Friday...
Archives are stored indata/archives/with descriptive names:
- crm-backup-2025-06-04T19-15-35.sqlite(automatic timestamp)
- crm-backup-2025-06-04T19-15-35-cleanup.sqlite(with reason)
- crm-backup-2025-06-04T19-15-35-before-restore.sqlite(automatic safety backup)
- ✅Never Deletes Data: All operations archive before making changes
- ✅Automatic Timestamps: Every archive is uniquely named
- ✅Safety Backups: Restore operations backup current state first
- ✅Reason Tracking: Optional reasons help track why archives were made
- ✅Easy Recovery: Simple commands to restore any previous state
// Via MCP call { "name": "add_contact", "arguments": { "name": "John Doe", "organization": "Acme Corp", "job_title": "Software Engineer", "email": "john.doe@acme.com", "phone": "+1-555-0123", "notes": "Interested in our enterprise solution" } }
{ "name": "search_contacts", "arguments": { "query": "Acme" } }
{ "name": "add_contact_entry", "arguments": { "contact_id": 1, "entry_type": "call", "subject": "Discovery Call", "content": "Discussed requirements and pricing. Follow up in 1 week." } }
{ "name": "add_todo", "arguments": { "contact_id": 1, "todo_text": "Follow up on pricing discussion", "target_date": "2025-06-15T10:00:00Z" } }
// Get all incomplete todos { "name": "get_todos", "arguments": {} } // Get todos due in next 7 days { "name": "get_todos", "arguments": { "days_ahead": 7 } } // Get todos for specific contact { "name": "get_todos", "arguments": { "contact_id": 1, "include_completed": true } }
// Export all todos to CSV { "name": "export_todos_csv", "arguments": {} }
{ "name": "update_contact_entry", "arguments": { "entry_id": 2, "subject": "Updated Discovery Call", "content": "Discussed requirements and pricing. Client requested additional features. Follow up scheduled for next Tuesday." } }
# Comprehensive test suite (recommended) - uses database isolation npm run test:comprehensive # Individual test phases: # Database management tests npm run test:db # Core functionality tests (Phase B) cd tests && npx tsx run-phase-b-tests.ts # Advanced tests - edge cases and performance (Phase C) cd tests && npx tsx run-phase-c-tests.ts # Legacy comprehensive test runner cd tests && npx tsx run-all-tests.ts
The new comprehensive test suite leverages our database management scripts for:
- 🔒 Complete Isolation: Each test phase gets a fresh database
- 📦 Automatic Archiving: All test data is preserved in timestamped archives
- 🔄 State Management: Clean setup and teardown between test phases
- 📊 Comprehensive Reporting: Detailed reports with performance metrics
- Infrastructure Testing: Database Management (6/6 tests, 100% coverage)
- Core Features Testing: All 13 CRM tools (3 suites, 100% coverage)
- Quality Assurance Testing: Edge cases and performance validation (2 suites, 100% coverage)
- Overall: 3 test phases with complete database isolation and lifecycle testing
- 🏗️ Infrastructure- Database management, archiving, and state control
- ⚙️ Core Features- Contact management, history tracking, and data export
- 🔍 Quality Assurance- Edge cases, error handling, and performance validation
- Test Suite Execution: ~20 seconds for complete comprehensive testing
- Database Operations: Sub-second response times for all management commands
- Test Isolation: Complete database reset between phases in <1 second
- Archive Operations: Automatic timestamped backups with zero data loss
- Contact Creation: 2100+ contacts/second
- Search Operations: <1ms average response time
- Bulk Operations: 100% success rate across all batch sizes
- Export Operations: 40+ KB/ms throughput
mcp-crm/ ├── src/ │ └── crm-server.ts # Main MCP server implementation ├── scripts/ │ └── database-manager.ts # Database management utilities ├── tests/ │ ├── scenarios/ # Test scenarios (including DB management) │ ├── client/ # Test client utilities │ └── run-*.ts # Test runners ├── data/ │ ├── crm.sqlite # SQLite database │ └── archives/ # Database archive backups ├── build/ # Compiled JavaScript └── docs/ # Documentation
npm run build # Compile TypeScript npm run watch # Watch mode for development npm run clean # Clean build directory npm run dev # Development mode # Database management npm run db:reset # Reset database (archive + fresh) npm run db:archive # Archive current database npm run db:list # List archived databases npm run db:stats # Show database statistics npm run db:help # Database management help # Contact entry management npm run db:list-entries # List contact entries (with optional contact_id and limit) npm run db:view-entry # View detailed contact entry by ID npm run db:delete-entry # Delete contact entry by ID npm run db:update-entry # Update contact entry by ID # Testing npm run test:db # Run database management tests npm run test:comprehensive # Run all tests with database isolation (recommended) npm run test:all # Alias for comprehensive tests
- contacts: Core contact information with soft delete support
- contact_entries: Interaction tracking with timestamps
- Archives: Automatic timestamped backups indata/archives/
- Indexes: Optimized for search and retrieval operations
- Database files: All.sqlitefiles are excluded from version control
- Archives: Thedata/archives/directory contents are ignored but structure is preserved
- Local development: Each developer maintains their own database and archives locally
- Fresh setup: Runnpm run db:resetto create a clean database on new installations
- Input Validation: Comprehensive parameter validation using Zod
- SQL Injection Protection: Parameterized queries throughout
- XSS Prevention: Input sanitization for special characters
- Error Handling: Graceful error responses without sensitive data exposure
- Boundary Testing: Extensive edge case validation
- Efficient SQLite operations with proper indexing
- Bulk operation support for large datasets
- Consistent sub-100ms response times
- Memory-efficient design
- Comprehensive error handling
- Input validation and sanitization
- Graceful degradation for edge cases
- Extensive test coverage (100%)
- Database integrity protection with automatic archiving
- Zero data loss guarantee through safe backup/restore system
- Performance metrics collection
- Detailed logging for debugging
- Test result reporting and analysis
- Runnpm run test:allto verify system health
- Check the test results intests/results/test-reports/
- Review the comprehensive test scenarios including database management
- Usenpm run db:helpfor database management commands
- All 13 CRM tools plus database management are documented and tested
Status: ✅ Production Ready | 🧪 3-Phase Testing | 🚀 Performance Optimized | 🗄️ Database Management | 🔒 Complete Isolation
A read-only MCP server by CData that enables LLMs to query live data from Bullhorn CRM. Requires the CData JDBC Driver for Bullhorn CRM.
A read-only MCP server to query live Oracle Eloqua data. Requires a separate CData JDBC Driver for Oracle Eloqua.
A read-only MCP server for Salesforce Data Cloud, powered by CData.
A read-only MCP server for querying live SAP Hybris C4C data, powered by the CData JDBC Driver.
A read-only MCP server for querying live SuiteCRM data using the CData JDBC Driver.
A read-only MCP server that allows LLMs to query live Certinia data. Powered by CData.
Generect MCP connects your live lead database directly to AI models like OpenAI or Claude without exports or delays. It streams enriched, up-to-date contact data (titles, firmographics, signals) straight into prompts so LLMs can personalize, score, and recommend leads automatically in real time.
A read-only MCP server for querying live data from Outreach.io using the CData JDBC Driver.
A read-only MCP server for Pipedrive, enabling LLMs to query live data using the CData JDBC Driver.
Enables natural language interaction with Salesforce data. Query, modify, and manage Salesforce objects and records.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





