Repository navigation
fix(core): tell same-named MCP skills apart instead of dropping one - #66210
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.
3 of 6 tasks
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.
Issue for this PR
N/A
Type of change
What does this PR do?
When one MCP server listed two skills with the same
nameat 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:<server>:<name>.., which a skill name can't contain, so the result can't collide with a plain name.This is the same scheme #64157 used. It's behind the
mcp_skillsflag like the rest of MCP skills.How did you verify your code works?
packages/core/test/mcp-skills.test.tsservesacme/billing/refundsandacme/support/refundsfrom one server and checks both are listed with their own IDs. The other MCP skills tests still pass.bun typecheckin core.Checklist