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

# MCP server

> Connect AI apps such as Claude, ChatGPT, and Cursor to your Chatling project.

Chatling's MCP server lets AI apps work with your Chatling project. Once connected, you can ask an app things like "Summarize yesterday's unresolved conversations" or "Add our new pricing page to the knowledge base", and it uses Chatling's tools to do it. The tools run the [Chatling API](https://docs.chatling.ai/api-reference/v3/introduction.md), so they work with the same data and follow the same rules.

MCP, the Model Context Protocol, is an open standard for connecting AI apps to tools. The server URL is:

```
https://mcp.chatling.ai
```

## Requirements

* The project's plan must include API access.
* Any member can connect an app, unless the project allows only certain roles. An app can never do more than the member who connected it.

## Connect an app

You'll also find these steps in the dashboard, under **Project settings > Connected apps**.

> [tab] Claude
>
> **1. Open connectors in Claude**
>
> In [Claude](https://claude.ai/customize/connectors), go to **Customize > Connectors**. On Team and Enterprise plans, an owner adds the connector first in **Organization settings**.
>
> **2. Add a custom connector**
>
> * Click **Add**, then choose **Add custom connector**.
> * Name it Chatling and paste the server URL.
> * If Claude asks how to identify itself, choose **Register automatically**.
> * Click **Add**.
>
> **3. Connect**
>
> You're redirected to Chatling. Choose what Claude can access and click **Allow access**.

> [tab] ChatGPT
>
> **1. Open plugins in ChatGPT**
>
> In ChatGPT on the web, go to [Plugins](https://chatgpt.com/plugins). Custom MCP servers depend on your ChatGPT plan and workspace settings.
>
> **2. Add a custom MCP server**
>
> * Click **Add**, then choose **Add custom MCP server**.
> * Name it Chatling and paste the server URL.
> * Under authentication, choose **OAuth**.
> * Review the warning and select **I understand and want to continue**.
> * Click **Create as a plugin**, then choose **Continue to Chatling**.
>
> **3. Connect**
>
> You're redirected to Chatling. Choose what ChatGPT can access and click **Allow access**.

> [tab] Claude Code
>
> **1. Add the server**
>
> Run this in your terminal. `--scope user` makes Chatling available in all your projects.
>
> ```bash theme={null}
> claude mcp add --transport http --scope user chatling https://mcp.chatling.ai
> ```
>
> **2. Connect**
>
> Start Claude Code and run `/mcp`. Select **chatling**, choose **Authenticate**, and approve the connection in Chatling.

> [tab] Codex
>
> **1. Add the server**
>
> ```bash theme={null}
> codex mcp add chatling --url https://mcp.chatling.ai
> ```
>
> **2. Connect**
>
> Codex opens Chatling in your browser. Approve the connection there. If the browser doesn't open, run `codex mcp login chatling`.

> [tab] Cursor
>
> **1. Add the server**
>
> In the dashboard, click **Add to Cursor** under **Project settings > Connected apps**, or add Chatling to `~/.cursor/mcp.json`:
>
> ```json theme={null}
> {
>   "mcpServers": {
>     "chatling": {
>       "url": "https://mcp.chatling.ai"
>     }
>   }
> }
> ```
>
> **2. Connect**
>
> In Cursor, open **Customize > MCPs** in the sidebar, or press `Cmd+Shift+P` (`Ctrl+Shift+P` on Windows and Linux) and type Open MCPs. Click **Authenticate** next to Chatling and approve the connection in Chatling.

> [tab] Other apps
>
> Add `https://mcp.chatling.ai` as a custom connector or remote MCP server. If the app asks how to sign in, choose **OAuth**, then approve the connection in Chatling.
>
> If the app doesn't support OAuth, [use an API key](#use-an-api-key-instead).

## Choose what an app can access

When you approve a connection, you choose:

* **Project:** the project the app can use. To use several projects, connect the app once for each.
* **Agent access:** all of the project's AI agents and chatbots, or only the ones you select. Apps limited to selected agents can't use project-wide tools, such as project settings or members.
* **Permissions:** read and write, read only, or custom access for each permission group.

These work like [API key restrictions](https://docs.chatling.ai/api-reference/v3/authentication.md#key-restrictions). The app only sees the tools its access allows. To change an app's access, disconnect it and connect it again.

### Access follows your role

The consent screen offers only what your role allows. For example, an agent can let an app read and reply to conversations, but not manage contacts or AI agents. If you're limited to certain AI agents, so is the app.

If your role changes or you're limited to fewer agents, your apps lose that access at once. A promotion doesn't widen an app's access; connect it again to give it more.

Tools that act as a user, such as `start_conversation`, `send_user_message`, and `rate_message`, are only available if your role can test AI agents.

> [!WARNING]
>
> An app can read whatever its access allows, including messages from your users, and those messages can contain instructions aimed at the AI. Give each app only the access it needs, such as **Read only** for reporting, and review what the app proposes before it sends replies or changes your agents.

## Tools

The server has 78 tools, one for each API endpoint, except where one tool covers several endpoints. Three of them, for [building workflows](#build-workflows), are only available through MCP.

| Area | What the app can do |
| - | - |
| Project | See the connection's access (`whoami`), the project, usage, members, and AI models. |
| AI agents and chatbots | List, create, duplicate, update, and delete agents and chatbots. |
| Channels | List channels and update their settings. |
| Conversations | List and read conversations, start and update them, send user messages and team replies, add notes, rate answers, and end and delete conversations. |
| Contacts | List, create, update, and delete contacts. |
| Knowledge base | Read the summary and sources, add links, text, and FAQs, update, resync, and delete sources. |
| Labels, teams, variables | List, create, update, and delete them, and manage team members. |
| Analytics and topics | Get the overview and the country, channel, page, topic, and hour reports, and list topics. |
| WhatsApp | List, refresh, and delete templates, and send a template. |
| Workflows | Build, change, and publish workflows, list and read them, turn them on or off, view their runs, and see the triggers, actions, and limits the plan allows. |

Files can't be uploaded through MCP, so attachments and document sources are only available through the API and the dashboard.

Tools that delete data, or that change what your users see, such as `send_reply`, `update_agent`, and `add_knowledge_base_sources`, are marked as destructive. Apps that ask before running such tools ask you to confirm them.

## Build workflows

> [!NOTE]
>
> Building workflows through MCP is in beta.

Describe the workflow you want, such as "When a conversation is waiting for a teammate for 30 minutes, alert the support channel in Slack", and the app builds it for your AI agent. It reads the [workflow catalog](https://docs.chatling.ai/api-reference/v3/workflows/get-workflow-catalog.md) to see which triggers and actions your plan includes and what settings each action takes, then creates the workflow as an unpublished draft. You can ask for changes, and the app edits the draft.

| Tool | What it does | Access |
| - | - | - |
| `create_workflow` | Creates a workflow from a whole definition, as an unpublished draft. | Workflows: create |
| `update_workflow` | Changes the draft: adds, changes, links, or removes steps, branch paths, and notes, and changes the trigger, name, or description. | Workflows: update |
| `publish_workflow` | Publishes the draft, so the workflow starts running on your users' conversations. | Workflows: publish |

**Finish in the builder.** For actions that use a connected account, such as Slack, Google Sheets, HubSpot, Zendesk, or Airtable, you choose the account and its resources, such as the channel, spreadsheet, or fields, in the workflow builder. The app can't choose them, and it gives you a link to the workflow. A draft can't be published until everything is set, and the app tells you what's left.

**Publishing.** The app asks you to confirm before it publishes. Once published, the workflow runs on your users' conversations, as it does when you publish it in the dashboard. Apps can publish only with publish access for workflows, which **Read only** doesn't include.

**Editing in two places.** The app changes the draft only if it hasn't changed since the app last read it. If you change the workflow in the builder at the same time, the app reads it again before continuing. Opening a workflow in the builder doesn't change it.

**Secrets.** Header, query parameter, and body values in HTTP request steps are stored encrypted and never shown to the app. The app sees a placeholder, which it can send back to keep a value, but it can't read the value or send it to another host.

Workflows that start manually, and workflow templates, are created in the dashboard.

## Use an API key instead

Apps that don't support OAuth can connect with an [API key](https://docs.chatling.ai/api-reference/v3/authentication.md) in the `Authorization` header. The key's restrictions apply to the app.

```json theme={null}
{
  "mcpServers": {
    "chatling": {
      "url": "https://mcp.chatling.ai",
      "headers": {
        "Authorization": "Bearer <API_KEY>"
      }
    }
  }
}
```

The key is stored in the app's settings, so use it only in apps you trust, and give it an expiry.

## Manage connected apps

Connected apps are listed under **Project settings > Connected apps**, with their access and when they were last used. Members see and disconnect the apps they connected. Owners and admins see every app in the project and who connected it, and can disconnect any of them.

Owners and admins can also choose **Who can connect AI apps**: **All members**, or **Custom** to choose which roles can. Owners can always connect apps. Leaving a role out disconnects the apps its members connected.

| | |
| - | - |
| Access token | Expires after 1 hour. The app renews it automatically. |
| Connection | Ends if the app doesn't use it for 90 days. |
| Disconnecting | Takes effect immediately. |

A connection also ends if the member who approved it leaves the project, or if the project no longer lets any of their roles connect apps. To use the app again, connect it again.

## Limits

Each connection can make 500 requests a minute, like an API key. Each tool call counts as one request, and its result shows the same errors as the API. See [Rate limits](https://docs.chatling.ai/api-reference/v3/authentication.md#rate-limits).

## Troubleshooting

| Problem | What to do |
| - | - |
| 401 `invalid_access_token` | The connection was disconnected or has ended. Connect the app again. |
| "This project's plan doesn't include MCP access." | Upgrade to a plan that includes API access. |
| "This project doesn't let your role connect AI apps." | Ask an owner or admin to allow your role under **Who can connect AI apps**. |
| "Your role doesn't allow some of the chosen permissions." | Choose only the access your role allows, or ask an owner or admin to change your role. |
| "This request has expired." | Go back to the app and start connecting again. |
| Claude asks how to identify itself | Choose **Register automatically**. |
| A tool is missing | The app's access, or your role, doesn't include it. Disconnect the app and connect it again with the access it needs. |


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