---
title: "Connect your agent to your CRM | mcpcrm guide"
url: https://mcpcrm.app/guide/connect-your-agent/
description: "This chapter explains MCP in plain words and gives the settings for Claude Code, Claude, ChatGPT, Cursor and Codex. It covers keeping tokens safe and choosing a role for each agent, including a contributor role for agents from outside tools."
---

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

Several hosted CRMs, such as HubSpot, offer an MCP server or an AI connector, and Odoo 20 includes one. Follow its setup page, then use the rest of this guide for roles, rules and routines.

### A gateway adds one

For vtiger, [mcpcrm Connect](https://mcpcrm.app/connect/) adds an MCP server through a plugin in your CRM, and your agent signs in as a CRM user. vtiger is supported, and SuiteCRM and Odoo 16 to 19 are planned.

### The CRM is built for agents

[mcpcrm Solo](https://mcpcrm.app/solo/) and [mcpcrm Team](https://mcpcrm.app/team/) give each agent its own token and a role in each workspace, and show you every call it makes.

## 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.

| Role | What it can do | Use it for |
| --- | --- | --- |
| Admin | Reads, 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. |
| Member | Reads, creates and changes records. It cannot delete. | Day-to-day work, such as logging, follow-ups and clean-up. |
| Contributor | Reads 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. |
| Viewer | Reads 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](https://mcpcrm.app/guide/safety/) covers it in more detail.

## A worked example: two agents in one studio

1.  ### The owner creates the agent
    
    A design studio’s owner opens Agents in mcpcrm, chooses New agent, names it “Codex on the studio laptop” and gives it the member role in the studio’s workspace. The token is shown once, so she copies it straight into her shell profile.
    
2.  ### She adds the server to Codex
    
    She runs the `codex mcp add` command from the settings below, with her own address. Codex reads the token from the `MCPCRM_TOKEN` variable.
    
3.  ### The agent checks its access
    
    She asks the agent what it can do. It calls `list_workspaces` and `whoami` and answers that it is the member agent in one workspace, can create and change records, and cannot delete.
    
4.  ### A second agent for the website
    
    Later she connects the chat on the studio’s website as a contributor. With the default settings it can add Leads, Tasks and Comments, and it cannot change or delete anything a person or another agent created.
    

## 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.
```

## In mcpcrm

In mcpcrm you create an agent on the Agents page, choose its role in each workspace and copy the settings for your client with the token filled in. The token is shown once and stored only as a hash. On mcpcrm Team, each person can also connect Claude or ChatGPT with sign-in, with at most their own role. Agents reach mcpcrm Solo through the relay while your tab is open, and connect to mcpcrm Team at your server’s own address. Every call appears in the agent monitor as it happens.

[Tools and settings for each client](https://mcpcrm.app/agents/)

## 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.

[Open the app](https://app.mcpcrm.app)[Get the prompt pack](https://mcpcrm.app/guide/prompts/)
