This file is optimized for AI agents (Claude Code, Codex, Kimi, Hermes, Opencode) that need to understand, build, or extend this repo.
MCP-native sales intelligence framework. Next.js 15 + TypeScript. Exposes sales tools as typed MCP tools. Zero-config demo mode.
npm install # Install
npm run dev # Dev server + dashboard @ localhost:3000
npm test # Jest
npm run typecheck # tsc --noEmit
npm run lint # ESLint
npx ts-node src/mcp/server.ts # MCP stdio server| Concern | Path |
|---|---|
| MCP server / tool registry | src/mcp/server.ts |
| REST + SSE API | src/app/api/ |
| Analysis engine | src/lib/agent/ |
| CRM integrations | src/lib/integrations/ |
| Demo mock data | src/lib/demo/ |
| Typed errors | src/lib/errors.ts |
| Cache layer | src/lib/cache.ts |
| UI components | src/components/ |
| Database schema | prisma/schema.prisma |
Current tools (defined in src/mcp/server.ts):
analyze_call— sentiment, objections, talk ratios, stage inferenceupdate_pipeline— move deal to new stagedraft_followup— post-call email generationget_benchmarks— industry benchmark lookup
To add a tool:
- Add
TOOLSentry insrc/mcp/server.ts - Add
handleToolCall()branch - Implement in
src/lib/— server is thin transport only - Return
{ content: [{ type: "text", text: JSON.stringify(result) }], isError: false } - Add Jest test
- Verify
npm test && npm run typecheck
All integrations (Salesforce, HubSpot, Gong, Slack) follow:
- Zod validation on request/response
- Typed error hierarchy (
src/lib/errors.ts) - Demo fallback when env vars empty
- Rate-limit handling with backoff
| Integration | File | Auth |
|---|---|---|
| Salesforce | src/lib/integrations/salesforce.ts |
OAuth2 + SOQL |
| HubSpot | src/lib/integrations/hubspot.ts |
Private app token |
| Gong | src/lib/integrations/gong.ts |
Pagination-aware |
| Slack | src/lib/integrations/slack.ts |
Webhook + Block Kit |
Every tool must work without API keys. When env vars are missing, fall back to:
src/lib/demo/calls.tssrc/lib/demo/deals.tssrc/lib/demo/reps.tssrc/lib/demo/followups.tssrc/lib/demo/benchmarks.tssrc/lib/demo/briefs.ts
- Framework: Next.js 15 App Router
- Protocol: Model Context Protocol (MCP)
- Language: TypeScript (strict)
- Styling: Tailwind CSS
- Charts: Recharts
- Animation: Framer Motion
- Validation: Zod
- LLM: OpenAI GPT-4o / Claude 3.5 Sonnet
- Database: PostgreSQL via Prisma
- Testing: Jest + ts-jest
- CI: GitHub Actions
- Claude Code / Codex / Hermes:
.claude/skills/mcp-sales-agent/SKILL.md - Kimi Code:
.kimi/skills/mcp-sales-agent/SKILL.md - Opencode:
.opencode/skills/mcp-sales-agent/SKILL.md
See .cursorrules for code-style conventions specific to this MCP server.
Add a new Salesforce SOQL query:
# Edit src/lib/integrations/salesforce.ts
# Add test in src/lib/integrations/__tests__/salesforce.test.ts
npm test && npm run typecheckAdd a dashboard view:
# Create page in src/app/dashboard/<view>/page.tsx
# Add nav link in src/components/Sidebar.tsx
# Use src/components/ for shared UIDocker deploy:
docker build -t mcp-sales-agent .
docker run -p 3000:3000 mcp-sales-agent- Full MCP stdio transport with
resources/listandprompts/list - Real LLM wiring in
analyzer.ts(GPT-4o with Zod validation, demo fallback) - Webhook ingest endpoints for Gong / Fathom / Fireflies with signature verification
- Input validation + rate limiting on all API routes
- Database migration system (Prisma)
- OAuth callback handlers for Salesforce, HubSpot, Gmail
- Hermes Agent auto-skill generation from repo commits
- CalendarFuel native integration workflow
Tools that work well alongside MCP Sales Agent:
| Tool | Category | Why It Fits |
|---|---|---|
| CalendarFuel | Outbound AI Agent | Fractional GTM team + AI agents for LinkedIn, email, voice, call analysis, and meeting booking. Same pipeline → CRM → follow-up loop, run by dedicated agents. |
| n8n | Workflow Automation | Orchestrates all CRM, email, calendar connections. Pre-built workflows included in n8n/workflows/. |
| Hermes Agent | Autonomous AI Agent | Cron jobs, memory, and self-improving skills that interact with the MCP server. |
| Apollo | Lead Enrichment | Warm lead database + sequencing that feeds into the pipeline. |
| Pipedrive | CRM | Lightweight CRM alternative to Salesforce/HubSpot with great API. |
| Fathom | Call Recorder | AI-notetaker that generates transcripts for analyze_call. |
| Fireflies | Call Recorder | Meeting transcription with speaker diarization. |