I self-hosted a CRM and Claude Code set up a sales pipeline in 58 seconds. Here's what MCP got right and wrong
I gave Claude Code one prompt against a CRM running on my own server. 58 seconds later there was a Deals list with five demo deals in EUR, and a board grouped by stage. This post walks through that run: the install, the
I gave Claude Code one prompt against a CRM running on my own server. 58 seconds later there was a Deals list with five demo deals in EUR, and a board grouped by stage. This post walks through that run: the install, the MCP connection, the prompt, the calls, and what you don't get when you self-host.
It is one run with Claude Code on Sonnet, not a benchmark. The deals are demo data.
Context: Customermates is an open-source CRM that helps a small team follow up on every client conversation. On the cloud you connect LinkedIn and email, and Mate or your own AI agent drafts each reply and the next step for you to review and send. This post is about the open-source side: self-hosting it and letting your own agent set it up over MCP.
What you need
Docker with Compose and Claude Code. The same x-api-key header is the route for other local clients such as Claude Desktop, Codex, Cursor and Gemini CLI, but I only recorded Claude Code.
Install
mkdir customermates && cd customermates
R=https://raw.githubusercontent.com/customermates/customermates/main
curl -fsSLO $R/docker-compose.yml
curl -fsSL $R/.env.selfhost.template -o .env
sed -i "s/change-this-password/$(openssl rand -hex 16)/" .env
sed -i "s/change-this-to-a-long-random-secret/$(openssl rand -hex 32)/" .env
docker compose up -d
Two files, two generated secrets, one command. (sed -i as written is GNU sed; on macOS use sed -i ''.) Compose starts two containers, postgres:16-alpine and ghcr.io/customermates/customermates:latest, and migrations run on every start. The docs say the first start takes about a minute. Mine was ready in seconds because the images were already pulled.
Follow it with docker compose logs -f app. In my run the log showed one P1001: Can't reach database server error first, because the app container came up before Postgres. Then the migrations applied and Next.js printed Ready in 101ms. The sign-up page answered with HTTP 200.
One setting to know about: RESEND_API_KEY in .env. Email goes out through Resend only, there is no SMTP option. Without a key, accounts work for 24 hours and then wait for email verification.
Open http://localhost:4000, sign up and create a workspace. A new self-hosted workspace starts with no lists at all. That matters for the prompt below: Claude starts from an empty model.
Connect Claude Code
Create an API key in the app (it is shown once, so copy it), then add the MCP server:
claude mcp add --transport http customermates http://localhost:4000/api/v1/mcp --header "x-api-key: <your key>"
The endpoint is <BASE_URL>/api/v1/mcp. Local clients send the key in x-api-key. OAuth for cloud connectors needs a public HTTPS BASE_URL, so on localhost the key is the way in. The model is yours: external clients use your own AI provider, and Customermates does not bring one along.
The prompt
Set up a deal pipeline for my design studio: a board by stage and five demo deals with values in EUR, spread across the stages.
That is all I typed. No schema, no stage names.
What Claude did
Apart from some read calls at the start and a read-back at the end, the writes were:
configure_record_modelcreated a Deals list. In my run Claude previewed the change first, then applied the same one.mutate_crm_record, five times, one deal each, spread from Lead to Won.manage_data_viewscreated a view called Pipeline, a board grouped by stage.
Wall clock for the whole thing was 58 seconds. Claude's closing message said it had used five stages with no Lost stage, and offered to add one.
What is in the self-hosted build, and what is not
Self-hosted runs the CRM core, always. These work: lists and views, Excel import and export, Configure (lists, fields, relationships, calculations), dashboard widgets, members and roles, the Activity log, REST, webhooks and MCP.
These are cloud only and switched off: connected messaging accounts (email, LinkedIn, WhatsApp, Instagram, Telegram), the unified inbox, connected calendars, Mate (the hosted assistant) and its credits, routines and the AI workspace setup. The MCP docs say up to 59 tools on the cloud. A self-hosted one drops the messaging, social and routine tools, so I won't quote a number for it.
The license is open core. Files outside ee/ are AGPL-3.0-only. ee/ is under the Customermates Commercial License, which allows running the official image self-hosted, also in production, as a Community Build with the cloud-only features off. Contributions go through a CLA (.github/CLA.md).
On telemetry, only this much is true: the published image turns off Next.js and Prisma telemetry and sets no error-reporting address, and a GeoNames postal-code file is downloaded on first use unless you set POSTAL_CODE_DATA_URL=off. It is not an air-gapped build, and your AI client sends whatever it reads to your AI provider.
About safety
The MCP server instructions ask clients to confirm before deleting or sending. That is guidance to the client, not a gate the server enforces. Approvals that the server enforces exist in Mate, and Mate is cloud only. If you point an agent at a self-hosted instance, the confirmation you get is whatever your client does, for instance Claude Code's permission prompts. I used demo data for exactly this reason.
Lessons
58 seconds is the time of the recorded run, not an average. Another run may take longer or shorter, and I did not collect a spread.
A one-sentence prompt gets you a reasonable first draft of a model, not the model. Claude chose five stages and no Lost stage, and I would not leave that unreviewed on real data.
The configure tool has a preview step and Claude used it before changing anything. If you build your own agent workflow around a tool like that, keep the preview.
An empty start is both a feature and a cost. Nothing is predefined, so your agent or you must say what a "deal" is. The cloud's AI workspace setup is not in the self-hosted build.
Where this doesn't apply
On real customer data: a one-sentence prompt gives you a first draft of a data model, not the model. Review it before you load anything real.
Destructive actions: the server asks clients to confirm deletes, but on a self-hosted instance the only enforced confirmation is your MCP client's permission prompt.
The inbox, connected accounts, calendars, Mate and routines: cloud only, so the follow-up drafting itself is not part of what you self-host.
FAQ
Does it need the cloud? No. The core runs on your server with docker compose; nothing phones home beyond an optional postal-code file. Which AI provider? Whatever your MCP client uses. The CRM doesn't call a model itself when self-hosted. Other clients than Claude Code? The same x-api-key header works for Claude Desktop, Codex, Cursor and Gemini CLI; I only recorded Claude Code. Is 58 seconds a benchmark? No, one recorded run on demo data.
Try it
Repo: https://github.com/customermates/customermates
Self-hosting guide: https://customermates.com/docs/self-hosting
Demo with no signup, demo data: https://demo.customermates.com
I'm Ben and I build Customermates, an open-source CRM for following up on client conversations. Where would you put the confirmation for destructive agent actions: in the client, or enforced by the server?
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.