Search GitHub code with Genie Code
Genie Code can search GitHub repositories when you connect it through the native Databricks GitHub connector or a custom GitHub MCP server. Use the native connector for most cases. Private repository access requires a GitHub organization administrator to install the Databricks GitHub connector app.
Use the native connector (recommended)
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 Databricks previews.
To connect Genie One or Genie Code to GitHub, use the Databricks third-party connector. See Use native connectors for third-party data sources and Connect to external tools and sources. For private repositories, administrators need to enable access.
- The native connector uses the default Databricks system connection. To use a custom GitHub MCP server instead, add it manually. See Add MCP servers to Genie Code manually.
- To improve responses, add personal context for each repository to help GitHub search tools understand your codebase.
Register a custom GitHub MCP server (not recommended)
Skip this section if your Databricks workspace already has a GitHub Unity Catalog MCP Service available for you to use. If you only need access to public repositories and your own account's information, use managed OAuth and skip to Register a Unity Catalog connection as an MCP Service.
Follow the steps below to register a custom GitHub MCP server as an MCP Service for your specific data and security needs. First, choose how your MCP Service authenticates:
- Managed OAuth: Databricks manages the GitHub OAuth app and credentials. Skip the GitHub app and client-secret steps below, then choose the managed provider when you create the connection.
- Custom OAuth: Create your own GitHub app and provide its credentials when you create the connection.
Create a GitHub app (custom OAuth only)
-
Create a GitHub app. For enterprise codebases, a GitHub organization administrator must complete this step.
- Go to Profile > Settings > Developer settings > GitHub Apps and click New GitHub App.
- Fill in the requested fields. The Callback URL should be
https://<your-databricks-workspace-url>/login/oauth/http.html. This is how GitHub authenticates with your Databricks workspace.- The homepage URL does not affect the MCP server and can be set to any value you prefer.
- Clear the Active checkbox to make the webhook URL an optional field.
- Grant your GitHub app the necessary permissions to access your repository and organization.
- Click Create GitHub App.
-
In the newly created app, under Client secrets, click Generate a new client secret. Copy this value.
Register a Unity Catalog connection as an MCP Service
-
Create or reuse a Unity Catalog HTTP connection for GitHub. You must have
CREATE CONNECTIONprivileges on the schema to create one. If you reuse an existing connection, you must haveUSE CONNECTIONon it. Continue to register that connection as an MCP Service in the next step. For a new connection, use one of the following authentication options:- Managed OAuth: Select the OAuth User to Machine Per User auth type and the GitHub OAuth provider. Databricks supplies the GitHub host, base path, and OAuth credentials.
- Custom OAuth: Select the OAuth User to Machine Per User auth type and the Manual configuration OAuth provider. Enter the following values:
- Host:
https://api.githubcopilot.com - OAuth scope: The scopes of your app. For example,
mcp:access read:user user:email repo read:org - Client secret and client ID: generated in the GitHub app steps above
- Authorization endpoint:
https://github.com/login/oauth/authorize - Token endpoint:
https://github.com/login/oauth/access_token - Base path:
/mcp
- Host:
- Click Create connection.
-
Register an MCP Service that uses the HTTP connection. For the required permissions, see Register an external MCP server.
- In your Databricks workspace, go to Catalog, select a schema, and click Create > MCP Service.
- Enter the catalog, schema, and name for the MCP Service.
- Select the HTTP connection you created or reused, select the tools to expose, and click Create.
-
If you chose per-user OAuth, open the MCP Service in Catalog Explorer and click Login to authorize your GitHub account.
-
Grant users or groups
EXECUTEon the MCP Service, plusUSE CATALOGandUSE SCHEMAon its parent catalog and schema. Do not grant end usersUSE CONNECTION. See Step 4. Grant access to an MCP Service.
Your GitHub MCP Service is ready to use. Add it to Genie Code.