Enterprise code search on Databricks Assistant via the Github MCP server
Expand the Assistant's enterprise code search capabilities by connecting to the Github MCP server.
note
MCP servers are only supported in Databricks Assistant agent mode.
Create a Github MCP server
To add a Github MCP server to the Assistant:
Skip this step if your Databricks workspace already has a Github Unity Catalog connection available for you to use.
To add a Github MCP server to the Assistant:
- From your Github account, create a Github app. Note: For enterprise codebases, this functionality may be limited to admins only. Reach out to your admin to complete this step for you.
- Navigate 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. - Grant your Github app the necessary permissions to access your repository and organization.
- Click Create GitHub App.
- In your newly created app, under Client secrets, click Generate a new client secret. Copy this value.
- Create a new Unity Catalog connection for Github. You must have
CREATE CONNECTIONprivileges.- If your workspace already has one installed, you can use the existing one as long as you have
USE CONNECTIONprivileges on it. - Fill in these fields:
- Connection type:
HTTP - Auth type:
OAuth User to Machine - 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 from Step 1
- Authorization endpoint:
https://github.com/login/oauth/authorize - Token endpoint:
https://github.com/login/oauth/access_token - Base path:
/mcp - Is mcp connection:
checked
- Connection type:
- Click Create connection
- If your workspace already has one installed, you can use the existing one as long as you have
- In the top right corner, click Login to login to your connection. This opens a new window prompting you to authorize the Github App to your Databricks account. Click connect on the Github account you wish to connect to.
Your Github MCP is now ready to use. Follow the steps in Add MCP servers to the Assistant.
Customize Assistant instructions for enterprise code search
After you've connected the Github MCP server to the Assistant, you can expand the Assistant's enterprise code search capabilities with tools and custom instructions. For example, you can tell the Assistant to search in specific repositories. Follow these steps:
- In your Assistant settings, click
next to the Github MCP server. Manually enable the
get_file_contentsandsearch_codetools. - In your Assistant instructions file, add the list of relevant repositories you want the Assistant to search through when answering questions. For example:
Enterprise Code Search: This is the list of relevant Github repositories:
- repo: my_repository, owner: bob999
- repo: hello_world_repository, owner: janedoe123