Skip to content
Conduit

mcp server

agentic-sales-engine

MCP-native sales intelligence framework. Orchestrate CRM, call recorders, and email through a unified Model Context Protocol layer.

Set up

Runs on your computer. Pick your agent and operating system.

This project does not publish an install method we can turn into a config. Follow the README instead.

README

synced Oct 23, 2026

MCP Sales Agent

MCP Next.js TypeScript Tailwind Jest Tests License

An MCP-native sales intelligence framework. Orchestrate CRM, call recorders, mailbox, and calendar through a unified Model Context Protocol layer — with a built-in observability dashboard.

Demo mode works without API keys. Clone, npm install, npm run dev, and explore the full dashboard in under 60 seconds.

What this demonstrates

Built as evidence of forward-deployed / customer-facing engineering work:

  • Typed MCP tool design — every sales capability (analyze_call, update_pipeline, draft_followup, get_benchmarks) is exposed as a Zod-schema'd MCP tool, discoverable and invocable by any MCP client (Claude, Cursor, Copilot, Kimi).
  • CRM & webhook integration architecture — type-safe Salesforce (OAuth2/SOQL), HubSpot, Gong, and Slack clients with rate-limit handling and typed error hierarchies, plus webhook ingest for call recorders with signature verification.
  • LLM pipeline design — structured output via Zod schemas, SSE streaming for multi-stage analysis, and a demo-mode fallback so the full pipeline runs without API keys.
  • Production data modeling — PostgreSQL via Prisma with migrations, an in-memory TTL cache, input validation, and sliding-window rate limiting on every API route.

One-Line Install

Claude Desktop — paste into claude_desktop_config.json:

{
  "mcpServers": {
    "sales": {
      "command": "npx",
      "args": ["-y", "ts-node", "src/mcp/server.ts"]
    }
  }
}

Claude Code:

claude mcp add sales-agent -- npx -y ts-node src/mcp/server.ts

Cursor — add to .cursor/mcp.json:

{
  "mcpServers": [{
    "name": "sales-agent",
    "command": "npx",
    "args": ["-y", "ts-node", "src/mcp/server.ts"]
  }]
}

Why MCP for Sales?

Sales stacks are fragmented: Gong for calls, Salesforce for pipeline, Gmail for follow-ups, Slack for alerts. Each has its own API, auth flow, and rate limits. The Model Context Protocol (MCP) provides a standard way to expose these as tools that any AI agent can discover and invoke. This project is a reference implementation of that idea — a sales-specific MCP server with a visual trace panel so you can see every tool call the agent makes.

Quick Start

# Clone and install
git clone https://github.com/yourusername/agentic-sales-engine.git
cd agentic-sales-engine
npm install

# Zero-config demo mode — works without any API keys
cp .env.example .env
npm run dev

Open http://localhost:3000 and click Open Dashboard.

That's it. No Playwright binaries, no Python backends, no API keys to hunt down.

What You Get

CapabilityMCP ToolWhat It Does
Call Intelligenceanalyze_callIngests recordings, extracts sentiment, stage inference, objections, talk ratios
Auto Pipelineupdate_pipelineMoves deal stages based on call content. Kanban with drag-to-pin overrides
AI Follow-upsdraft_followupGenerates post-call emails from actual conversation content
Pre-Call Briefsgenerate_briefSurfaces last call summary, open commitments, recurring objections, winning patterns
Rep Coachingscore_repPer-position scorecards with talk-time ratios and objection-resolution rates
Industry Benchmarksget_benchmarksFunnel metrics plotted against comparable orgs across 28 segments

Demo Mode

The framework ships with rich mock data so you can validate the architecture instantly:

  • 6 analyzed calls with full transcripts, sentiment labels, and objection classifications
  • 10 deals across 7 pipeline stages ($2.3M total pipeline)
  • 4 rep scorecards with weekly trend charts and coaching gaps
  • 4 AI-drafted follow-ups with realistic email copy
  • 2 pre-call briefs with open commitments and winning patterns
  • 8 industry benchmarks for segment comparison

Architecture

┌─────────────────────────────────────────────┐
│  MCP Client (Claude, Cursor, Copilot, Kimi) │
│         ↓ stdio / SSE                       │
├─────────────────────────────────────────────┤
│  Next.js 15 App Router                      │
│  ┌─────────────┐  ┌──────────────────────┐  │
│  │  MCP Server │  │  Observability UI    │  │
│  │  /api/tools │  │  Dashboard + Traces  │  │
│  │  /api/resources│  │                     │  │
│  └──────┬──────┘  └──────────────────────┘  │
│         ↓                                   │
│  ┌────────────────────────────────────────┐ │
│  │  n8n Workflow Orchestrator             │ │
│  │  ├─ salesforce-query / update          │ │
│  │  ├─ hubspot-search / update            │ │
│  │  ├─ gong-fetch-calls / transcript      │ │
│  │  ├─ slack-notify                       │ │
│  │  ├─ gmail-send                         │ │
│  │  └─ calendar-create                    │ │
│  └────────────────────────────────────────┘ │
│         ↓                                   │
│  ┌────────────────────────────────────────┐ │
│  │  Hermes Agent (Cron + Memory)          │ │
│  │  ├─ Daily pre-call briefs @ 8 AM       │ │
│  │  ├─ Weekly coaching reports @ Mon 9 AM │ │
│  │  └─ Hourly pipeline sync               │ │
│  └────────────────────────────────────────┘ │
└─────────────────────────────────────────────┘

MCP Tool Layer

Each integration is exposed as a typed MCP tool:

// Example: Salesforce tool schema
{
  name: "update_deal_stage",
  description: "Move a Salesforce opportunity to a new stage",
  inputSchema: z.object({
    opportunityId: z.string(),
    stageName: z.enum(["Prospecting", "Qualification", "Proposal", "Closed-Won", "Closed-Lost"]),
    reason: z.string().optional()
  })
}

Engineering Decisions

  • Structured LLM output with Zod schemas — eliminates free-form JSON parsing and prompt-injection vulnerabilities
  • Server-Sent Events (SSE) streaming — UI receives live progress during multi-stage analysis
  • In-memory TTL cache with typed error hierarchy — production-ready resilience patterns
  • Zero-config demo mode — entire dashboard works without API keys, making it instantly demoable
  • Production CRM integrations — type-safe Salesforce (OAuth2 refresh flow, SOQL), HubSpot (private app tokens, Search API), Gong (pagination), and Slack (Block Kit) clients with Zod validation, rate-limit handling, and typed error hierarchies
  • MCP transport ready — stdio and SSE transports can be wired to the integration layer without changing tool schemas
  • Multi-stage Dockerfile — optimized production build with standalone output
  • GitHub Actions CI — lint, typecheck, and test with coverage on every push

Tech Stack

  • Framework: Next.js 15 App Router
  • Protocol: Model Context Protocol (MCP) — stdio / SSE transport ready
  • Language: TypeScript (strict mode)
  • Styling: Tailwind CSS
  • Charts: Recharts (line, bar, radar charts)
  • Animation: Framer Motion
  • Validation: Zod (structured LLM output + MCP tool schemas)
  • LLM: OpenAI GPT-4o / Claude 3.5 Sonnet via streaming completions
  • Database: PostgreSQL via Prisma ORM
  • Testing: Jest + ts-jest
  • CI/CD: GitHub Actions (lint, typecheck, test with coverage)
  • Deployment: Multi-stage Docker build

Dashboard Views

ViewWhat It Shows
OverviewPipeline value, calls analyzed, win rate, deals closed, top performer
Call IntelligenceExpandable call cards with transcripts, sentiment, objections, talk ratios
PipelineKanban board across 7 stages with deal value, probability, and stall warnings
Follow-upsAI-drafted emails with copy-to-clipboard, sent/replied/paused status
Pre-Call BriefsLast call summary, open commitments, recurring objections, winning patterns
CoachingPer-rep scorecards with weekly trend lines, team comparison bar charts
Benchmarks8 industry segments with win rate/show rate comparison and radar chart
Loss AutopsyObjection clustering behind stalled deals with suggested counter-moves
Webhook IngestReceives call recordings from Gong, Fathom, Fireflies with signature verification
Input ValidationZod validation on every API route with structured 400 errors
Rate LimitingSliding-window rate limits with 429 + Retry-After headers
IntegrationsConnected status for Gong, Salesforce, HubSpot, Gmail, Slack with sync health

Testing

npm test

21 tests, 0 failures. Covers:

  • Cache expiration, error hierarchy, loss autopsy clustering
  • LLM client with mock OpenAI server (no API key needed)
  • n8n client with mock n8n server (no n8n instance needed)
  • API routes: health, dashboard, streaming, webhooks
  • Input validation and rate limiting middleware

Verify Demo Mode (No Credentials)

npx ts-node --transpile-only scripts/verify-demo-mode.ts

Confirms the entire framework works without OPENAI_API_KEY, N8N_WEBHOOK_URL, or DATABASE_URL.

Deployment

Docker (App Only)

docker build -t mcp-sales-agent .
docker run -p 3000:3000 mcp-sales-agent

Docker Compose (Full Stack)

make docker-up

Starts PostgreSQL + n8n + app. n8n UI at http://localhost:5678 (admin / admin).

Integrations

Connect what you already use. All integrations are managed through n8n workflows — the app triggers n8n webhooks, and n8n handles OAuth, rate limits, retries, and API calls. No custom API clients to maintain.

CategoryTools
Call RecordersGong, Fathom, Fireflies, Otter
CRMSalesforce, HubSpot, Pipedrive, Zoho CRM
MailboxGmail (OAuth), Outlook (OAuth), SendGrid
CalendarGoogle Calendar, Outlook Calendar
NotificationsSlack (webhooks + bot), Microsoft Teams
LinkedIn / OutboundLinkedIn Sales Navigator, Apollo, CalendarFuel
EnrichmentClearbit, Apollo, ZoomInfo
LLMOpenAI GPT-4o / Claude 3.5 Sonnet

Recommended Complementary Tools

ToolWhat It DoesWhy It Pairs Well
CalendarFuelFractional GTM Engineering + AI sales agents (LinkedIn outreach, call analysis, meeting booking)End-to-end outbound automation that complements MCP Sales Agent's pipeline intelligence and coaching layers. Same call-analysis → CRM-update → follow-up workflow, executed by dedicated AI agents.
n8nWorkflow automation with 400+ integrationsOrchestrates all CRM, email, and calendar connections for this repo. Pre-built workflows included.
Hermes AgentSelf-improving AI agent with cron + memoryRuns scheduled jobs (daily briefs, weekly coaching, hourly pipeline sync) against the MCP server.

Quick Validation

See QUICK_TEST_QUERIES.md for end-to-end test scenarios you can run in under 5 minutes.

Troubleshooting

See TROUBLESHOOTING.md for the most common setup issues and how to fix them.

Contributing

See CONTRIBUTING.md for how to add tools, run tests, and submit PRs.

Roadmap

  • Full MCP stdio transport server implementation
  • MCP tools/list, resources/list, prompts/list capability endpoints
  • Real LLM call 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

Related

License

MIT

↑↓ navigate openesc close