Skip to main content
Glama
CRM MCP Server

CRM MCP Server

CRM MCP Server

Connect Claude, ChatGPT, Cursor or any MCP client to a CRM database, so you can ask questions and get work done in plain English:

"Which customers haven't ordered in 60 days and are worth more than $5,000? Add a note to each and create a call task for Friday."

The assistant finds the customers, reads their history, writes the notes and creates the tasks through this server. Every step is validated, permission-checked and logged.

This is a working reference build: the same pattern connects an AI assistant to HubSpot, Salesforce, Postgres / Supabase or your own REST API.


What it does

Tool

Type

What it's for

search_customers

read

Find customers by name, company or email; filter by status and segment

get_customer_summary

read

Profile, lifetime value, recent orders, notes and open tasks for one customer

list_inactive_customers

read

Customers with no order in N days, most valuable first (churn / win-back list)

sales_report

read

Revenue, orders, top customers, by product and by segment for the last N days

add_note

write

Add a note to a customer (never edits or deletes existing notes)

create_followup_task

write

Create a dated follow-up task

update_customer_status

write

Move a customer between lead / active / at_risk / churned

Related MCP server: crm-mcp-server

Built to be safe with real business data

  • Validated input. Every argument has a type, range and length limit; bad input is rejected before it reaches the database.

  • No raw SQL, no deletes. The AI can only do what the tools allow. Queries are parameterized, so injection attempts are treated as plain text (there is a test for this).

  • Read-only mode. CRM_READ_ONLY=true removes the write tools entirely, ideal for a first rollout.

  • Write tools are labelled. MCP annotations mark read vs. write vs. destructive tools, so clients like Claude can ask the user before changing anything.

  • Audit log. Every call is written to data/audit.jsonl: time, tool, arguments, success, duration.

  • API-key auth for the remote server. /mcp requires Authorization: Bearer <key> (constant-time check); /health stays open for uptime monitors.

  • Tested. 17 tests run each tool through a real MCP client, in memory and over HTTP.

Quick start (5 minutes)

git clone https://github.com/projectsdealnepal/crm-mcp-server.git
cd crm-mcp-server
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
crm-mcp-seed          # loads 60 sample customers, ~380 orders, notes and tasks
pytest -q             # 17 passed

Use it in Claude Desktop

  1. Copy claude_desktop_config.example.json into Claude Desktop's config (Settings → Developer → Edit Config), replacing the /ABSOLUTE/PATH/TO/ parts.

  2. Restart Claude Desktop. The crm tools appear in the tools menu.

  3. Ask: "Give me a sales report for the last 30 days."

The same command + env block works in Cursor, Claude Code and other MCP clients.

Run it as a remote server

export CRM_API_KEY=$(python -c "import secrets; print(secrets.token_urlsafe(32))")
crm-mcp --http                       # serves http://0.0.0.0:8000/mcp
curl localhost:8000/health           # {"status":"ok","read_only":false}

Or with Docker:

docker build -t crm-mcp .
docker run -p 8000:8000 -e CRM_API_KEY=... -v crm-data:/data crm-mcp

Deploy the container anywhere that runs Docker (AWS ECS / App Runner, Fly.io, Render, a VPS) behind HTTPS, then add the URL and key as a custom connector in your AI client.

Try these prompts

  • "Which customers haven't ordered in 60 days? Show the most valuable first."

  • "Summarize everything about the top customer on that list."

  • "Give me a sales report for the last 90 days, by segment."

  • "Add a note to customer 12: sent a 20% win-back offer. Then create a call task for next Friday."

  • "Mark every churned customer worth more than $10k as at_risk so sales can try to win them back."

Project layout

crm_mcp/
  server.py     tools, validation, annotations, read-only mode
  audit.py      JSONL audit log for every tool call
  db.py         schema + SQLite connection (standard SQL, Postgres-ready)
  seed.py       deterministic demo data
  config.py     settings from environment variables
  __main__.py   stdio or HTTP (API-key auth, /health)
tests/          in-memory and HTTP end-to-end tests

Adapting it to your system

Replace the queries in server.py with calls to your CRM's API or your own database, keep the same tool names and validation, and you have an assistant that works on your real data. Typical adaptations: HubSpot / Salesforce / Zoho, Postgres / Supabase, Shopify, an internal REST API, OAuth with per-user permissions.


Built by Anand Gachhadar, AI agent & LLM engineer (Python, AWS, Claude / OpenAI). Need an MCP server for your own system? Find me on Upwork.

MIT licensed.

Available Tools

7 tools
add_noteA

Add a note to a customer's record. Adds only; never edits or deletes existing notes.

Inputs: text (required), customer_id (required). Returns: object

create_followup_taskB

Create a follow-up task for a customer (for example a call or a renewal email).

Inputs: title (required), due_date (required), customer_id (required). Returns: object

get_customer_summaryA
Read-onlyIdempotent

Everything about one customer: profile, revenue, recent orders, notes and open tasks.

Inputs: customer_id (required). Returns: object

list_inactive_customersA
Read-onlyIdempotent

Customers who have bought before but not in the last N days, most valuable first. Use it to find churn risks and win-back opportunities.

Inputs: days, limit, min_lifetime_value. Returns: object

sales_reportB
Read-onlyIdempotent

Revenue, order count, top customers and revenue by product and segment for the last N days.

Inputs: period_days. Returns: object

search_customersA
Read-onlyIdempotent

Find customers by name, company or email, optionally filtered by status and segment.

Inputs: limit, query, status, segment. Returns: object

update_customer_statusB
DestructiveIdempotent

Change a customer's status (lead, active, at_risk, churned). Returns the old and new value.

Inputs: status (required), customer_id (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool has a distinct role: search for discovery, summary for full detail, inactive list for churn targeting, and sales_report for aggregate analysis. The mutation tools (add_note, create_followup_task, update_customer_status) are also clearly separated by action and object. There is little risk of an agent misselecting among these seven tools.

    Naming Consistency4/5

    Most names follow a predictable verb_noun snake_case pattern (search_customers, get_customer_summary, list_inactive_customers, add_note, create_followup_task, update_customer_status). sales_report is the main deviation, using a noun phrase without a verb, though it remains readable and consistent in casing style.

    Tool Count5/5

    Seven tools is well-scoped for a focused CRM server, with each tool covering a recognizable workflow: lookup, detail, churn detection, reporting, notes, tasks, and status updates. None feel redundant or extraneous.

    Completeness3/5

    The surface covers read/search, reporting, notes, tasks, and status changes, but notable CRM operations are missing: creating a customer, updating customer profile fields, and managing or closing follow-up tasks. Agents can still handle core workflows but will hit gaps for full customer lifecycle management.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      MCP server that connects to a sales CRM database, enabling AI agents to search prospects, view pipeline status, manage follow-ups, and update records using natural language commands.
      5
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      A read-only MCP server providing structured access to CRM data (companies, contacts, deals, activities) backed by SQLite. It enables LLMs to search contacts and deals, view full company accounts, find stale deals, and get pipeline summaries.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to manage a fully customizable CRM, including contacts, companies, sales pipelines, custom objects and fields, file uploads, and data relationships via MCP over HTTP.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP clients such as Claude, ChatGPT and Cursor to answer business questions about sales, customers, orders and spreadsheets in natural language by reading live Postgres/SQLite databases and Google Sheets without exporting files or gaining write access. Guardrails include AST-based read-only SQL validation, read-only database roles, row/byte caps with pagination, PII masking, bearer-token auth for remote HTTP use, and a full JSONL audit log of every tool call.
      MIT