Skip to content

MCP fix: pass --profile to discovery CLI calls and surface resolver failures in configure mcp#94

Merged
asujithan merged 7 commits into
mainfrom
mcp-config
May 27, 2026
Merged

MCP fix: pass --profile to discovery CLI calls and surface resolver failures in configure mcp#94
asujithan merged 7 commits into
mainfrom
mcp-config

Conversation

@asujithan
Copy link
Copy Markdown
Collaborator

@asujithan asujithan commented May 26, 2026

Issue:

  • ucode configure mcp printed ! Skipped external connections / Genie spaces / Databricks apps on workspaces where the Databricks CLI's DATABRICKS_HOST-only auth resolver returns an Invalid Token. The auth helpers already passed --profile, but list_databricks_connections, list_genie_spaces, and list_databricks_apps did not, so _discover_mcp_source swallowed the resulting RuntimeError as ! Skipped ….
  • _resolve_mcp_selection returned None for any unresolvable picker pick and the caller silently continue'd, so dropped picks were invisible.
  • The picker prints done whether or not anything was toggled, so an Enter-without-space submission on fresh state looked identical to a successful save.

Change:

  • Threaded an optional profile through list_databricks_connections, list_genie_spaces, list_databricks_apps and their discover_* wrappers, injected via the existing _profile_args() helper; configure_mcp_command reads it from state and forwards it to all three discovery calls.
  • Changed _resolve_mcp_selection to raise RuntimeError with a per-cause reason (missing app name, app not in discovered list, app has no MCP URL, missing Genie space id, missing external connection name, unrecognized prefix); configure_mcp_command prints ! Skipped MCP selection `: ` instead of dropping the pick.
  • Added a ! No MCP servers selected. Press space to toggle an item, then enter to save. hint when the picker submits zero selections on fresh state.
  • Added regression tests for --profile plumbing (tests/test_databricks.py, tests/test_mcp.py) and for each new warning/hint; updated existing monkeypatch stubs from lambda workspace: … to lambda workspace, profile=None: ….

Validation:
uv run pytest tests/test_databricks.py tests/test_mcp.py -q → 99 passed
uv run ruff check src/ucode/databricks.py src/ucode/mcp.py tests/test_databricks.py tests/test_mcp.py → passed
uv run pytest -q --ignore=tests/test_e2e.py --ignore=tests/test_e2e_user_agent.py → 552 passed
uv run ruff check . → passed
Manually verified on eng-ml-inference-team-ca-central-1: picker now shows external connections, Genie spaces, and Databricks apps (previously ! Skipped …); a toggled selection is written to ~/.ucode/state.json and shows up in claude mcp list; Enter-without-space on fresh state prints the new hint instead of a silent no-op.

fixes #58

@asujithan asujithan requested a review from AarushiShah-db May 26, 2026 23:49
@asujithan asujithan merged commit cc0cabb into main May 27, 2026
2 checks passed
@asujithan asujithan deleted the mcp-config branch May 27, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Databricks App MCP servers fail silently in ucode configure mcp

2 participants