Add SEP-2640 Skills extension support - #1856
Open
girishkvs wants to merge 1 commit into
Open
Conversation
Adds ModelContextProtocol.Extensions.Skills implementing the skills/list and skills/get methods of SEP-2640, alongside the existing Tasks and Apps extension packages. Declares the io.modelcontextprotocol/skills capability inline and registers both methods through McpServerOptions.RequestHandlers, so Core is unchanged. Skill manifests are modelled as SkillResources, a closed type admitting only an enumerated file list or the dynamic marker, so an invalid manifest cannot be constructed. Pagination uses keyset cursors over URI order. skills/get sets RoutingNameParameter to uri, matching how Core routes resources/read for the Mcp-Name header. ttlMs and cacheScope are gated on the negotiated protocol version by default, which SEP-2640 currently requires, but the gate is configurable while the working group settles whether that condition is removed.
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
ModelContextProtocol.Extensions.Skills, implementing theskills/listandskills/getmethods of SEP-2640 (io.modelcontextprotocol/skills, accepted 2026-09-01), alongside the existing Tasks and Apps extension packages. The capability is declared inline and both methods are registered throughMcpServerOptions.RequestHandlers, so the extension consumes only public Core API.There is one Core change, and I am happy to split it into its own PR.
PaginatedResultandPaginatedRequestParamshadprivate protectedconstructors, so a package outside Core cannot implement a paginated method.skills/listis paginated. Widening those toprotectedis source and binary compatible, and package validation passes against the 2.0.0 baseline.A skill's manifest uses a closed
SkillResourcestype admitting only an enumerated file list or the"dynamic"marker, so an invalid manifest cannot be constructed and"resources": nullis rejected on read. Pagination uses keyset cursors over URI order.ttlMsandcacheScopeare gated on the negotiated protocol version, which is what SEP-2640 currently says, but the gate is configurable: the Go SDK and the spec restructure both dropped that condition independently, so it may be removed from the SEP rather than added to implementations.Two things I would like maintainer input on, neither of which this PR changes:
RequestHandlersdo not pass throughAuthorizationFilterSetup, which wires filters for the built-in methods only. A listing can therefore expose frontmatter, file names, digests, and sizes for files thatresources/readwould refuse the same caller. Should an extension derive its view from the already filtered resource collection, or would you want a filter hook for custom request handlers in Core?CacheScopeConverterisinternalwhileICacheableResultandCacheScopeare public, so an extension can implement the interface but cannot reproduce Core's read-side leniency for unrecognized scope values.Following
CONTRIBUTING.mdI would normally open an issue first. I am opening this as a PR because the working group asked for a reference implementation in a Tier 1 SDK and Go already has one in flight. Happy to convert this to an issue, split it, or reshape the API if you would prefer.Changes
Extensions.Skills/SkillsProtocol.csExtensions.Skills/Protocol/SkillEntry.cs,SkillResource.csExtensions.Skills/Protocol/SkillResources.cs,SkillResourcesConverter.cs"dynamic"union and its converterExtensions.Skills/Protocol/ListSkills*.cs,GetSkill*.csExtensions.Skills/McpSkillsJsonContext.csExtensions.Skills/Server/IMcpSkillCatalog.cs,McpSkillPage.csExtensions.Skills/Server/InMemoryMcpSkillCatalog.csExtensions.Skills/Server/McpSkillsBuilderExtensions.cs,McpSkillsOptions.csWithSkills()and its optionsCore/Protocol/PaginatedResult.cs,PaginatedRequest.csprivate protectedtoprotectedConformanceServer/Skills/ConformanceSkills.csConformanceServer/Program.csTests/Protocol/SkillSerializationTests.csTests/Server/InMemoryMcpSkillCatalogTests.csTests/Server/McpServerSkillsTests.csValidation
net10.0,net9.0,net8.0,netstandard2.0withTreatWarningsAsErrors, 0 warningsModelContextProtocol.Testson net10.0: 2400 passed, 0 failed, 4 skipped (pre-existing, external dependencies)ConformanceServer:sep-2640-skills-enumerationsep-2640-skills-manifestsep-2640-skills-directorydirectoryReadnot declared)0.2.0-alpha.10and the repo's pinned0.2.0-alpha.9): 42 passed, 0 failed, no regression from the added skill resourcesresources/directory/readis not implemented in this PR, sodirectoryReadis not declared and those scenarios skip cleanly. Client-side wrappers are not included either; there is no client conformance scenario to validate them against yet.