Disclosure: I work at Conduyt, a CRM company, and the examples below come from our own MCP server. The patterns apply to any CRM you connect to an agent.

A few weeks ago I wrote about letting an AI agent work in a CRM without breaking it: start read-only, widen writes slowly, check the work. That piece was about one agent and one person.

This one is about what happens when the agent is a coding agent like Claude Code, the CRM sits behind an MCP server, and there's more than one agent on the team. The setup is quick. The decisions around it are where the problems show up.

What the agent actually sees

It's worth getting the terms right, because they map to where each control lives.

In MCP, the host is the AI application, such as Claude Code. The host creates one client per server, and each client keeps its own connection. The server exposes tools (things the model can call), resources (data it can read) and prompts (reusable templates). The client finds tools with tools/list and runs them with tools/call.

A local CRM server usually runs over the stdio transport, which means it's a process on your machine holding your API key.

That gives you three separate places to put a control:

  1. The key the server holds. This decides what the CRM will accept.
  2. The host's permission rules. These decide which tools the model can call without asking you.
  3. The server's own tool design. This decides how a dangerous call has to be shaped before it runs.

Most setups only use the first one. You want all three, because each one catches mistakes the others miss.

Layer 1: the key decides the ceiling

Our server takes a single API key in an environment variable. Keys come in three tiers: read (GET only), write (GET, POST, PATCH) and admin (full access including DELETE). Scopes can also be limited to specific modules such as contacts, deals or tasks.

For a coding agent, I'd ask what it needs, not what it might find useful. An agent writing an integration or a report needs read access to a couple of modules. An agent filing follow-up tasks needs write on tasks and nothing else. I can't think of a coding-agent job that needs an admin key.

The key is also the only layer the model can't talk its way around. A host rule can be misconfigured and a tool description can be misread, but a read key can't delete anything. If you only set up one control, set up this one.

Two things help here:

  • Ask the server what the key can do. Our server has a tool, conduyt_check_permissions, that reports the current key's permissions. Run it at the start of a session. It's the quickest way to confirm you connected the key you meant to.
  • Keep keys out of the repo. In Claude Code, a project .mcp.json supports ${API_KEY}-style environment variable expansion, so every teammate supplies their own key and no secret gets committed.

Layer 2: the host decides what needs a human

Claude Code's permission rules live in .claude/settings.json, are checked deny first, then ask, then allow, and are enforced by Claude Code rather than the model. A broad deny can't be overridden by a narrower allow.

That makes the host the right place to say: this tool can run freely, this one needs a yes from me, and this one never runs in this repo.

Here's the kind of rule set I'd start with. It's illustrative: check your host's docs for the exact rule syntax, and use the real tool names your server returns from tools/list.

// .claude/settings.json: ILLUSTRATIVE, not a drop-in config { "permissions": { "deny": [ "mcp__crm__conduyt_merge_contacts", // destructive "mcp__crm__conduyt_forget_contact" // irreversible ], "ask": [ "mcp__crm__conduyt_update_contact", // writes to a shared record "mcp__crm__conduyt_send_chat_message" // other people will read it ], "allow": [ "mcp__crm__conduyt_check_permissions", "mcp__crm__conduyt_search", "mcp__crm__conduyt_list_contacts", "mcp__crm__conduyt_get_contact" ] } } 

The pattern matters more than the names. Allow reads, put writes to shared records and anything other people will see on "ask," and deny anything you'd only ever do on purpose, in the CRM's own UI.

One caveat: project-scoped MCP servers in Claude Code have to be approved by each user in an interactive session. That's a good default. Don't script around it.

Layer 3: the server shapes the dangerous calls

Host rules depend on someone writing them. The server is where you make sure a dangerous call can't happen by accident even when nobody did.

A few patterns from our server that I'd look for in any CRM's MCP server:

  • Preview, then confirm. The contact merge tool is labelled destructive. Called without a confirmation flag it returns a preview of what would move. The real merge needs the preview's expected counts sent back, and only against a preview the server returned in the last ten minutes.
  • Typed confirmations for irreversible actions. The GDPR erasure tool requires confirm='FORGET', and it's owner-only.
  • Preview-only bulk tasks. The AI bulk tools (import and enroll, segment and act, pipeline cleanup) only preview. Running them is limited to a human session.

MCP has a protocol-level version of this too. With elicitation, a server can ask the user for more information or for confirmation of an action. If your host supports it, it's a cleaner way to confirm than hoping the model passes the right flag.

Why two agents loop

This is the part people don't plan for. As soon as two agents can act on the same records or the same thread, you get loops that neither agent meant to start. In my experience they come in three shapes.

The conversation loop. Agent A mentions agent B, B answers and mentions A, and so on. Each reply makes sense on its own.

The retry loop. A call times out, the agent assumes it failed and sends it again, and now the reply or task exists twice. The other agent sees two and responds to both.

The dueling-write loop. Two agents read the same record, both decide it needs fixing, and each one "corrects" the other's change.

None of these is a model problem, and asking agents nicely in a prompt won't fix them. Each one needs a mechanical brake.

Four brakes, all outside the model

1. A turn cap on agent-to-agent threads. In our team chat, after six AI replies in a row the thread pauses until a person weighs in. The send tool applies the same guard to agent keys. The exact number is a judgment call. What matters is that it's enforced on the server.

2. Idempotency keys on anything an agent posts. Our reply tool takes an idempotencyKey built from the message being answered. A retried turn gets the first reply back, flagged as a replay, instead of posting twice.

// ILLUSTRATIVE tools/call request. Only idempotencyKey's // "reply:<source message id>" shape comes from the server's docs; // the other argument names are placeholders. { "jsonrpc": "2.0", "id": 7, "method": "tools/call", "params": { "name": "conduyt_reply_chat_message", "arguments": { "messageId": "<source message id>", "body": "Created the follow-up task for Friday.", "idempotencyKey": "reply:<source message id>" } } } 

Derive the key from what triggered the turn, not from a timestamp or a random UUID. Otherwise every retry looks new.

3. Don't let the server retry writes for you. Our server reports Retry-After but doesn't replay a refused write on its own: the refusal comes back to the caller verbatim, with a stable error format. The one exception is the last step of a file upload, which it repeats a few times while the upload is still being processed. That sounds less helpful, but it means a retry is a decision someone made, and you can see it in the log.

4. Revision checks on shared records. Write tools that accept an expectedRevision refuse a stale save with a 409 instead of overwriting. I covered this in the earlier piece. It's what turns a dueling-write loop into one clean refusal that the second agent has to read and react to.

Permissions follow a person

One more rule matters once agents share a channel. Each agent should act with its owner's permissions and never more. Our AI teammates work that way, and anything one wants to send under a person's name waits for that person to approve it, edit it or decline it.

This is what makes the earlier layers make sense. A key tier is easy to reason about when it belongs to one named person. It isn't when it belongs to "the bot."

A starting checklist

  • One key per agent, at the lowest tier and fewest modules the job needs.
  • Run a permissions check at the start of every session.
  • Host rules: allow reads, ask on shared writes, deny destructive and irreversible tools.
  • Prefer servers that use preview-then-confirm and typed confirmations.
  • Before two agents share anything, check for a server-side turn cap, idempotent replies, no automatic write retries, and revision checks.

Then test it: have two agents work on the same record at the same time, and see which brake stops them.

Jordan Tate is VP of Customer Relations at Conduyt, a flat-price CRM for small sales teams where people and AI agents work in the same records. Jordan writes about putting agents to work inside a CRM safely; Conduyt's MCP server is documented at conduyt.com/mcp.