docs/dev-guides/agent-context/databricks-genie-code.md
Give Genie Code access to your enterprise data context in DataHub — find trustworthy data, understand lineage, look up ownership, and generate better SQL queries, all without leaving your notebook.
<p align="center"> </p>CREATE CONNECTION privilege on your Unity Catalog metastoreThis creates a Unity Catalog HTTP connection to your DataHub MCP server. You only need to do this once — the same connection is used by Databricks Agent Bricks.
In your Databricks workspace, go to Catalog > Connections > Create connection.
Configure the connection:
datahub (or your preferred name)https://<tenant>.acryl.iohttp://<gms-host>:8080/integrations/ai/mcp (DataHub Cloud) or /mcp (self-hosted)Click Create connection.
Grant access to users who need it: Go to Catalog > Connections > datahub > Permissions and grant USE CONNECTION to the appropriate users or groups.
Once created, the connection shows up under Agents > MCP Servers in your workspace.
Open Genie Code and click the Settings gear icon.
Under MCP Servers, click Add Server.
Select External MCP servers and choose the datahub connection you created above.
Switch to Agent mode in Genie Code and try:
Find all datasets related to "customer churn" and show me their owners
Search DataHub for datasets in the Marketing domain, then query the customer_segments
table to show me the top 10 segments by size
Tip: MCP servers require Genie Code Agent mode. There's a limit of 20 tools across all connected MCP servers.
401 Unauthorized? Regenerate the DataHub access token and update the UC connection./integrations/ai/mcp (Cloud) or /mcp (self-hosted).Links: MCP on Databricks · DataHub MCP Server · Agent Context Kit