Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Connect Genie Code to external tools and data sources through the Model Context Protocol (MCP). Genie Code can use any MCP servers that have been added to your workspace and that you have permission to use.
Note
MCP servers are only supported in Genie Code Agent mode.
What is MCP?
MCP is an open source standard that connects AI agents to tools, resources, prompts, and other contextual information. MCP provides a standardized way to expose tools, data, and workflows to Genie Code without embedding that context directly into prompts or instructions.
MCP is designed for cases where important context already exists but is difficult to access from an AI agent, like Genie Code. MCP offers a secure way to give Genie Code access to context like the following:
- Documentation systems: Teams often keep runbooks or operational docs in tools like Confluence. Instead of copying sections into prompts, that content can be exposed once through an external MCP server and referenced when relevant. Your documents might also already be in Databricks as a vector search index, which Genie Code can use to query relevant documents.
- Tools and services: Platform teams may maintain APIs or scripts for setup, validation, or deployment. MCP makes those capabilities directly available to Genie Code.
- Data sources: If you already have data in Databricks, you can connect Genie Code to a Genie space to help you analyze the data using natural language. For data stored outside Databricks, you can give Genie Code secure access through external MCP servers.
- Custom apps: You can also add custom functionality hosted through Databricks Apps. This allows you to connect Genie Code to proprietary tools, workflows, or integrations built specifically for you or your organization, all managed securely within your Databricks workspace.
In these cases, MCP replaces manual copy-pasting with a structured, reusable approach, making the right context available only when it is needed.
You can connect Genie Code to any MCP servers in your workspace that you have permission to use. Workspace admins control which servers are available, while users can select from those approved sources as needed.
To learn more about MCP servers in Databricks and how to create your own, see Model Context Protocol (MCP) on Databricks.
Connect to third-party data sources
Important
This feature is in Beta. To use third-party data source connectors, a workspace admin must enable the Third Party Connectors for Agents preview. See Manage Azure Databricks previews.
Genie Code provides built-in connectors for common enterprise data sources, including Google Drive and SharePoint.
Connecting to these data sources allows Genie Code to search your documents when answering questions. Each user authenticates individually, and OAuth tokens are not shared between users.
To connect a third-party data source:
- In your workspace, click
Genie Code in the upper-right corner to open a chat.
- In the prompt bar, click
the plus icon.
- Next to the data source you want to connect to, click Connect.
- Complete the steps to sign in.
After you authenticate, Genie Code can search your documents when answering questions. Metastore admins and connection owners can manage or revoke user permissions on the connection. See Share the MCP server connection.
Note
Data source tools don't always trigger automatically. If document search doesn't start, try explicitly prompting Genie Code to use the tool, for example "use Google Docs" or "use SharePoint."
To connect other data sources, manually add them to Genie Code. See Add MCP servers to Genie Code manually.
Google Drive limitations
- Maximum file size is 10 MB.
- Only native Google Workspace files (Docs, Sheets, Slides) are supported. PDFs, images, and other binary formats are not supported.
- Connection or token expiration errors might appear in the agent output. Re-authenticate to resolve.
SharePoint limitations
- Maximum file size is 10 MB.
- Supported file types include Office documents (.docx, .xlsx, .pptx), as well as common text-based formats such as
.txt,.csv,.json,.md, and others. PDFs, images, and other binary formats are not supported.
Add MCP servers to Genie Code manually
To connect Genie Code to an MCP server, add it in your Genie Code settings:
- Open Genie Code settings. In Genie Code panel, click
Settings.
- Under MCP Servers, click
Add Server.
- Select the MCP servers you want to add. You can select Databricks managed MCP servers or external MCP servers:
- Unity Catalog function: Select the schema for the function. This allows Genie Code to use functions to run predefined SQL queries.
- For help adding a GitHub MCP server, see create a GitHub MCP server.
- Vector search: Select the schema for the index. This allows Genie Code to query the vector search index to find relevant documents.
- Genie space: Select the Genie space. The Genie MCP invokes Genie as a tool, allowing you to query the Genie space to analyze data using natural language.
- External MCP server: Select the Unity Catalog connection to use as an external MCP server. You must log in to the connection first before it can be used.
- Custom MCP server: Select the Databricks App to use as a custom MCP server. This allows you to use any custom-defined tools. The following requirements apply:
- Your app must be deployed in the same workspace that you are trying to connect to it from.
- The MCP server must be accessed at
https://<server-url>/mcp. - Your app must be stateless. For example, set
mcp_app = mcp_server.http_app(stateless_http=True). - If you run into CORS errors, you may need to add your workspace URL to your app's list of allowed origins. For example, set
app.add_middleware(CORSMiddleware, allow_origins=ALLOWED_ORIGINS, allow_credentials=True, allow_methods= ["*"], allow_headers= ["*"]).
- Unity Catalog function: Select the schema for the function. This allows Genie Code to use functions to run predefined SQL queries.
- Click Save.
After they've been added, MCP servers are immediately available to Genie Code. You can start using them in Agent mode without changing your prompts or instructions. Genie Code will automatically draw on these servers when relevant.
Currently, MCP access is limited to 20 tools across all servers. You can choose which tools and servers to enable or disable in your Genie Code settings.