Skip to content
mcpcrm
Working with a CRM through your AI agent

Chapter 3 of 10

Connect your agent to your CRM

Your AI agent reaches your CRM through MCP, an open standard for connecting assistants to other programs. This chapter explains it in plain words, shows the settings for each common client, and covers tokens and roles.

MCP in plain words

The Model Context Protocol, or MCP, is a standard way for an AI assistant to use another program. The program, here your CRM, offers a list of tools, such as search_records or create_record. The assistant reads the list and picks a tool, and the CRM runs it and sends back the result.

Three things make it work. The CRM needs an MCP server with an address, the agent needs a token that says which CRM user it is, and you need a client that speaks MCP, such as Claude Code, Codex or Cursor.

Some apps get the token by sign-in instead. In Claude or ChatGPT you add a custom connector with the CRM’s address, sign in to the CRM in your browser and approve. The app then keeps a token that expires and renews itself, so there is nothing to copy. This works when the CRM supports it, as mcpcrm Team does.

The CRM still decides what is allowed. If the agent’s user may not delete records, a delete fails, whatever the agent was asked to do.

Where your CRM’s MCP server comes from

Your CRM has its own MCP server

A gateway adds one

The CRM is built for agents

Settings for each client

These examples use an address from mcpcrm Solo. For mcpcrm Team, use your server’s own address, such as https://crm.yourcompany.com/mcp. For another CRM, use the address and token from its own setup page. Replace the example token with your agent’s token.

Claude Code

The Agents page in the app shows this command with your address and your agent’s token.

claude mcp add --scope user --transport http mcpcrm https://relay.mcpcrm.app/m/your-connection-id/mcp \
  --header "Authorization: Bearer mcpcrm_your_agent_token"

Codex

Codex reads the token from an environment variable, so the token stays out of its settings file.

# In your shell profile, such as ~/.bashrc or ~/.zshrc
export MCPCRM_TOKEN=mcpcrm_your_agent_token

# Then, once
codex mcp add mcpcrm --url https://relay.mcpcrm.app/m/your-connection-id/mcp --bearer-token-env-var MCPCRM_TOKEN

Cursor and other clients that accept a URL

Use your address from the Agents page.

{
  "mcpServers": {
    "mcpcrm": {
      "url": "https://relay.mcpcrm.app/m/your-connection-id/mcp",
      "headers": { "Authorization": "Bearer mcpcrm_your_agent_token" }
    }
  }
}

Claude Desktop with a token

Through the mcp-remote bridge, which needs Node.js. The token goes in env, which also works on Windows. With mcpcrm Team, sign-in is simpler.

{
  "mcpServers": {
    "mcpcrm": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://relay.mcpcrm.app/m/your-connection-id/mcp", "--header", "Authorization:${AUTH}"],
      "env": { "AUTH": "Bearer mcpcrm_your_agent_token" }
    }
  }
}

Claude and ChatGPT with sign-in (mcpcrm Team)

Add a custom connector with your server’s address. You sign in to mcpcrm and choose the agent’s workspaces and role, so there is no token to copy. This works in Claude on desktop, web and phone. For mcpcrm Solo it is planned.

https://crm.yourcompany.com/mcp

After you add the server, start a new session in your client so that it loads the tools. In Claude Code, the /mcp command shows whether the server is connected.

Look after the token

  • A token works like a password for the agent. Anyone who has it can act as that agent.
  • Create one token for each agent on each computer, so that you can revoke one without stopping the others.
  • Keep tokens out of chats, shared documents and code repositories. Codex reads the token from an environment variable, and Claude Code keeps it in your user settings.
  • Give each agent a name you will recognise later, such as “Claude Code on the office laptop”.
  • Revoke a token as soon as a computer is lost or a person leaves.

Choose a role for each agent

An agent should be a CRM user of its own, with its own role, and never use an administrator’s or a shared login. Start with the smallest role that does the job. You can give it more later.

RoleWhat it can doUse it for
AdminReads, creates, changes and deletes records in the workspace. It can also add fields and import records.Your own agent while you set up a workspace and import data.
MemberReads, creates and changes records. It cannot delete.Day-to-day work, such as logging, follow-ups and clean-up.
ContributorReads everything, adds records only in the modules you allow, changes only the records it added, and never deletes.Agents from outside tools, such as a website chat, a form handler or another team’s assistant.
ViewerReads records and changes nothing.Reports and questions about your data.

The contributor role suits agents you do not watch closely. By default a contributor in mcpcrm can add Comments, Tasks and Leads, and the workspace’s owners can change that list. The safety chapter covers it in more detail.

A worked example: two agents in one studio

Check the connection

Before an agent changes anything, ask it what it can do. It should name its CRM user, its role and its tools. If the answer looks wrong, fix the role before you start.

Check what you can do

Before we start, call list_workspaces if you have it, then whoami. Tell me which workspaces you can use, which CRM user you are, and what your role lets you read, create, change and delete in each module. Change nothing yet.

Learn the fields

Call describe_module for Leads, Contacts, Organisations and Opportunities. Summarise the required fields, the picklist values for lead status, lead source and sales stage, and any custom fields. Use only these fields and values from now on.

Read the rules first

Read the rules for this workspace and the CRM manual you were given when you connected. Tell me in five lines what you must never do here, and ask me about anything that is unclear before you change a record.

Try it with your own agent

mcpcrm Solo is free for one person and runs in your browser. Connect your agent, and it gets the CRM manual and your rules when it connects. Then start with the prompts in this guide.