Pass --profile to databricks CLI listing commands (fixes MCP discovery with CLI v1.0.0)#62
Open
bkvarda wants to merge 1 commit into
Open
Pass --profile to databricks CLI listing commands (fixes MCP discovery with CLI v1.0.0)#62bkvarda wants to merge 1 commit into
bkvarda wants to merge 1 commit into
Conversation
CLI v1.0.0 no longer resolves credentials from DATABRICKS_HOST alone — it requires an explicit --profile flag. list_databricks_connections, list_genie_spaces, and list_databricks_apps now call find_profile_name_for_host and append --profile when a match is found, matching the same pattern already used in get_databricks_token. Without this fix, ucode configure mcp silently skips external connections, Genie spaces, and Databricks apps with "Skipped" warnings. Co-authored-by: Isaac
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
ucode configure mcpsilently skips external connections, Genie spaces, and Databricks apps with "Skipped" warnings, leaving the MCP picker empty or showing only "Databricks SQL". This is the root cause of the discovery side of #58.Root cause: Databricks CLI v1.0.0 (release notes) changed OAuth token storage from
~/.databricks/token-cache.jsonto the OS-native keychain (Keychain on macOS, Credential Manager on Windows). Previously, passingDATABRICKS_HOSTas an env var was sufficient for the CLI to look up the cached token by host URL. With v1.0.0, tokens are keyed by profile name in the keychain —DATABRICKS_HOSTalone returns:get_databricks_tokenandensure_databricks_authalready handled this correctly by callingfind_profile_name_for_hostand passing--profile. The three listing functions used for MCP discovery missed the same pattern.Fix
list_databricks_connections,list_genie_spaces, andlist_databricks_appsnow callfind_profile_name_for_hostand append--profile <name>when a match is found, matching the pattern already used byget_databricks_tokenandensure_databricks_auth.Detecting the error and warning was considered but rejected — it requires fragile string-matching on CLI error output that can change between versions. Always passing
--profileis simpler and correct across all CLI versions.Related
ucode configure mcp#58 (Databricks App MCP servers fail silently — apps were never reaching the picker due to this auth failure)Test plan
uv run pytest— all 566 tests passucode configure mcpon a workspace with CLI v1.0.0 installed now discovers external connections, Genie spaces, and Databricks apps~/.config/goose/config.yaml