Support per-client skill MCP scopes - #520
Open
xsh310 wants to merge 1 commit into
Open
Conversation
xsh310
force-pushed
the
xshen/per-client-skill-scopes
branch
from
September 8, 2026 18:25
497380c to
909f1fc
Compare
Store the skills MCP connection's scope as a per-client map (`skill_locations_by_client`) instead of a single flat `skill_locations` list, so `skill add`/`skill remove` can target individual agents. Reads fall back to the flat list, mirrored to every client, for connections written by older builds; `skill_locations` is kept as the union mirror. Co-authored-by: Arthur Jenoudet <arthur.jenoudet@databricks.com> Co-authored-by: Isaac <no-reply@databricks.com>
xsh310
force-pushed
the
xshen/per-client-skill-scopes
branch
from
September 8, 2026 19:09
909f1fc to
0d4df44
Compare
xsh310
commented
Sep 8, 2026
xsh310
marked this pull request as ready for review
September 8, 2026 20:19
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
Store the skills MCP connection's scope as a per-agent map (
skill_locations_by_client) instead of a single flatskill_locationslist. Each configured coding agent (Claude, Codex, …) gets its own set of skill schemas and is registered with its own scoped gateway URL, so different agents can carry different skills.This PR is the state model that lets later PRs in the stack target individual agents (
skill add/skill remove --agents …). On its own it changes no user-facing command behavior — every command still operates on all configured agents — it just stores the scope per agent and reads/writes it coherently.Backward compatible: connections written by older builds (flat
skill_locationsonly) still read correctly, andskill_locationsis kept as a union mirror for older readers.State shape
The skills connection is a single entry in
state.json'smcp_servers(kind: "skills", namedatabricks-skill-registry):{ "name": "databricks-skill-registry", "kind": "skills", "clients": ["claude", "codex"], "skill_locations_by_client": { // NEW — authoritative, per-agent scope "claude": ["system.ai", "team.ml"], "codex": ["system.ai"] }, "skill_locations": ["system.ai", "team.ml"], // union across agents (legacy readers only) "url": ".../ai-gateway/skills/?schema=system.ai&schema=team.ml", "auth": "proxy" }skill_locations_by_client— the source of truth: onecatalog.schemalist per agent.skill_locations— derived, the union of every agent's list. Kept only so an older build or any legacy reader still sees a coherent scope.What happens on a skill command
ug skill add --mcp <catalog.schema,…>: unions the given schemas into every configured agent's list (keeping what each already has), re-registers only the agents whose scope actually changed (each with its own scoped URL), and saves the per-agent map plus a refreshed union mirror.ug configure skills --mcp <catalog.schema,…>: sets (replaces) every configured agent's list to exactly the given schemas.ug configure skillswith no--location, and the on-launch download path: registers/keeps the schema-less connection (utility tools only) while preserving each agent's existing scope.skill_locations_for_client(entry, client)returns that agent's list: fromskill_locations_by_clientwhen present, otherwise the flatskill_locationsmirrored to every agent, so pre-upgrade state reads identically.Stacking
Stacked on #519 (
skill-managed-download-only). With managed skills delivered by download only, the skills MCP connection holds only a developer's ownskill add --mcpschemas, so this per-agent scope is purely developer state — there is no global managed set to union in.First PR of the per-agent skills stack (this →
add --agents→ per-agentstatus→remove→ per-agentremove→ deprecateconfigure skills). Base moves tomainonce #519 merges.Original design and initial implementation by Arthur Jenoudet; reworked into the per-client model here.
This pull request and its description were written by Isaac.