Skip to content

feat(rmcp): implement SEP-2640 MCP Skills Extension - #1286

Open
branben wants to merge 3 commits into
modelcontextprotocol:mainfrom
branben:feat/sep-2640-skills
Open

branben wants to merge 3 commits into
modelcontextprotocol:mainfrom
branben:feat/sep-2640-skills

Conversation

@branben

@branben branben commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Motivation and Context

SEP-2640 (Skills Extension for MCP) was merged Sep 13. This PR adds the Rust SDK
reference implementation: skills/list, skills/get, and resources/directory/read
methods, plus the #[skill] macro trio that lets server authors declare skill
endpoints the same way they declare tool endpoints.

How Has This Been Tested?

cargo check --all-features passes clean. 11 conformance tests pass in
conformance/. FileSystemSkillServer demo server runs end-to-end with
fixtures under fixtures/skills-dir/.

Breaking Changes

None. All new methods are additive. Existing code is unaffected.

Public API Check may report false positives for the #[skill] macro — the macro
generates code at compile time, and the generated types satisfy the trait bounds
through transparent expansion, not a newtype wrapper.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling (catch-all match arm for future SEP methods)
  • I have added or updated documentation as needed

Brandon Bennett and others added 2 commits September 15, 2026 10:29
Add skills/list, skills/get, resources/directory/read server-side dispatch
and client-side convenience wrappers (list_skills, get_skill, read_skill_uri,
read_directory, list_all_skills).

ServerHandler trait default methods + handle_request arms for all three
RPC methods. Model types in new model/skills.rs module with const_string!
request method constants, PaginatedRequestParams-based SkillsListRequest,
and ResourcesDirectoryReadRequestParams/Result mirroring the resources/read
pattern. Client wrappers on Peer<RoleClient> plus spec-named public API
convenience functions.

Co-Authored-By: openhands <openhands@all-hands.dev>
Add the #[skill] macro trio (skill, skill_router, skill_handler) that
let users declare skill endpoints via proc-macro annotations — analogous
to the existing #[tool] and #[prompt] trios. Dispatch key is a skill:// URI
instead of a flat name; the router parses URIs via parse_skill_uri.

SkillRouter<S> + SkillRoute<S> runtime types in handler/server/router/skill.rs.
ServerHandler trait methods for skills_list, skills_get, resources_directory_read
wired through handle_request in handler/server.rs.

FileSystemSkillServer (examples/skill_fs_server.rs) walks **/SKILL.md from a
directory tree, parses flat YAML frontmatter into JSON, computes SHA-256 digests
for sibling files, and serves entries over stdio. Marked as example/demo code —
users should implement their own ServerHandler using the #[skill] macro.

Validation client (examples/skill_fs_client.rs) spawns the server over stdio
without shell invocation and verifies list/get/error paths end-to-end.

Test suite (tests/test_skills_conformance.rs) exercises the server binary as a
child process over stdio JSON-RPC — 10 tests covering discovery, URI validation,
frontmatter parsing, multi-file resources, and negative cases.
@branben
branben requested a review from a team as a code owner September 18, 2026 23:50
@github-actions github-actions Bot added T-documentation Documentation improvements T-dependencies Dependencies related changes T-test Testing related changes T-config Configuration file changes T-core Core library changes T-handler Handler implementation changes T-macros Macro changes T-model Model/data structure changes T-service Service layer changes labels Sep 18, 2026
@branben
branben force-pushed the feat/sep-2640-skills branch from aba85c0 to 15ed73a Compare September 19, 2026 02:19
@branben
branben force-pushed the feat/sep-2640-skills branch from 15ed73a to 2585f28 Compare September 19, 2026 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-config Configuration file changes T-core Core library changes T-dependencies Dependencies related changes T-documentation Documentation improvements T-handler Handler implementation changes T-macros Macro changes T-model Model/data structure changes T-service Service layer changes T-test Testing related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant