crm-readonly-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
crm-readonly-mcp
An MCP server that lets an AI assistant answer questions about your CRM without being able to change it or leak personal data.
Ask Claude or another MCP client things like "which deals over $20k went quiet this month?" or "what is our win rate by owner?". The assistant reads the CRM through six tools. It cannot write, cannot read tables you did not expose, sees emails and phone numbers masked, and every call is logged.
It ships with a demo CRM (40 companies, 120 contacts, 150 deals, about 500 activities) made of fictional data, so you can try it in two minutes.
Tools
Tool | What it does |
| Exposed tables, their columns and row counts. |
| Find contacts by name or company. |
| One contact with company, deals and the last 10 activities. |
| Deals and value per stage, open pipeline, win rate. |
| Open deals with no activity for N days, biggest first, optionally for one owner. |
| One guarded |
All tools are marked read-only (readOnlyHint).
Related MCP server: Demo CRM MCP Server
How it keeps data safe
Read-only connection. The database is opened in read-only mode. No query can write, whatever else happens.
SQLite authorizer for
run_query. While a free query is compiled, SQLite reports every table, column and function it touches, and the server answers for each one. Tables you did not expose (includingsqlite_master) are refused, every action other than reading is refused, and extension loading is refused. This works on what the query actually does, not on how it is written, so comma joins, unbalanced parentheses orUNIONtricks do not get around it.Personal columns read as NULL in free queries. With masking on,
emailandphonecome back asNULLfromrun_query, so no rename, function (substr(email, 2)),UNIONorWHEREprobe can reveal them. The fixed tools return them masked instead (a***@company.example,***42), and email addresses inside free text such as notes are masked too. Contact search does not match on email, so the assistant cannot confirm that an address exists.Text guard in front. Before SQLite sees it, a free query must be one
SELECTorWITH ... SELECTwith balanced parentheses and no comments, quoted identifiers, comma joins afterFROM, schema-qualified names or table functions. It gives the assistant a clear error early; the authorizer is what enforces.Row limits. Every free query is wrapped as
SELECT * FROM (...) LIMIT n, and the response says when it was truncated.Audit log. One JSON line per call: tool, arguments, row count, time, and the error if it was refused. A failing log write is reported on stderr and never breaks an answer.
Run it
npm install
npm run build
npm run seed # writes the demo CRM to data/demo.db
npm start # stdio serverEnvironment variables:
Variable | Default | Meaning |
|
| Path to a SQLite CRM database. |
|
| Where the audit log is appended. |
|
| Set to |
|
| Hard cap on rows per response (max 1000). |
|
| Set to |
The demo data is anchored to 2026-11-24, so pass as_of: "2026-11-24" to stale_deals when you try it.
Connect to a client
Claude Code:
claude mcp add crm -e CRM_DB=/path/to/demo.db -- node /path/to/crm-readonly-mcp/dist/index.jsAny MCP client with a JSON config:
{
"mcpServers": {
"crm": {
"command": "node",
"args": ["/path/to/crm-readonly-mcp/dist/index.js"],
"env": { "CRM_DB": "/path/to/demo.db" }
}
}
}Tests
npm testTwenty-four tests. They cover what the text guard accepts and rejects; that the connection refuses writes even without the guard; that SQLite refuses a hidden table the text guard missed; that UNION, CTE column lists and functions return NULL for personal columns; that no tool output contains an unmasked email or phone; the audit log, including a log that cannot be written; row caps; and the numbers returned by the pipeline and stale-deal tools. Each protection was also switched off on purpose to confirm that a test fails without it.
Using it with your own CRM
The tools are written for the demo schema (companies, contacts, deals, activities). For a real CRM, the usual route is a nightly read-only copy or replica in SQLite or Postgres with the same table names, or a small adapter per tool. Keep the read-only connection and the audit log whatever you change.
Limits
Personal data is protected by column name (
email,phone). If your schema stores personal data under other names, add them toPII_COLUMN_NAMESinsrc/crm.ts.Free text is masked only for email addresses written as text. A free query that transforms a notes column (for example replacing
@) can still reveal an address written inside a note. If notes may contain sensitive data, setALLOW_RAW_QUERY=falseor expose a pre-masked view.SQLite queries run synchronously without a timeout. Row limits bound the output, not the work, so a very heavy join can still be slow on a large database.
Single user, local stdio server with no authentication. Do not expose it over a network as is.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only finance and operations controls for AI agents with evidence and safe next actions.
Read-only AI coding tools for change verification, release readiness, capacity, and guidance.
Read-only sales CRM for AI clients: leads, pipeline, AI-agent chats, calls, ad attribution.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides safe, read-only CRM access for AI assistants with per-key scopes, field masking, rate limits, and a full audit log of allowed and blocked actions.MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to search, de-duplicate and route leads in a demo CRM, with read-only mode and an audit log for accountability.9MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to query SQLite databases and Excel/CSV files read-only, with PII masking, bounded row limits, query timeouts, and audit logging.1MIT
- AlicenseAqualityBmaintenanceEnables AI agents to query lead search, quota, readiness, and answerability through a read-only tool set with provenance metadata, without writes, outbound actions, or raw data export.5MIT