> ## Documentation Index
> Fetch the complete documentation index at: https://docs.attocorp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP

> Connect AI assistants and automations to the CRM through the Model Context Protocol (MCP): generate a key, copy the address and let the AI look up and organize your data safely.

MCP (Model Context Protocol) is a standard way to link an AI assistant to another system. With it, you chat with the AI of your choice and it looks things up in the CRM for you: finds leads, summarizes the funnel, reads a conversation, lists the calendar.

If you allow it, the AI can also organize data: create leads, add tags, write notes, create tasks and appointments. It can also read the prompt of your [AI Agent](https://docs.attocorp.com/en/ia/agente-ia.md) and propose a prompt draft, which only goes live after you review and activate it on the agent screen. The CRM's MCP **never deletes anything and never sends messages** to your customers.

> [!NOTE]
>
> The **Servidor MCP** (MCP server) screen is shown in Portuguese, even when the CRM is set to English. On this page, labels appear exactly as on screen, followed by the English meaning.

## Who can use it

* The screen lives in **Connections**. Anyone with access to **Connections** sees the MCP screen.
* The company **owner** and **managers** generate keys and connect Claude.
* A team **member** can only use the MCP if the owner or a manager turns on the **MCP (AI assistants)** permission for them, on the [Team](https://docs.attocorp.com/en/conta/equipe.md) screen. With it, the member opens the MCP screen and generates only their own key, always read only. See [Member key](#member-key).
* For anyone without one of these permissions, the **Gerar chave** (Generate key) button is disabled.
* Some options are reserved for the company **owner**: turning on **Escrita** (Write), checking **Nunca expira** (Never expires) and turning off **Mascarar dados pessoais** (Mask personal data). For non-owners, the screen shows the notice **Só o dono da empresa libera esta opção.** (Only the company owner can enable this option.)

## How to access

In the side menu, open **Settings** and click **Connections**. On the **Integrations** screen, in the **Other** group, click **MCP**. The screen opens with the title **Servidor MCP**.

> [card] [Open MCP in the CRM](https://app.attocorp.com/app/connections/mcp)
>
> Takes you straight to the screen. You need to be signed in to the CRM.

## What the screen shows

* **Endereço do servidor** (Server address): `https://app.attocorp.com/mcp`. Use this address to read and, if the key allows, to write.
* **Somente leitura (mesmo com chave de escrita)** (Read only, even with a write key): `https://app.attocorp.com/mcp/readonly`. At this address the AI can only read, even if the key has write permission.
* **Como conectar** (How to connect): ready-to-copy instructions in the **Claude**, **Claude Desktop / Cursor** and **n8n / outros** (n8n / others) tabs. The **Claude** tab tells you that in Claude you just paste the MCP address: it opens Atto CRM so you can approve the connection.
* The key list, in the **Ativas** (Active) and **Inativas** (Inactive: expired or revoked) tabs. Each key shows its name, the start of the key (prefix), its permissions, the **Dados mascarados** (Masked data) badge when applicable and **Último uso** (Last used). A connection made through Claude shows the **Connected by Claude** badge, and a member's key shows the **Member key** badge.

Each field has a copy button next to it.

## Generate a key

The key is the password your AI assistant uses to get into the CRM. Each assistant or automation should have its own.

**1. Open the window**

Click **Gerar chave** (Generate key).

**2. Give it a name**

In **Nome** (Name), type something that helps you recognize the key later, for example "Cursor - Ana's laptop". Always say which tool the key will be used in.

**3. Choose the scopes**

**Leitura** (Read) is already selected and is required. Click **Escrita** (Write) if you want the AI to also create and organize data and propose drafts of the AI prompt. Only the company owner can enable **Escrita**.

**4. Choose the access**

Under **Acesso** (Access), pick **Todas as minhas empresas** (All my companies) or **Empresas específicas** (Specific companies). **Todas as minhas empresas** includes future companies where you are the owner or a manager. With **Empresas específicas**, check each company in the list.

**5. Set the expiration**

In **Expira em (dias)** (Expires in, days), enter 1 to 365 days. The default is 90. The company owner can check **Nunca expira** (Never expires).

**6. Decide on personal data**

**Mascarar dados pessoais** (Mask personal data) is on by default and recommended. It hides phone, email and CPF in the answers. Only the company owner can turn it off.

**7. Generate and copy**

Click **Gerar** (Generate). In the **Chave gerada** (Key generated) window, click the copy button and store the key somewhere safe. Then click **Concluir** (Done).

> [!WARNING]
>
> The key is shown **only once**. After you close the window, the screen shows only its beginning. If you lose the key, revoke it and generate a new one. Never share the key in a chat, email or screenshot.

> [!NOTE]
>
> If you are not the owner of every company in the key, the expiration is at most 90 days. If any company hides its members' phone numbers, the key is generated with personal data masked even if you turned the option off, and the screen tells you so.

## Connect through Claude, no key to copy

In Claude (web or app, at claude.ai), you do not need to generate or paste a key. Just add a custom connector with the address `https://app.attocorp.com/mcp`. Claude opens a CRM screen, you choose what to allow and click **Connect**.

**1. Add the connector in Claude**

In Claude, add a custom connector named **CRM - Atto Corp** with the address `https://app.attocorp.com/mcp`. The step by step is in [Connect the MCP to your AI](https://docs.attocorp.com/en/plataforma/conectar-ia.md#claude-on-the-web-or-app).

**2. Sign in to the CRM**

Claude opens the **Claude wants to access your Atto CRM account** screen. If you are not signed in, sign in with your CRM login. To use another account, click **Switch**.

**3. Choose the companies**

Under **Choose companies**, check the companies the AI can look up. Each company shows your role in it (**owner**, **manager** or **member**). With more than two companies, **Select all** appears.

**4. Check the permissions**

Under **This will allow**, the screen shows what the connection unlocks: reading the CRM data of the chosen companies, **Phone, e-mail and CPF arrive masked** and **Never deletes anything or sends messages**. The company owner can open **More options** and check **Allow creating and editing leads, tags, notes, tasks and calendar**.

**5. Connect**

Click **Connect**. When **Done! You can go back to Claude.** appears, go back to Claude and use the connector. If you change your mind, click **Cancel**.

Rules for connecting through Claude:

* **Valid for 90 days.** After that, connect again through Claude.
* **Shows up on the Servidor MCP screen**, in the key list, with the **Connected by Claude** badge. Click it to see the details and usage, just like a regular key.
* **Counts toward the limit of 5 active keys per company** and the limit of 20 connections or keys created per person in 24 hours.
* **A member connects one company only**, always read only.
* **Second factor.** If the company requires two-step verification, the screen asks you to confirm your second factor before connecting. See [Two-step verification](https://docs.attocorp.com/en/conta/seguranca.md).
* **Connecting the same app again** replaces its previous connection, and the screen warns you first.

> [!WARNING]
>
> Only approve the connection if you are the one who just asked for it, from Claude. If the screen says the app name does not match the return address, only continue if you recognize that address.

## Connect your assistant

The step by step for Claude Code, Cursor, GitHub Copilot in VS Code, Copilot Studio and n8n is in [Connect the MCP to your AI](https://docs.attocorp.com/en/plataforma/conectar-ia.md). In those tools you use the same address and the key in the `Authorization: Bearer SUA_CHAVE` header.

> [card] [Connect the MCP to your AI](https://docs.attocorp.com/en/plataforma/conectar-ia.md)
>
> Guide per tool, with the standard name **CRM - Atto Corp** so nobody confuses or deletes the connector by mistake.

> [!TIP]
>
> Once connected, ask the assistant to start with the `whoami` tool. It shows the key name, permissions, the companies the key reaches and the usage limits.

## Member key

A team member can have their own MCP key, or connect through Claude, to look up the CRM with an AI assistant. It is off for everyone by default.

**1. The owner or a manager allows it**

On [Team](https://docs.attocorp.com/en/conta/equipe.md), in **Add member** or when editing a member, check **MCP (AI assistants)** under **Allowed pages** and save. The **Agent** and **Manager** packages do not turn this option on or off.

**2. The member generates the key**

The member opens the **Servidor MCP** screen and clicks **Gerar chave** (Generate key), or connects through Claude. The screen says: "Your key is personal: read only, with masked data, and it shows only what you can see in the CRM. You can have one active key per company."

Member key rules:

* **Only their own key.** A member cannot generate a key for anyone else.
* **Always read only, with masked data.** Phone, email and CPF reach the AI hidden.
* **One company per key** and **one active key per member in each company**. To generate another, revoke the current one.
* **Valid for up to 90 days.**
* **Second factor.** If the company requires two-step verification, the member must also confirm the second factor to generate the key.
* **Cut off right away.** If the owner or a manager turns off the **MCP (AI assistants)** permission, or the member is removed from the team, the key stops working at that moment.

The AI sees only what the member sees in the CRM:

| What the AI looks up | What the member can reach |
| - | - |
| Conversations | Only those in channels enabled for them. In channels set to **Mine**, only the conversations assigned to them. |
| Leads, funnels and tags | Only if they have the **Contacts** page enabled. |
| Activities | Only their own. |
| Calendar | Only if they have the **Calendar** page enabled. |
| Phone numbers | Hidden when the company shows the member only the contact's name. |

With a member key, the AI only has these tools: `whoami`, `list_companies`, `search_leads`, `get_lead`, `list_pipelines`, `funnel_summary`, `list_tags`, `list_conversations`, `get_conversation`, `search_conversations_by_phone`, `list_appointments` and `list_activities`. Company tools (team, billing, broadcasts, AI agents and prompts, templates, stage history and sending failures) do not show up for the member.

## What the AI can read

With an owner or manager key, the AI has these lookup tools:

| Tool | What it does |
| - | - |
| `whoami` | Shows the key in use: name, permissions, whether the address is read only, whether data is masked, companies and limits. |
| `list_companies` | Lists the companies the key can look up. |
| `search_leads` | Finds leads by name, phone, tag, stage, funnel or change date. |
| `get_lead` | Opens a lead: details, notes, funnel cards, stage history and tasks. |
| `list_pipelines` | Lists the funnels with their stages and lead counts. |
| `funnel_summary` | Summarizes the funnel: lead count and total value per stage. |
| `list_tags` | Lists the tags with lead count and color. |
| `list_conversations` | Lists conversations without the messages (channel, phone, name, status, dates). |
| `get_conversation` | Opens a conversation with its messages: the 50 most recent by default, up to 150 at a time. |
| `search_conversations_by_phone` | Finds conversations by the last 8 digits of the phone. |
| `list_appointments` | Lists appointments between two dates (default: today to 30 days; at most 92 days). |
| `list_activities` | Lists follow-up tasks, filtered by status and due date. |
| `list_templates` | Lists message templates, with status and rejection reason. |
| `list_campaigns` | Lists broadcasts with their sending counters. |
| `billing_summary` | Summarizes the billing lists. Requires the broadcast feature to be active in the company. |
| `list_agents` | Lists the AI agents (name, whether active, model, channels). Does not show the prompt: `get_agent_prompt` does that. |
| `get_agent_prompt` | Reads the active prompt of an AI agent: the full text, the active version number, the total number of versions and, if there is one, the MCP draft waiting for you. Only with a key generated by the company owner. |
| `list_prompt_versions` | Shows the prompt version history of an agent, newest first: number, origin (including whether it is an MCP draft), date, size, whether it is the active one and the start of the text. 20 versions by default, up to 100. Only with a key generated by the company owner. |
| `list_team` | Lists the active team (name and role). |
| `stage_history` | Shows lead stage changes, newest first. |
| `list_send_failures` | Lists message sending failures. |

There are 21 lookup tools. Lists come in pages of up to 100 items. The AI asks for the next page when it needs to.

> [!NOTE]
>
> `get_agent_prompt` and `list_prompt_versions` work with a **Leitura** (Read) only key, but only if the person who generated the key is the company owner. A key generated by a manager gets the refusal "So chave criada pelo dono da empresa le o prompt da IA" (only a key created by the company owner reads the AI prompt). With **Mascarar dados pessoais** (Mask personal data) on, phone numbers and emails written in the prompt reach the AI hidden.

## What the AI can write

Only with a key that has **Escrita** (Write), and only through `https://app.attocorp.com/mcp`:

| Tool | What it does |
| - | - |
| `create_lead` | Creates a lead with name and phone, and optionally funnel, stage, tags and value. If the phone already exists, it returns the existing lead without duplicating it. |
| `add_tags` | Adds up to 10 tags to a lead. |
| `remove_tags` | Removes up to 10 tags from a lead. Does not delete the lead. |
| `move_stage` | Moves a lead to another funnel stage, the same way as on the CRM screen. |
| `add_note` | Appends a note to the lead, with the date and the mark "via MCP". Never deletes existing notes. |
| `create_activity` | Creates a follow-up task for a lead. The assignee is the person who generated the key. |
| `create_appointment` | Creates an appointment for a lead in the CRM calendar. Does not create a Google event. |
| `save_prompt_draft` | Saves a prompt **draft** for an AI agent. The draft **does not go live**: it waits for you to review and activate it in the agent's **Personality** tab. See [AI prompt draft](#ai-prompt-draft). |
| `restore_prompt_version` | Brings the agent back to an earlier prompt version from the history. It does not work for MCP drafts, which are only activated on screen. No version is deleted. |
| `assign_lead` | Sets who is responsible for the lead and its conversations, among the active team members. |

There are 10 write tools.

> [!WARNING]
>
> Moving a lead with `move_stage` can notify the team and send the conversion to [Meta Tracking](https://docs.attocorp.com/en/marketing/rastreamento-meta.md). That happens outside the CRM and cannot be undone. The server itself tells the AI to confirm with you first.

> [!WARNING]
>
> `restore_prompt_version` changes the text the AI uses right away: from the next message on, it replies to your customers with the chosen version. The server itself tells the AI to confirm with you first. The version that was active stays saved in the history.

## AI prompt draft

The prompt is the text that guides every reply of your [AI Agent](https://docs.attocorp.com/en/ia/agente-ia.md). That is why the MCP **never puts a new prompt live on its own**. It only proposes a draft, and a person in your company decides whether to activate it.

This protects you from a real risk: your assistant's AI reads messages, notes and names written by customers. If a customer writes a disguised instruction there, it does not become a rule for the AI that serves all your customers without someone reading it first.

**1. The assistant reads the current prompt**

With `get_agent_prompt`, the assistant reads the active text and notes the active version number.

**2. The assistant saves the draft**

With `save_prompt_draft`, it sends the full proposed text and the version number it read. The draft goes into the history with the origin **MCP draft**. The AI keeps replying with the previous active version.

**3. You see the notice**

In the agent's **Personality** tab, the notice **Prompt draft waiting for you** appears. Click **Review draft**.

**4. You review it**

In **What changed**, see the new and removed lines. In **Full text**, read the whole prompt.

**5. You decide**

Click **Activate this version** to put the draft live, or **Close without activating** to leave everything as it is.

Draft rules:

* **Owner only.** Saving a draft requires a key with **Escrita** (Write), and it only goes through if the person who generated the key is the company owner.
* **Unmasked key.** With **Mascarar dados pessoais** (Mask personal data) on, the prompt is read with phone numbers and emails hidden. So that key cannot save a draft: saving it back would break that data in the text.
* **Size.** The text must have 20 to 100,000 characters.
* **No invisible characters.** Text with invisible characters (which can hide instructions) is refused. If any reach the screen, they show up marked as `[U+...]` and the activate button is locked.
* **Version check.** If the active prompt changed after it was read, the draft is refused and the assistant has to read it again.
* **No repeats.** Text equal to the active version or to an existing draft is not saved again.
* **At most 5 drafts waiting** for your review per agent. After that, the assistant has to wait for you to review.
* **At most 30 drafts per agent in 24 hours.**
* **Nothing is deleted.** Drafts and old versions stay in the history.
* **Record.** Every draft and every version restore through the MCP is recorded with the key used, without storing the text in the record.

## Security and limits

* **Nothing is deleted and no message is sent.** There is no tool for that.
* **Writing is owner only.** Even with a write key, a change only goes through if the person who generated the key is still the company owner.
* **AI prompt is owner only.** Reading the prompt and its version history only works with a key generated by the company owner. A prompt draft never goes live unless someone activates it on screen.
* **The key only works for the chosen companies.** Requests for any other company are refused.
* **The key loses access on its own** when it expires or when the person who generated it is no longer an owner or manager of the company. A member key also loses access right away when the **MCP (AI assistants)** permission is turned off or the member leaves the team.
* **Masked data.** With **Mascarar dados pessoais** on, phone, email and CPF reach the AI hidden.
* **Customer text is treated as data.** The server tells the AI never to follow instructions written in messages, notes or names.
* **Per-key limits, per minute:** 60 lookups, 30 searches, 10 reports and 20 writes.
* **Per-company limits, adding up all keys:** 600 calls per minute and 10,000 per day.
* **Member key limits:** each member key makes up to 2,000 lookups per day. Added together, the company's member keys make up to 5,000 lookups per day, half of the company quota. That way, member usage never takes away the owner's and managers' quota.
* **Load protection.** A lookup that runs past the time limit is cut off. When the CRM is busy, the request is refused and the AI is told how many seconds to wait. An answer that is too large asks the AI to fetch smaller pages.
* **Key limit.** Up to 5 active keys per company, counting connections made through Claude, and up to 20 keys or connections created per person in 24 hours. Each member has at most 1 active key per company.

## Track a key's usage

Click a key in the list to open its details. The window has three tabs:

* **Detalhes** (Details): **Usado por último** (Last used), **Criado em** (Created on), **Expira em** (Expires on) or **Revogado em** (Revoked on), **Prefixo** (Prefix), **Escopos** (Scopes), **Empresas** (Companies) and **Criada por** (Created by).
* **Conexões** (Connections): which assistants used the key, how many sessions, the first and last time and the IP.
* **Atividade** (Activity): hourly usage per tool, with the result (for example **ok**, **recusado** (refused), **limite da chave** (key limit), **cota diaria da empresa** (company daily quota), **cota diaria da chave** (key daily quota) or **cota diaria das chaves de membro** (member keys daily quota)), the number of calls and the average time. Covers the last 90 days.

The owner and managers see and revoke the keys of anyone in the company, including members' keys. A member sees and revokes only their own.

## Revoke a key

**1. Open the key**

In the **Ativas** (Active) tab, click the key.

**2. Revoke it**

Click **Revogar** (Revoke). In the **Revogar esta chave?** (Revoke this key?) window, click **Revogar** again.

Access is cut off immediately for every assistant using the key. It cannot be undone. The key moves to the **Inativas** (Inactive) tab with the **Revogado** (Revoked) status.

For a connection made through Claude, the button is called **Disconnect**. In the **Disconnect this app?** window, click **Disconnect** again. Claude loses access right away. To use it again, connect again through Claude.

## Common errors

| Message | What it means |
| - | - |
| **Limite de 5 chaves ativas por empresa. Revogue uma antes de gerar outra.** | The company already has 5 active keys. Revoke one you no longer use. |
| **Só o dono da empresa pode liberar escrita.** | You are not the owner of every chosen company. Generate the key with **Leitura** (Read) only. |
| **Só o dono ou um gerente da empresa pode gerar chave.** | Your role in the company does not allow generating keys. Ask the owner or a manager to turn on the **MCP (AI assistants)** permission for you. |
| **Your MCP permission in this company is not enabled. Talk to the company owner.** | You are a member and the **MCP (AI assistants)** permission is off for you. |
| **You already have an active MCP key in this company. Revoke it before creating another.** | Each member has one active key per company. Revoke the current one to generate another. |
| **A member key is read only.** | A member key cannot get **Escrita** (Write). |
| **Confirm your second factor to continue.** | The company requires two-step verification. Confirm the code from your authenticator app and try again. |
| **Não foi possível gerar a chave. Tente de novo.** | Generating failed. Try again. |
| **Informe de 1 a 365 dias.** | The expiration is outside the allowed range. |

In the AI assistant, an invalid, expired or revoked key shows up as "token do MCP invalido ou revogado" (MCP token invalid or revoked). If the AI tries to write through the read-only address, it gets "este endereco e so leitura" (this address is read only). If the key has no write permission, it gets "esta chave nao tem o escopo de escrita" (this key does not have the write scope).

## Frequently asked questions

> [accordion] I lost the key. Can I see it again?
>
> No. The key is shown only once. Revoke the old key and generate a new one.

> [accordion] Can the AI delete a lead or message a customer?
>
> No. The CRM's MCP has no tool that deletes data or sends messages.

> [accordion] Why is the Write option locked?
>
> Only the owner of every company in the key can enable **Escrita** (Write). Managers generate read-only keys.

> [accordion] I have several companies. How does the AI know which one to look up?
>
> If the key has a single company, the AI uses it. With several, the AI uses `list_companies` to see them and picks which one to look up on each request.

> [accordion] Why are phone numbers hidden?
>
> The key has **Mascarar dados pessoais** (Mask personal data) on, which is the default. Only the company owner can generate a key without the mask, and companies that hide their members' phone numbers always mask.

> [accordion] The AI said the limit was exceeded.
>
> The key or the company went over the usage limit. Wait a few seconds and ask again. The answer itself says how long to wait.

> [accordion] Can the assistant change my AI Agent's prompt on its own?
>
> No. With `save_prompt_draft` it only saves a draft, which waits in the agent's **Personality** tab until someone clicks **Activate this version**. The only direct change is `restore_prompt_version`, which goes back to an old version from the history that is not an MCP draft, and the server tells the AI to confirm with you first.

> [accordion] Can a team member use the MCP?
>
> Yes, if the owner or a manager turns on the **MCP (AI assistants)** permission for them on the [Team](https://docs.attocorp.com/en/conta/equipe.md) screen. Their key is read only, with masked data, covers one company and shows only what they see in the CRM. See [Member key](#member-key).

> [accordion] Do I need a key to use Claude on the web or in the app?
>
> No. In Claude, add a custom connector with the address `https://app.attocorp.com/mcp` and approve the connection on the CRM screen. See [Connect through Claude, no key to copy](#connect-through-claude-no-key-to-copy).

> [accordion] Can I use the same key in several assistants?
>
> You can, but it is best to have one key per assistant or automation. That way, revoking one keeps the others working, and the **Conexões** (Connections) tab shows who used each key.

## Related pages

> [card] [Connections](https://docs.attocorp.com/en/conta/conexoes.md)
>
> Channels and integrations in your account.

> [card] [AI Agent](https://docs.attocorp.com/en/ia/agente-ia.md)
>
> Where you review and activate the prompt draft.

> [card] [Team](https://docs.attocorp.com/en/conta/equipe.md)
>
> Owner, manager and other member roles.

> [card] [Meta Tracking](https://docs.attocorp.com/en/marketing/rastreamento-meta.md)
>
> Conversions sent when a lead changes stage.

> [card] [Platform overview](https://docs.attocorp.com/en/plataforma/visao-geral.md)
>
> Get to know the CRM modules.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.