ucode configure skills: MCP-connection mode (add/remove/replace) + status#1
Closed
xsh310 wants to merge 1 commit into
Closed
ucode configure skills: MCP-connection mode (add/remove/replace) + status#1xsh310 wants to merge 1 commit into
xsh310 wants to merge 1 commit into
Conversation
Introduces `ucode configure skills` for managing a single Unity Catalog Skills MCP connection (`databricks-skill-registry`) whose scope is a set of `catalog.schema` locations, rendered as a multi-schema `?schema=` URL (aligns with the backend route in universe #2256555). - `build_skills_mcp_url(workspace, locations)`: repeated `?schema=`; empty list -> bare `/ai-gateway/skills/` (utility tools only). - Single `kind:"skills"` entry with `skill_locations` as the source of truth; the URL is derived and never parsed back. Every run rebuilds exactly one skills entry, preserving non-skills entries. - `--location a.b,c.d --mcp [--remove|--replace]` adds/removes/replaces the location set; `--remove`/`--replace` are mutually exclusive and require `--mcp`; a soft warning fires above 10 schemas. The bare form (no `--mcp`) registers the connection for the given schemas; download-only affordances (`--path`, `--yes`, a 3-part `.skill` location) without `--mcp` raise a clear "not available yet" error. - `alwaysLoad` is set on the skills entry for the Claude client only. - `ucode status` gains a top-level Skills section (Connection / Mode / Locations / Configured); the skills entry is excluded from each agent's per-client MCP-servers line. Also extracts `_setup_mcp_clients` from `configure_mcp_command` (shared by the mcp and skills commands) and adds an `always_load` keyword to `build_mcp_http_entry` (default off) as behavior-preserving prep. Co-authored-by: Isaac
Owner
Author
|
Superseded by databricks#236 (folded into a single PR against databricks/ucode:main). |
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.
Stacked on databricks#235 (draft). Base branch is
skills-refactor-setup-helpers(PR 0's branch), notmain, so this PR's diff shows only PR 1's changes. Merge databricks#235 first. (Opened on the fork because PR 0's branch lives on the fork, not on databricks/ucode.)What this delivers
MCP mode end-to-end for
ucode configure skills. Download mode lands in a follow-up PR.Single multi-schema connection
databricks-skill-registry,kind: "skills", rebuilt on every run (single-connection invariant —_resolve_skills_mcp_serversdrops any priorkind=="skills"entry and any entry with that name, keeps everything else, appends one rebuilt entry, and merges prior clients).skill_locations: list[str]is the source of truth. The URL is always derived from it viabuild_skills_mcp_url({ws}/ai-gateway/skills/?schema=a&schema=b; empty list -> bare{ws}/ai-gateway/skills/), never parsed back.alwaysLoad=Trueintobuild_mcp_http_entry(Claude-only; other clients get URL only).CLI surface
ucode configure skills --location <list>(required, comma-separated).--mcpmutates the connection;--remove/--replacerefine the set mutation (add= union,remove= difference,replace= deduped requested); all order-stable.configure_mcp(RuntimeError -> exit 1):--remove+--replacetogether;--remove/--replacewithout--mcp;--pathwith--mcp.--mcp): registers the connection for the given schemas — the useful interim behavior until download mode ships.Download-only flags in this PR
Download mode does not exist yet, so rather than silently ignore download-only affordances, the bare default raises a clear "download mode is not available yet; use --mcp" error if
--path,--yes, or a 3-part<catalog>.<schema>.<skill>location is supplied. A 3-part location with--mcpis also rejected (it names a single skill, which is download-only).status
New top-level "Skills" section (peer of Coding Agents / Tracing):
Connection,Mode(mcpifskill_locationsnon-empty elsedownload),Locations(comma-joined, ornone — utility tools only),Configured(agent display names). Renders "not configured" when no skills entry exists. The skills entry is also excluded from each agent's per-client MCP-servers line so it isn't double-listed.Tests added
test_databricks.py:build_skills_mcp_urlfor empty / one / two locations (order preserved).test_mcp.py:resolve_skill_location_set(add/remove/replace/empty, dedupe, order);_resolve_skills_mcp_servers(canonical entry, single-entry rebuild while an mcp-service entry survives, drops stale/old-named entries, URL derives from list not a stale url, bare route on empty);configure_skills_mcp_commandflows (add-to-empty withalwaysLoad, add-second, remove, replace, remove-last ->[]+ bare URL + entry kept, mcp-service entries preserved, soft-warn over cap);configure_skills_commandbare default.test_cli.py: two-mode dispatch (default/--mcp/--mcp --remove/--mcp --replace), comma--location, mutual-exclusion and download-only guards -> exit 1, malformed -> exit 1 naming--location, missing--location-> exit 2; status Skills renderings (not-configured/mcp/download) and skills entry absent from per-client MCP lines.How verified
uv run ruff check .,uv run ruff format --check, and the full suite run withFORCE_COLORunset (that env var otherwise injects ANSI into CliRunner buffers and flakes 3 unrelated CLI color tests locally). Result: 1 failed, 932 passed, 39 skipped. The single failure is the pre-existingtest_e2e_user_agent.pycase (the localclaudebinary is Claude Code, not the Anthropic CLI) — unrelated to this change.This pull request and its description were written by Isaac.