> 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/databricks.md).

# Databricks

[Databricks](https://docs.databricks.com/aws/en/generative-ai/mcp) connects to CARTO as an **MCP service** – a Unity Catalog securable accessed through the Unity AI Gateway.

The Unity AI Gateway provides governance controls for MCP connections, including permissions, tool selection, rate limits, usage tracking, and auditing.

## Requirements

Before you start, you need:

* A **Unity Catalog-enabled** Databricks workspace in a region that supports **Model Serving**.
* `CREATE CONNECTION` on the target schema. **Metastore admin access is not required.**
* Your CARTO **MCP Server URL**.
* Credentials for the CARTO MCP Server:
  * **OAuth (U2M):** recommended for access to the full CARTO tool surface.
  * **Bearer token:** sing a CARTO API Access Token for the [read-and-discovery subset](/carto-for-agents/mcp-server/connecting-with-api-tokens.md#what-a-token-unlocks).

## Install

The MCP server is registered through the Databricks UI or REST API. There is no `CREATE MCP SERVICE` SQL command.

### 1. Create a CARTO SPA OAuth Client

If you're using create a **SPA OAuth Client** in CARTO under **Developers > Credentials > SPA OAuth Clients**.

* Configure the client as **confidential** so that it has a **Client Secret**.
* Keep the **Client ID** and **Client Secret**. You'll enter these when configuring the Databricks MCP service.

Before creating the connection, add the Databricks workspace callback URL to the client's **Allowed Callback URLs**:

```
https://<workspace-host>/login/oauth/http.html
```

The callback is **workspace-specific**, so each Databricks workspace requires its own entry.

### 2. Create the MCP Service

In Databricks, go to:

**AI Gateway > MCPs**

Select:

**+ MCP > Connect an existing MCP server**

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2FtsOe1PuFbG55kMzUjc3Q%2FScreenshot%202026-08-28%20at%2011.01.55.png?alt=media&amp;token=d69a13ac-dca5-44d7-9555-069e618b199b" alt=""><figcaption></figcaption></figure>

Configure the MCP service:

1. Select a **Catalog** and **Schema**.

   Use the actual catalog and schema where you want to register the MCP service. The form may prefill `main` and `default`, which may not exist in your workspace.
2. Enter a **Name**, for example:

   ```
   carto_mcp
   ```
3. Enter your CARTO **MCP Server URL**.
4. Select an **Authentication** method.

**OAuth (U2M)**

Use **OAuth (U2M)** for the full CARTO tool surface.

Enter:

* **Client ID:** your CARTO SPA OAuth Client ID.
* **Client Secret:** your CARTO SPA OAuth Client Secret.
* **Authorization endpoint:** `https://auth.carto.com/authorize`
* **Token endpoint:** `https://auth.carto.com/oauth/token`

Make sure the Databricks workspace callback URL has been added to the CARTO client's **Allowed Callback URLs** before connecting.

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2FrR0TdiuWZzZ0MNMnBJm2%2Fimage.png?alt=media&amp;token=2b95088d-3f5f-4bfd-b480-fb0ceee92c97" alt=""><figcaption></figcaption></figure>

**Bearer token**

Use **Bearer token** for the read-and-discovery path.

Enter your CARTO **API Access Token**. Databricks proxies the MCP calls, so the token is not exposed to end users.

The available capabilities depend on the APIs included in the token. The read-and-discovery subset includes browsing connections, running SQL, and searching the Data Observatory.

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fxho6zIbkPQEIxyZv9Pme%2Fimage.png?alt=media&amp;token=4a5f24e5-249f-46d6-9f7d-fb5cfd4eb2fd" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Don't select **Dynamic Client Registration**. CARTO does not use DCR. Use **OAuth (U2M)** or **Bearer token**.
{% endhint %}

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2F4obEOmsvZNF9nDNsznNr%2FScreenshot%202026-08-28%20at%2011.17.55.png?alt=media&amp;token=14d4f29e-04ee-475c-bb73-70c2303811c5" alt=""><figcaption></figcaption></figure>

### 3. Load and configure the tools

Select **Create & load tools**.

Databricks discovers the tools exposed by the CARTO MCP server and displays them with **Read-only** or **Destructive** badges.

Under **Advanced**, you can filter the tools using globs, for example:

```
read_*list_*
```

Use the filter to expose only the CARTO tools required by your application.

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2FG3zPpjwe45tC1YpDdbZe%2FScreenshot%202026-08-28%20at%2011.17.08.png?alt=media&amp;token=13ebd868-af97-4028-9134-88156461f1c0" alt=""><figcaption></figcaption></figure>

### 4. Create the MCP Service

Create the service.

Once provisioning is complete, the MCP service status changes to **Active**.

{% hint style="info" %}
**Tool caps are surface-specific.** Databricks' **Genie Code** caps an agent at 20 tools across all servers – but with a per-tool picker, so you choose which of CARTO's tools to expose. The **AI Playground** has no such cap. Use the glob filter to keep a focused set and to exclude `view_map` (which can't render inline here).
{% endhint %}

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2FyaWQfh9pUacXo2HcIGjJ%2FScreenshot%202026-08-28%20at%2011.18.49.png?alt=media&amp;token=9c7196f7-5cdd-4856-aa5b-a9b960052f6e" alt=""><figcaption></figcaption></figure>

## Governance

Databricks lets you go beyond a connection:

* **Tool selection:** expose only the tools you want (allowlist by prefix or exact match).
* **Service policies:** allow, deny, or require approval for individual tool calls. The Destructive badge is informational; set a policy to actually gate destructive tools.
* **Rate limits** and **usage tracking**: every call lands in `system.ai_gateway.usage`.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
