ucode configure skills: MCP-connection mode (add/remove/replace) + status#236
Merged
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
This was referenced Jul 23, 2026
`configure mcp --location` (and the interactive picker) rebuilt the MCP server list from only the mcp-services they manage, so `apply_mcp_server_changes` treated the `kind:"skills"` entry as a removal and unregistered it from every agent. Both paths now carry an existing skills connection through untouched (the picker also hides it, since it is managed by `configure skills`). Co-authored-by: Isaac
Drop the Connection line (fixed name, no signal) and the Mode line (inferred; deferred until download mode lands), and rename the locations line to `Skill MCP Locations` to distinguish it from download locations a later PR may track separately. Co-authored-by: Isaac
xsh310
commented
Jul 23, 2026
xsh310
commented
Jul 23, 2026
xsh310
commented
Jul 23, 2026
xsh310
commented
Jul 23, 2026
xsh310
commented
Jul 23, 2026
xsh310
commented
Jul 23, 2026
xsh310
commented
Jul 23, 2026
xsh310
commented
Jul 23, 2026
xsh310
commented
Jul 23, 2026
xsh310
commented
Jul 23, 2026
xsh310
commented
Jul 23, 2026
xsh310
commented
Jul 23, 2026
xsh310
commented
Jul 23, 2026
xsh310
commented
Jul 23, 2026
xsh310
commented
Jul 23, 2026
Defer all download scaffolding to the later download-mode PR and apply review cleanups: - CLI: drop --path/--yes and 3-part `.skill` parsing; --location takes only `<catalog>.<schema>` refs. Non---mcp invocations return a clear "not available yet" error until download mode lands. - Remove the bare `configure_skills_command` entry point and the `SkillLocation` NamedTuple. - Drop the client-side schema soft-cap; let the backend enforce limits. - Rename `_apply_skills_connection` -> `_update_skills_mcp`; group the skills helpers just above `configure_skills_mcp_command`. - `resolve_skill_location_set` dedupes via `dict.fromkeys`. - status: rename locals to `skill_mcp_entry` / `configured_agents`. - Tighten `build_skills_mcp_url` docstring and a couple of comments. Co-authored-by: Isaac
xsh310
commented
Jul 23, 2026
xsh310
commented
Jul 23, 2026
- `resolve_skill_location_set` no longer de-dupes the `replace` set; the CLI parser (`_parse_skill_locations`) already drops duplicates, so it just returns `requested`. - Move `_merge_clients`, `_build_skills_entry`, and `_resolve_skills_mcp_servers` down to sit with the rest of the skills helpers just above `configure_skills_mcp_command`. Co-authored-by: Isaac
xsh310
marked this pull request as ready for review
July 23, 2026 19:51
Per review, keep the MCP-mode surface minimal: --location now sets the skills connection's schema set to exactly the listed locations, replacing any prior set, instead of add/remove/replace mutations. Removes the --remove/--replace flags and mode dispatch, and the now-dead resolve_skill_location_set / _current_skill_locations helpers. Co-authored-by: Isaac
Surface `ucode configure skills --location <catalog>.<schema> --mcp` alongside the existing configure-mcp/tracing hints so users discover the Skills connection command from `ucode status`. Co-authored-by: Isaac
AarushiShah-db
approved these changes
Jul 24, 2026
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.
Summary
Adds
ucode configure skillsfor managing a single Unity Catalog Skills MCP connection (databricks-skill-registry) whose scope is a set ofcatalog.schemalocations, rendered as a multi-schema?schema=URL (aligned to the backend route in databricks-eng/universe#2256555). Also adds a top-level Skills section toucode status.Self-contained PR off
main(a small_setup_mcp_clients/build_mcp_http_entryrefactor that was originally split into a separate PR has been folded in here).What's in this PR
build_skills_mcp_url(workspace, locations)— multi-schema?schema=a&schema=b; empty list → bare/ai-gateway/skills/(utility tools only).kind:"skills", fixed namedatabricks-skill-registry) withskill_locationsas the source of truth; the URL is derived, never parsed back. Every run rebuilds exactly one skills entry (single-connection invariant); non-skills entries are preserved.ucode configure skills --location a.b,c.d --mcp— sets the connection's location set to exactly the listed schemas, replacing any prior set. Override-only for now: to add or drop a schema, re-pass the full list you want. (--remove/--replacemutation flags are intentionally out of scope to keep the surface minimal.)ucode configure skills --location a.b(no--mcp) raises a clear "Download mode is not available yet; pass --mcp for now." error rather than silently accepting a no-op. Download mode is a planned follow-up.alwaysLoadis set on the skills entry for the Claude client only (rides the existing per-client apply); other clients get the URL only._setup_mcp_clientsextracted fromconfigure_mcp_command(shared by the mcp and skills commands), and analways_loadkeyword added tobuild_mcp_http_entry(default off).ucode statusgains a Skills section (Skill MCP Locations+Configuredagents); the skills entry is excluded from each agent's per-client MCP-servers line to avoid double-listing.How do you know it works?
Unit tests
Unit tests across
tests/test_databricks.py,tests/test_mcp.py,tests/test_cli.py:build_skills_mcp_urlfor zero / one / many locations (order preserved)._resolve_skills_mcp_serverssingle-entry rebuild, URL derived fromskill_locations, mcp-service entries preserved,alwaysLoadset.configure_skills_mcp_commandflows: set-on-empty (registers connection),--locationreplaces a prior set, multiple locations set in order, mcp-service entries preserved across a set.--mcpsets the location set, comma--locationparsing,--mcprequired (download-mode error without it), 3-part.skillrejected under--mcp, malformed → error, missing--location→ usage error;statusSkills-section renderings.Verified locally with
uv run ruff check .(clean) and the fullpytestsuite: 915 passed, 39 skipped, 1 failed — the single failure is a pre-existing, environment-onlytest_e2e_user_agent.pycase (the localclaudebinary is Claude Code, not the standalone Anthropic CLI) that also fails onmain.Manual E2E verification (live workspace)
Ran the CLI end to end against a real workspace,
eng-ml-inference.staging(profileeng-ml-inference-staging), with Claude Code and Codex configured as agents. For each step I checked the~/.ucode/state.jsonskills entry,ucode status, and the agent registrations viaclaude mcp list/codex mcp list. (The runs below were against the earlier add/remove/replace surface; the override semantics are what this PR now ships — the set-and-render, no-clobber, endpoint-reachability, and error-path behaviors they exercised are unchanged, and the override behavior is covered by the updated unit tests. A fresh manual pass on the override-only surface is planned before undrafting.)configure skills --location xsh.uc_skill_test --mcpskill_locations: ["xsh.uc_skill_test"], url.../ai-gateway/skills/?schema=xsh.uc_skill_test, entry nameddatabricks-skill-registry, clients[claude, codex]; both agents registered. A pre-existing old-formatkind:"skills"entry was swept into the canonical shape.--location xsh.uc_skill_test,xsh.xsh_oncall_skills --mcp["xsh.uc_skill_test", "xsh.xsh_oncall_skills"]; URL carries both&schema=params in order.--location xsh.uc_skill_test --mcp["xsh.uc_skill_test"]; both agent registrations updated.configure mcp --location system.aiwith a skills entry presentsystem.aimcp-service entries and the skills entry coexist; the skills entry survives in state, inucode status, and in the Claude registration.--mcp; 3-parta.b.c --mcp; malformedfoo --mcp<catalog>.<schema>..."); a valid set exits 0.ucode statusSkills section rendered as expected throughout, e.g.:Endpoint reachability. Posting a
tools/listJSON-RPC body to the URL ucode renders returned real tools with HTTP 200, directly against the plain workspace endpoint (the multi-schema route from databricks-eng/universe#2256555 is already deployed to this staging workspace, so no LiteSwap traffic header was needed):?schema=xsh.uc_skill_test→ 3 skill tools plus the 6 utility tools (load_skill,get_skill_files,list_skills,create_skill,update_skill,delete_skill)./ai-gateway/skills/→ 0 skill tools, the 6 utility tools only.Note: the deployed handler currently emits full-FQN skill tool names (
skill_<catalog>.<schema>.<leaf>) for both single and multi-scope requests. This is a gateway-side detail; ucode only renders the connection URL, so it does not affect this PR.This pull request and its description were written by Isaac.