> For the complete documentation index, see [llms.txt](https://docs.carto.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.carto.com/carto-for-agents/connect-your-platform/chatgpt.md).

# ChatGPT

[ChatGPT](https://chatgpt.com/) connects to CARTO through a **custom MCP server** over OAuth, giving ChatGPT access to CARTO's MCP tools.

ChatGPT can also [render CARTO maps inline](/carto-for-agents/connect-your-platform.md#which-platforms-render-maps-inline) in the conversation, providing a richer experience when working with CARTO maps and spatial data.

## Requirements

* A **ChatGPT Business, Enterprise, or Edu** workspace with **Developer mode** enabled. Full MCP support, including write and modify actions, is currently available on these plans. Pro users can connect MCPs with read/fetch permissions. See [OpenAI's Developer mode and MCP apps documentation](https://help.openai.com/en/articles/12584461-developer-mode-and-mcp-apps-in-chatgpt?utm_source=chatgpt.com)
* Your CARTO **MCP Server URL**.
* A CARTO **SPA OAuth Client** with a **Client ID**. A client secret is supported and recommended for this setup. See [Connecting with OAuth](/carto-for-agents/mcp-server/connecting-with-oauth.md#1-create-the-client-in-carto).
* Access to configure the OAuth callback URL on the CARTO SPA OAuth Client.

## Connecting via OAuth

1. In ChatGPT, open **Settings > Security and login**, scroll to **Developer mode**, and toggle it on. You may see an **“ELEVATED RISK”** warning; this is expected when enabling custom MCP servers.
2. Go to **Settings > Plugins > Browse plugins** and click the **+** button in the top-right.
3. In **New Plugin**, configure the MCP server:

   * **Name:** anything, such as `CARTO`.
   * **Connection:** leave as **Server URL**.
   * **URL:** your CARTO MCP Server URL.

   <figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2FXS7FynrEpoJEMVxmysbF%2Fimage.png?alt=media&amp;token=488e9996-c7e5-4aa3-9bb7-3628fe2c0787" alt=""><figcaption></figcaption></figure>
4. Under **Authentication**, choose **OAuth**.
5. Expand **Advanced OAuth settings > Registration method** and change **CIMD** to **User-Defined OAuth Client**. Enter your CARTO **Client ID** and **Client Secret**.
6. Accept the **“I understand and want to continue”** warning and click **Create**.
7. **Before signing in**, register ChatGPT's OAuth callback URL on your CARTO client. In CARTO, open the SPA client under **Developers → Credentials → SPA OAuth Clients**, turn off **Use default logout/callback URLs and Origins**, and add:

   ```
   https://chatgpt.com/connector/oauth/<id>
   ```

   Use the exact `<id>` from the authorization URL that ChatGPT opens. Save the CARTO client.
8. Return to ChatGPT, click **Sign in**, and complete the CARTO consent flow.

{% hint style="warning" %}
Leave the OAuth registration method set to **User-Defined OAuth Client**. Do not use **CIMD** for this ChatGPT connection. CARTO's CIMD flow is used for supported Claude clients. If you see **“Unknown client,”** create a new CARTO SPA OAuth Client and use its Client ID.
{% endhint %}

{% hint style="info" %}
**Reconnect after 24 hours.** The connection lasts 24 hours from sign-in. After that, CARTO tool calls fail as unauthorized until you reconnect and sign in again. See [How long a connection lasts](/carto-for-agents/mcp-server/connecting-with-oauth.md#how-long-a-connection-lasts).
{% endhint %}

## Read-only alternative

If you don't control the CARTO OAuth client, you can use a CARTO [API Access Token](/carto-for-agents/mcp-server/connecting-with-api-tokens.md) instead of OAuth. Choose **Access token / API key** in the authentication settings and provide a token with the **MCP Server** scope.

Add the **SQL**, **Maps**, or **LDS** scopes as needed for additional CARTO tools.

This provides a [read-and-discovery subset](/carto-for-agents/mcp-server/connecting-with-api-tokens.md#what-a-token-unlocks) of the CARTO tool surface and does not enable map or Workflow authoring.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.carto.com/carto-for-agents/connect-your-platform/chatgpt.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
