> 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 connects to CARTO as an **MCP service** — a Unity Catalog securable reached through the Unity AI Gateway. It has the strongest governance of any host here: you grant, filter, rate-limit, and audit the CARTO connection like any other data asset.

## Requirements

* A Unity Catalog-enabled workspace in a region that supports **Model Serving**.
* `CREATE CONNECTION` on the target schema (schema-level, not metastore admin).
* Your CARTO **MCP Server URL**.
* Credentials — **prefer OAuth (U2M)** for the full tool surface. A CARTO API Access Token also connects, but only reaches 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 UI or REST API (there's no `CREATE MCP SERVICE` SQL). It takes about five minutes.

1. Left nav > **AI Gateway** > **MCPs** tab.
2. **+ MCP** > **Connect an existing MCP server**.
3. Pick a **Catalog** and **Schema** (set real values — the form pre-fills `main`/`default`, which may not exist).
4. **Name** it, e.g. `carto_mcp`.
5. **Server URL** — your CARTO MCP Server URL.
6. **Authentication:**
   * **OAuth (U2M)** — for the full surface. Create a CARTO **SPA OAuth Client** and enter its client ID, secret, and CARTO's authorization and token endpoints. Register Databricks' redirect on the CARTO client's **Allowed Callback URLs** first:

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

     It's per-workspace, so each Databricks workspace needs its own entry.
   * **Bearer token** — the quick read-and-discovery path. Paste your CARTO API Access Token; Databricks proxies every call, so end users never see it.
7. **Create & load tools.** Databricks discovers the tools, badges each Read-only or Destructive, and lets you filter with globs (`read_*`, `list_*`) under **Advanced**.
8. **Create MCP Service** — status goes **Active**.

{% hint style="warning" %}
Don't choose **Dynamic Client Registration** in the auth dropdown — CARTO doesn't use it. Use OAuth U2M or a Bearer token.
{% endhint %}

{% 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 %}

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