Skip to main content
Glama

🧠 LeadMind MCP β€” AI Lead Management CRM

Version License Python Next.js Groq MCP

Conversational AI lead management powered by the Model Context Protocol. Free-tier only β€” Groq LLM + SQLite. Zero paid APIs.

🌐 Live Dashboard Β· 🐍 Backend API Β· πŸ“– MCP Docs Β· πŸ“§ Claude Desktop Config


✨ Live Demo

Try it right now β€” no login required. Dashboard resets every 4 hours.


Related MCP server: PipeDrive MCP Server

🎯 What is LeadMind?

LeadMind MCP is a complete AI-powered CRM that:

  • Auto-classifies leads as Hot / Warm / Cold using Groq's Llama-3.3-70b

  • Suggests next actions for each lead (AI-powered coaching)

  • Tracks full history β€” every status change, classification, and note is audited

  • Works with Claude Desktop via the Model Context Protocol β€” manage leads conversationally

  • Runs on free-tier everything β€” Groq free API + SQLite + Render free hosting


πŸ— Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Claude Desktop                   β”‚
β”‚              (MCP Client β€” stdio)                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚ MCP Protocol (stdio)
                       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚            leadmind-mcp/mcp_server.py             β”‚
β”‚         MCP Server β€” 8 Tools + 3 Resources       β”‚
β”‚                                                   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ Groq    β”‚  β”‚  Fallbackβ”‚  β”‚  Cache (5 min) β”‚ β”‚
β”‚  β”‚ Llama   β”‚β†’ β”‚  Rules   β”‚β†’ β”‚  TTL + SQLite  β”‚ β”‚
β”‚  β”‚ 70b     β”‚  β”‚  Engine  β”‚  β”‚  persistent    β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                       β”‚                           β”‚
β”‚                       β–Ό                           β”‚
β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                  β”‚
β”‚              β”‚  SQLite (WAL)   β”‚                  β”‚
β”‚              β”‚  leadmind.db    β”‚                  β”‚
β”‚              β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚             β”‚             β”‚
          β–Ό             β–Ό             β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚  MCP CLI   β”‚ β”‚ FastAPI  β”‚ β”‚  Next.js     β”‚
   β”‚  (Claude)  β”‚ β”‚ REST API β”‚ β”‚  Dashboard   β”‚
   β”‚  stdio     β”‚ β”‚ :8000    β”‚ β”‚  (Render)    β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

Prerequisites

  • Python 3.12+

  • uv (recommended) or pip

  • Groq API key (free at console.groq.com) β€” optional, fallback works without it

1. Clone & Install

git clone https://github.com/mansisonani07/leadmind-mcp.git
cd leadmind-mcp
pip install -r requirements.txt

2. Run the MCP Server (Claude Desktop)

python mcp_server.py

3. Run the REST API

python api_server.py          # http://localhost:8000

4. Run the Web Dashboard

python web_dashboard.py       # http://localhost:8000 (HTML + API combined)

5. Run the Next.js Frontend

cd ..
npm install
LEADMIND_BACKEND_URL=http://localhost:8000 npm run dev

πŸ€– Claude Desktop Integration

Add this to your Claude Desktop config file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "leadmind": {
      "command": "python",
      "args": ["/path/to/leadmind-mcp/mcp_server.py"],
      "env": {
        "GROQ_API_KEY": "gsk_your_key_here"
      }
    }
  }
}

Then ask Claude things like:

  • "Show me all hot leads"

  • "Add a new lead: Sarah Chen, sarah@acme.com, interested in enterprise plan"

  • "What should I do next with lead #5?"

  • "Classify this: We need a CRM solution, budget approved, looking to sign next week"


πŸ›  MCP Tools Exposed

Tool

Description

get_leads

List leads, filter by status

classify_lead

AI classification β€” Hot/Warm/Cold with reasoning

add_lead

Add a lead + auto-classify on insert

update_lead_status

Manual status override + history log

get_lead_stats

Pipeline aggregate statistics

get_lead_history

Full event timeline per lead

suggest_next_action

AI-recommended next step for a lead

bulk_import_leads

CSV parse + batch classify

MCP Resources

URI

Description

leads://dashboard

Live pipeline snapshot

audit://recent

Recent tool-call audit log

MCP Prompts

Name

Description

weekly_lead_review

Structured weekly summary


πŸ“‘ REST API Endpoints

Method

Endpoint

Description

GET

/health

Health check + service info

GET

/stats

Pipeline stats + Groq usage

GET

/leads?status=Hot

List leads (optional status filter)

GET

/leads/{id}

Single lead + history timeline

POST

/leads

Add a lead (auto-classifies)

PATCH

/leads/{id}/status

Update lead status

GET

/leads/{id}/next-action

AI next-action suggestion

POST

/leads/bulk-csv

Bulk import from CSV

GET

/audit?limit=50

Recent tool-call audit log

GET

/dashboard

Full dashboard snapshot

POST

/demo/reset

Reset database to seed data

Try it:

curl https://leadmind-mcp-1.onrender.com/health
curl https://leadmind-mcp-1.onrender.com/leads?status=Hot
curl https://leadmind-mcp-1.onrender.com/stats

⚑ Reliability Engineering

LeadMind is built with production-grade resilience:

Feature

Description

πŸ”„ Three-tier classification

Cache β†’ Groq LLM β†’ Rule-based fallback

πŸ“¦ TTL Cache

5-minute cache avoids redundant Groq calls

πŸ›‘οΈ Rate-limit handler

Graceful degradation on Groq 429 errors

πŸ” Auto-restart

Dashboard auto-restarts Python if it crashes

πŸ—„οΈ SQLite WAL mode

Concurrent reads + atomic writes

πŸ”„ Demo auto-reset

Fresh data every 4 hours (configurable)

πŸ“Š Audit logging

Every tool call tracked with duration


🎨 Dashboard Features

  • 6 KPI cards β€” Total leads, Hot leads, Conversion rate, Avg response, Groq calls, Sources

  • Pipeline distribution β€” Visual bar chart by status

  • Source breakdown β€” Leads by acquisition channel

  • Full leads table β€” Search, filter by status, sort

  • Lead detail drawer β€” Status update, AI next action, message, timeline

  • Add lead modal β€” Auto-classifies with AI on submit

  • Audit log β€” Every tool call with Groq/fallback/cache flags

  • MCP primitives panel β€” Shows all exposed tools, resources, and prompts

  • Dark mode β€” Toggle between light and dark themes


πŸ”‘ Environment Variables

Variable

Default

Description

GROQ_API_KEY

β€”

Free Groq API key

DEMO_MODE

true

Auto-reset DB to seed data

DEMO_RESET_INTERVAL_SEC

14400

Reset interval (4 hours)

LEADMIND_AUTH_ENABLED

false

Enable API key auth

LEADMIND_API_KEY

β€”

API secret key when auth enabled

PORT

8000

Backend listen port

NEXT_PUBLIC_LEADMIND_BACKEND_URL

β€”

Backend URL for Next.js frontend


πŸ“‚ Project Structure

leadmind-mcp/
β”œβ”€β”€ mcp_server.py          # MCP server (stdio) β€” used by Claude Desktop
β”œβ”€β”€ api_server.py          # REST API server β€” used by Next.js frontend
β”œβ”€β”€ web_dashboard.py       # Self-contained HTML dashboard + API
β”œβ”€β”€ tools.py               # MCP tool implementations
β”œβ”€β”€ db.py                  # SQLite database layer
β”œβ”€β”€ groq_classifier.py     # Groq LLM classification + caching
β”œβ”€β”€ fallback_classifier.py # Rule-based fallback classifier
β”œβ”€β”€ seed_data.py           # Demo seed data (22 leads)
β”œβ”€β”€ config.py              # Configuration from env vars
β”œβ”€β”€ cache.py               # TTL cache implementation
β”œβ”€β”€ webhook_receiver.py    # n8n / Gmail webhook receiver
β”œβ”€β”€ requirements.txt        # Python dependencies
└── claude_desktop_config.example.json

src/                        # Next.js frontend (React + TypeScript)
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ page.tsx            # Dashboard entry point
β”‚   β”œβ”€β”€ api/leadmind/[...path]/route.ts  # API proxy
β”‚   └── layout.tsx          # Root layout with fonts + toasters
β”œβ”€β”€ components/leadmind/
β”‚   β”œβ”€β”€ DashboardPage.tsx   # Main dashboard orchestrator
β”‚   β”œβ”€β”€ Header.tsx          # App header with branding
β”‚   β”œβ”€β”€ StatsGrid.tsx       # KPI cards + charts
β”‚   β”œβ”€β”€ LeadsTable.tsx      # Searchable leads table
β”‚   β”œβ”€β”€ LeadDetailDrawer.tsx # Slide-out lead detail
β”‚   β”œβ”€β”€ AddLeadDialog.tsx   # Add lead modal
β”‚   β”œβ”€β”€ AuditPanel.tsx      # Tool call audit log
β”‚   └── McpPrimitivesPanel.tsx # MCP tools/resources display
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ leadmind-api.ts     # API client (fetch wrapper)
β”‚   └── leadmind-ui.ts      # Status colors, formatters
└── components/ui/          # shadcn/ui components

🚒 Deployment

Render (Free Tier)

Backend: render.com β†’ New Web Service

  • Build: pip install -r requirements.txt

  • Start: python api_server.py

  • Set GROQ_API_KEY env var

Frontend: render.com β†’ New Web Service

  • Build: npm install && npm run build

  • Start: next start -p $PORT

  • Set NEXT_PUBLIC_LEADMIND_BACKEND_URL=https://your-backend.onrender.com


πŸ“„ License

MIT License β€” free for personal and commercial use.


πŸ™ Credits


Built with ❀️ by mansisonani07

⭐ If you find this useful, give it a star!

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    MCP server that enables AI agents to discover and qualify B2B leads from Leadbay's knowledge base, with tools for lead research, enrichment, and outreach logging.
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    A comprehensive MCP server for the Pipedrive CRM API, enabling AI assistants to read, write, and analyze CRM data conversationally through 100 tools including performance reporting and loss analysis.
    1,010 npm
    8
    MIT