NextCRM
NextCRM is an open-source CRM built with Next.js 16, React 19, TypeScript, PostgreSQL (Prisma 7), and shadcn/ui. Features CRM, project management, invoicing, document storage, email client, AI-powered features, vector search, and MCP server for AI agent access.
Introduction · What's New · Tech Stack + Features · Roadmap · Installation · Repo activity · License · Discord
Online Demo
You can try it here demo.nextcrm.io, login via Google account or create new user and password.
What's New
🧾 Invoices Module — Full Invoicing Workflow (NEW)
Complete invoicing system built into NextCRM — create, issue, pay, duplicate, and cancel invoices with multi-currency support, tax rates, and PDF generation.
- Invoice types — Invoice, Credit Note, Proforma, and Receipt
- Line items — per-line quantity, unit price, discount %, and tax rate with automatic totals calculation
- Tax engine — configurable tax rates (VAT, GST, etc.) with per-line tax breakdown and VAT summary buckets
- Invoice series — auto-numbered sequences with configurable prefix/suffix (e.g.
INV-2026-0001) - Multi-currency — admin-managed currency list with locale-aware formatting via
next-intl - Status lifecycle —
DRAFT → ISSUED → PAID / PARTIALLY_PAID / CANCELLEDwith permission guards (only drafts are editable) - Payments — record partial/full payments, auto-computed balance due, payment history on detail page
- Duplicate & cancel — one-click invoice duplication; cancellation with audit trail
- Email delivery — send invoices to account email via Resend with React Email template
- PDF export — server-side PDF generation at
/api/invoices/[id]/pdf - Activity log — every status change and edit is recorded with actor and timestamp
- Admin settings — manage tax rates, invoice series, currencies, and default settings from
/admin/invoices - i18n — full English and Czech translations
- Server actions — create/update operations use Next.js server actions with Zod validation (no API route middleman)
📋 CRM Activities — Full Activity Tracking (NEW)
All 5 CRM entity detail pages (Accounts, Contacts, Leads, Opportunities, Contracts) now have an Activities tab with a live paginated feed of interactions:
- Activity types — Notes, Calls, Emails, Meetings, Tasks
- Create / edit / delete — inline Sheet form on every CRM entity detail page
- Paginated feed — compound cursor pagination with
createdAt + idfor stable ordering - Linked records — activities attach to multiple entities via
crm_ActivityLinks(e.g. a call can reference both a Contact and an Opportunity) - Real-time revalidation — server actions revalidate the correct path after every mutation
🕵️ Audit Log & History — Full Change Trail (NEW)
Every CRM entity (Accounts, Contacts, Leads, Opportunities, Contracts) now tracks its full change history:
- History tab — per-entity timeline of all field changes, shown on every detail page with
AuditTimeline+AuditEntrycomponents - Soft delete — records are never hard-deleted;
deletedAtcolumn preserves data while hiding it from normal queries - Admin audit log —
/admin/audit-logshows a global filterable table of every change across all entities, with restore support for soft-deleted records - Diff engine —
diffObjectsutility computes before/after diffs and stores structured JSON in the audit record
🧠 AI Enrichment — E2B Sandboxed Agent + Flexible API Key Management (NEW)
Target and Contact enrichment now runs inside an E2B cloud sandbox — a full Linux environment with a real browser (Chrome) — replacing the previous Firecrawl API path:
- Real-browser research — the agent navigates JS-heavy sites, LinkedIn public profiles, and paginated results that a simple API call cannot reach
- LLM tool-use loop — Claude Sonnet 4.6 drives the research with tools:
browser_open,browser_snapshot,browser_click,browser_extract,web_search - C-level contact discovery — given only a company name, the agent finds all discoverable C-level contacts and creates
crm_Target_Contactrecords automatically - Context-aware strategy — agent skips research it doesn't need (e.g. already has a website → skips domain discovery)
- Confidence scoring — fields below 0.6 confidence are discarded; only empty target fields are overwritten
- 5-minute timeout per target — partial results are applied even if the agent times out
- Fan-out — after company enrichment, each discovered contact is enriched independently via a separate Inngest job
API keys are managed through a 3-tier priority system so the app runs without any keys in .env:
ENV variable → Admin system-wide → User profile
(highest) (lowest)
- Admin panel (
/admin/llm-keys) — set system-wide keys for OpenAI, Firecrawl, Anthropic, and Groq. Keys are encrypted at rest (AES-256-GCM). - Profile settings (
/profile?tab=llms) — users configure their own keys as a fallback. - Graceful degradation — enrichment buttons show an informative dialog when no key is available at any tier.
Migration note: The old
openAi_keystable is replaced by the newApiKeystable. Runpnpm prisma migrate deployto apply the migration.
🤖 MCP Server — AI Agent Access to CRM Data (NEW)
NextCRM now ships with a built-in Model Context Protocol server, letting AI agents (Claude, Cursor, custom agents) read and write CRM data directly.
127 tools across 15 modules:
| Module | Tools | Operations |
|---|---|---|
| Accounts | 6 | list, get, search, create, update, delete |
| Contacts | 6 | list, get, search, create, update, delete |
| Leads | 6 | list, get, search, create, update, delete |
| Opportunities | 6 | list, get, search, create, update, delete |
| Targets | 6 | list, get, search, create, update, delete |
| Products | 5 | list, get, create, update, delete |
| Contracts | 5 | list, get, create, update, delete |
| Activities | 5 | list, get, create, update, delete |
| Documents | 8 | list, get, create, upload, download, link, unlink, delete |
| Target Lists | 7 | list, get, create, update, delete, add members, remove members |
| Enrichment | 4 | enrich contact, enrich target, bulk contact, bulk target |
| Email Accounts | 1 | list |
| Campaigns | 18 | full lifecycle: CRUD, send, pause, resume, templates, steps, stats |
| Projects | 18 | boards, sections, tasks, comments, documents, watch |
| Reports | 2 | list, run |
Authentication: Generate Bearer tokens (nxtc__...) from your profile page. Tokens are SHA-256 hashed — the raw value is shown only once and never stored.
Connect your MCP client (streamable HTTP — recommended):
{
"mcpServers": {
"nextcrm": {
"type": "http",
"url": "https://your-nextcrm.com/api/mcp/mcp",
"headers": { "Authorization": "Bearer nxtc__your_token_here" }
}
}
}
The server supports both MCP transports defined by mcp-handler:
- Streamable HTTP at
/api/mcp/mcp— single POST endpoint, current MCP spec default - SSE (legacy) at
/api/mcp/sse— GET stream paired with POSTs to/api/mcp/message(client auto-discovers the message endpoint)
Claude Code Skill: Download the SKILL.md from your Developer profile tab for a ready-to-use Claude Code skill with full tool documentation.
🔍 Vector Search + Semantic Similarity (NEW)
CRM records (Accounts, Contacts, Leads, Opportunities) are automatically embedded using OpenAI text-embedding-3-small via Inngest background jobs.
- Unified search — combines keyword (full-text) + semantic (pgvector cosine similarity) results in a single grouped UI
- Find Similar — every CRM detail page has a "Find Similar" button that surf