Skip to content

Improve configure mcp UX: search wizard, faster/robust discovery & apply#225

Open
nachill-databricks wants to merge 3 commits into
databricks:mainfrom
nachill-databricks:make-mcp-heavy-sources-opt-in
Open

Improve configure mcp UX: search wizard, faster/robust discovery & apply#225
nachill-databricks wants to merge 3 commits into
databricks:mainfrom
nachill-databricks:make-mcp-heavy-sources-opt-in

Conversation

@nachill-databricks

@nachill-databricks nachill-databricks commented Jul 20, 2026

Copy link
Copy Markdown

Summary

Overhauls the MCP setup experience in ucode. Fixes crashes and slowness that show up on large workspaces (100s of MCP servers), reworks the interactive picker into a clearer wizard, and surfaces MCP setup as a natural step of ucode configure so users don't have to know configure mcp exists.

What changed

1. Fixed a crash during discovery

A network read timeout raises a bare TimeoutError (an OSError, not a URLError), which slipped past the error handling in _http_get_json and killed the whole command mid-discovery (e.g. "timed out Discovering Vector Search…"). Timeouts are now caught and treated as a skippable failure, like every other discovery error.

2. New two-step "search wizard" for configure mcp

The interactive flow is now:

  1. Search for: screen — pick which sources to search. External connections, Databricks apps, MCP services, and Genie spaces are pre-checked; Vector Search and UC functions are off by default because they walk the whole workspace and are slow. Just press Enter to accept the defaults.
  2. Server picker — choose servers from what was found.

Extras:

  • Press ← (Left arrow) in the picker to go back to the search screen without restarting the command.
  • Ctrl-A toggles select-all / select-none in the picker.

3. Better feedback while searching and saving

  • Live progress counters on the slow, walk-based sources: the spinner now shows e.g. Searching Vector Search… 3/8 endpoints, 2 found instead of a blank spinner.
  • Post-save summary: Added 2, removed 1 MCP servers across Claude Code, Codex instead of a bare Saved.
  • Picker labels are now consistently prefixed: MCP: for MCP services and Connection: for external connections (matching the existing App: / Genie: / Vector Search: labels).

4. Fixed the "frozen" apply for many servers

Saving 100+ servers appeared to hang because ucode invokes each tool's CLI once per server (claude/codex/gemini), serially. apply_mcp_server_changes now runs those operations concurrently across clients (serial within a client, since each mutates one shared config file) with a live Configuring N/M progress spinner. It no longer looks frozen. (Per-server CLI spawns remain — collapsing them into direct config-file writes is a possible future follow-up, noted in code.)

5. MCP offered at the end of ucode configure

After workspace + agents are set up in the fully-interactive ucode configure (no --agent/--agents/--workspaces flags), it now asks Configure MCP servers now? and runs the wizard if accepted. Flag-driven / scripted runs and --dry-run are unaffected — they never prompt.

Also added

  • list_all_mcp_services: a workspace-wide MCP-services walk (catalogs → schemas → mcp-services) under a wall-clock budget, feeding the "MCP services" source.

Testing

  • uv run pytest — green except 3 tests/test_cli.py::TestStatus/TestRevert failures that are pre-existing on main (verified by stashing this branch's changes) and unrelated to this work.
  • uv run ruff check ., uv run ruff format --check, and uv run ty check src/ all pass.

This pull request and its description were written by Isaac.

Achille Negrier added 3 commits July 20, 2026 13:53
…apply

Rework the interactive `ucode configure mcp` flow and fix several
scaling/robustness problems surfaced on large workspaces.

Discovery:
- Fix a crash where a socket read timeout (bare TimeoutError, an OSError,
  not a URLError) escaped `_http_get_json` and killed the whole command;
  it is now surfaced as a reason and skipped best-effort.
- Add a live progress counter to every walk-based source (Vector Search,
  UC functions, workspace-wide MCP services) so slow discovery shows
  "N/M ... K found" instead of an opaque spinner.
- Add `list_all_mcp_services`: a workspace-wide MCP-services walk
  (catalogs -> schemas -> mcp-services) under a wall-clock budget.

Interactive flow:
- Two-step wizard: a "Search for:" screen chooses which sources to
  search (External, Apps, MCP services, Genie pre-checked; Vector Search
  and UC functions off by default since they walk the workspace), then
  the server picker. Pressing Left (<-) in the picker returns to the
  search screen without restarting.
- Add a Ctrl-A select-all/none hotkey to the picker.
- Prefix MCP services with "MCP:" and external connections with
  "Connection:" to match the existing App:/Genie:/Vector Search: labels.
- Print a post-save summary ("Added N, removed M ... across <clients>")
  instead of a bare "Saved".

Apply:
- Parallelize `apply_mcp_server_changes` across clients (serial within a
  client, since each mutates one shared config) with a live
  "Configuring N/M" progress spinner, so large diffs no longer look
  frozen. (Per-server CLI spawns remain; see code comments.)

Co-authored-by: Isaac
After the workspace and agents are configured in the fully-interactive
flow (no --agent/--agents/--workspaces flags), prompt "Configure MCP
servers now?" and run the MCP wizard if accepted. This makes MCP setup
discoverable as the natural next step instead of requiring users to know
`ucode configure mcp` exists.

Flag-driven and scripted runs are unaffected: the prompt only fires on
the fully-interactive path, and never in --dry-run.

Co-authored-by: Isaac
The picker rendered the prompt from a PromptSession container, which
expands to fill the terminal height. In a tall window that pushed the
choices list to the very bottom, leaving a big blank gap between the
"Search for:"/"MCP:" prompt and the options.

Render the prompt as a fixed 1-row window instead, so the choices follow
immediately regardless of terminal height.

Co-authored-by: Isaac
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.

1 participant