Skip to content

fix(core): tell same-named MCP skills apart instead of dropping one - #66210

Merged
rekram1-node merged 1 commit into
devfrom
mcp-skill-names
Nov 25, 2026
Merged

rekram1-node merged 1 commit into
devfrom
mcp-skill-names

Conversation

@rekram1-node

Copy link
Copy Markdown
Member

Issue for this PR

N/A

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

When one MCP server listed two skills with the same name at different paths, only the first was registered and the second was dropped. The skills spec says hosts must tell them apart rather than silently discard one. Now they get IDs from the trailing path segments that differ:

 skill://acme/billing/refunds/SKILL.md   name: refunds
 skill://acme/support/refunds/SKILL.md   name: refunds
-  team:refunds          (support/refunds dropped)
+  team:billing.refunds
+  team:support.refunds
  • A skill whose name is unique on its server keeps <server>:<name>.
  • Segments are joined with ., which a skill name can't contain, so the result can't collide with a plain name.
  • If the paths never differ (the same skill path under two URI schemes), a short hash of the URI is added.

This is the same scheme #64157 used. It's behind the mcp_skills flag like the rest of MCP skills.

How did you verify your code works?

  • A new test in packages/core/test/mcp-skills.test.ts serves acme/billing/refunds and acme/support/refunds from one server and checks both are listed with their own IDs. The other MCP skills tests still pass.
  • bun typecheck in core.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend merging this change. On the base branch, the new test fails: a server listing two refunds skills at different paths registers only one. With this PR, all 5 tests in test/mcp-skills.test.ts pass, and tsc -b in core is clean.

The new IDs can't collide. The MCP SDK requires skill names to be lowercase letters, digits and hyphens that match the last path segment, so a dotted label can't match a plain name. Labels from different groups end in different names, so they can't match each other. isSafeSegment allows ., so the new IDs aren't filtered out.

Public API: unchanged. The change is internal to core and stays behind the mcp_skills flag.

No concerns.

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