[skills] Add an interactive schema picker to ug skill add --mcp - #588
Merged
Merged
Conversation
xsh310
added this pull request to stack #576
September 13, 2026 04:28
xsh310
commented
Sep 13, 2026
xsh310
commented
Sep 13, 2026
xsh310
commented
Sep 13, 2026
xsh310
commented
Sep 13, 2026
xsh310
commented
Sep 13, 2026
xsh310
force-pushed
the
skills-mcp-add-picker
branch
2 times, most recently
from
September 13, 2026 06:25
d6d37f1 to
c934e64
Compare
xsh310
marked this pull request as ready for review
September 13, 2026 06:37
xsh310
force-pushed
the
skills-mcp-add-picker
branch
from
September 14, 2026 03:08
c934e64 to
54a8370
Compare
xsh310
force-pushed
the
skills-mcp-add-picker
branch
from
September 14, 2026 20:09
54a8370 to
35a710b
Compare
xsh310
force-pushed
the
skills-mcp-add-picker
branch
from
September 14, 2026 22:32
35a710b to
d94e61f
Compare
xsh310
force-pushed
the
skills-mcp-add-picker
branch
2 times, most recently
from
September 15, 2026 01:41
dee8c30 to
bad3f91
Compare
xsh310
force-pushed
the
skills-mcp-add-picker
branch
from
September 15, 2026 03:40
bad3f91 to
29363a9
Compare
xsh310
force-pushed
the
skills-mcp-add-picker
branch
2 times, most recently
from
September 15, 2026 14:43
70ae698 to
f84cc77
Compare
xsh310
force-pushed
the
skills-mcp-add-picker
branch
from
September 15, 2026 23:50
f4d560e to
feb539b
Compare
xsh310
force-pushed
the
skills-mcp-add-picker
branch
from
September 16, 2026 00:10
feb539b to
92965e3
Compare
xsh310
force-pushed
the
skills-mcp-add-picker
branch
from
September 16, 2026 00:52
92965e3 to
b838adc
Compare
xsh310
force-pushed
the
skills-mcp-add-picker
branch
from
September 16, 2026 01:00
b838adc to
b85013e
Compare
xsh310
force-pushed
the
skills-mcp-add-picker
branch
from
September 16, 2026 03:59
b85013e to
c0ca654
Compare
xsh310
requested review from
AarushiShah-db,
lilly-luo and
rohita5l
as code owners
September 16, 2026 05:19
xsh310
force-pushed
the
skills-mcp-add-picker
branch
from
September 16, 2026 05:19
c0ca654 to
92965e3
Compare
xsh310
force-pushed
the
skills-mcp-add-picker
branch
from
September 16, 2026 19:03
92965e3 to
099dd78
Compare
xsh310
force-pushed
the
skills-mcp-add-picker
branch
from
September 16, 2026 19:11
099dd78 to
4e2cacf
Compare
sunishsheth2009
approved these changes
Sep 16, 2026
xsh310
force-pushed
the
skills-mcp-add-picker
branch
from
September 16, 2026 20:08
4e2cacf to
f2830f3
Compare
`ug skill add --mcp` with no --location errored asking for a typed schema. On an interactive terminal it now opens a picker of the workspace's schemas that contain skills, streamed in as discovery finds them, and adds the selected schemas to the skills MCP scope. The picker mirrors the download picker and reuses its machinery: the workspace walk (list_all_skills) and the streaming checkbox widget. Because list_all_skills probes one schema per call, each batch is one schema's skill set, so the loader renders one row per schema with its exact skill count. Already-scoped schemas are flagged and stay selectable, since adding is additive (removal is `ug skill remove --mcp`). To let both the picker (in mcp.py) and the download flow use the workspace walk without a circular import, the UC skills read layer (SkillRef, the API client, and list_all_skills) moves into a new skills_api.py that depends only on databricks.py; mcp.py and skills_download.py both import it. add_skills_command's apply body is extracted into add_skill_locations_to_mcp, shared by the command and the picker. Co-authored-by: Isaac <no-reply@databricks.com>
The `ug skill add --mcp` schema picker's loader dropped list_all_skills' return, so a timed-out walk silently showed a partial schema list. Capture the deadline and surface it in the footer, mirroring the download picker. Co-authored-by: Isaac <no-reply@databricks.com>
xsh310
force-pushed
the
skills-mcp-add-picker
branch
from
September 16, 2026 20:21
f2830f3 to
a3a356e
Compare
xsh310
added a commit
that referenced
this pull request
Sep 16, 2026
## What `ug skill remove --mcp` was interactive-only. This adds `--location` support so a specific set of `<catalog>.<schema>` schemas can be dropped from the skills MCP connection's scope non-interactively, and makes the no-`--location` case behave like `ug skill add --mcp`: a picker on an interactive terminal, a clear error otherwise. ## Why `ug skill add --mcp --location` (and its picker, from #588) had no removal counterpart. Scripts and non-interactive callers could not remove a schema from the MCP scope, and `ug skill remove --mcp` in a non-interactive shell fell into a picker that cannot be used. This makes the add and remove paths symmetric. ## How - CLI (`skills_remove`): `--mcp` now accepts `--location`. With locations it calls the new `remove_skills_locations_command`; with none it opens the existing picker on a TTY, otherwise it errors asking for `--location`. `--path` and `--skills` stay rejected with `--mcp`, and `--agents` scoping is unchanged. - The removal core is extracted into `remove_skill_locations_from_mcp`, shared by the interactive `remove_skills_command` and the new non-interactive command, mirroring #588's `add_skill_locations_to_mcp` split. A schema not in scope is a no-op. - README updated for the new usage. ## Testing `uv run ruff check`, `ruff format --check`, `ty check src`, and `uv run pytest` all pass (the pre-existing `test_e2e_user_agent` / `test_claude_smart_routing_v2` failures also fail on the base). Added tests for `remove_skills_locations_command` (per-client removal, agent scoping, a not-in-scope no-op, and the schema-less connection kept when the last schema is removed) and for the CLI dispatch (`--mcp --location`, agent scope, the non-interactive no-`--location` error, a malformed location, and `--path` / `--skills` rejection). ## Stack Part of gh stack #576, on top of #588 (`skills-mcp-add-picker`). This pull request and its description were written by Isaac. --- <sub>Stack created with <a href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub> Co-authored-by: Isaac <no-reply@databricks.com>
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.
What
ug skill add --mcpwith no--locationerrored asking for a typed schema. On aninteractive terminal it now opens a picker of the workspace's schemas that contain
skills, streamed in as discovery finds them, and adds the selected schemas to the
skills MCP connection's scope.
Why
The download path already has an interactive picker; the MCP scope path was the only
add-side flow still requiring a typed
--location. This makes the two symmetric.How
mcp.py, beside the other skill MCP-scope commands) reuses the downloadpicker's machinery: the workspace walk (
list_all_skills) and the streaming checkboxwidget.
list_all_skillsprobes one schema per call, so each streamed batch is oneschema's skill set; the loader renders one row per schema with its exact skill count.
adding is additive (removal is
ug skill remove --mcp).mcp.py(picker) andskills_download.py(download) use the workspace walkwithout a circular import, the UC skills read layer (
SkillRef, the API client, andlist_all_skills) moves into a newskills_api.pythat depends only ondatabricks.py.add_skills_command's apply body is extracted intoadd_skill_locations_to_mcp, sharedby the command and the picker so each runs a single client setup.
--location, so scripts fail loudly.Testing
uv run ruff check,ruff format --check,ty check src, anduv run pytestall pass(the pre-existing
test_e2e_user_agent/test_claude_smart_routing_v2failures also failon the base). The read-layer tests move to
test_skills_api.py; added tests for the schemapicker, its command,
add_skill_locations_to_mcp/configured_skill_locations, and the CLIdispatch.
Stack
Part of gh stack #576, on top of #586 (
skills-download-workspace-id).This pull request and its description were written by Isaac.
Screen.Recording.2026-09-12.at.11.35.02.PM.mov
Stack created with GitHub Stacks CLI • Give Feedback 💬