Skip to content

Add per-agent scoping to skill add --mcp - #522

Draft
xsh310 wants to merge 1 commit into
xshen/per-client-skill-scopesfrom
xshen/skill-per-agent-add
Draft

Add per-agent scoping to skill add --mcp#522
xsh310 wants to merge 1 commit into
xshen/per-client-skill-scopesfrom
xshen/skill-per-agent-add

Conversation

@xsh310

@xsh310 xsh310 commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

What

Adds an --agents option to ucode skill add --mcp so a skill schema can be added to a chosen subset of configured coding agents instead of all of them. This mirrors ucode mcp add --agents, closing the gap between how the skills MCP path and the general MCP path scope work per agent.

How

  • add_skills_command(locations, agents=None) forwards agents to setup_mcp_clients, which scopes the returned client set. The per-client skill-location map is updated only for the targeted clients; the rest keep their scope untouched.
  • In cli.py, skill add gains the --agents option, bootstraps any named agent that is not configured yet via _configure_agents_for_mcp, and guards that --agents is only valid with --mcp (downloaded skills use shared directory families and cannot be agent scoped).
  • Without --agents, behavior is unchanged: every configured agent is updated.

Tests

  • test_mcp.py: per-agent add touches only the named client's scope and re-registers only that client; a global add reaches every configured client while preserving per-client divergence; adding a schema an agent already has is a no-op.
  • test_cli.py: --agents is parsed, bootstrapped, and forwarded for --mcp; an empty --agents list is rejected; --agents is rejected in download mode.

uv run pytest tests/test_mcp.py tests/test_cli.py tests/test_lint.py is green.

Stacking

This is the first of a stacked series that adds per-agent scoping to the skills MCP connection, built on top of xshen/per-client-skill-scopes (per-client skill scope map) and skill-managed-download-only (managed skills delivered by download only). Reviewing the diff against its base branch shows just this change. It rebuilds behavior originally designed by Arthur Jenoudet on the current per-client-map state model.

This pull request and its description were written by Isaac.

Give `ucode skill add --mcp` an `--agents` option so a schema can be added to a
chosen subset of configured coding agents instead of all of them, mirroring
`ucode mcp add --agents`. `add_skills_command` takes an optional `agents` set and
forwards it to `setup_mcp_clients`, which scopes the client set; the per-client
map is updated only for the targeted clients, and the CLI bootstraps any named
agent that is not configured yet before scoping. `--agents` is rejected outside
`--mcp` since downloaded skills use shared directory families.

Co-authored-by: Arthur Jenoudet <arthur.jenoudet@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
@xsh310
xsh310 force-pushed the xshen/skill-per-agent-add branch from 3e8757f to a3378e8 Compare September 8, 2026 05:43
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