Repository navigation
Add SkillCatalog and FilesystemSkillProvider for serving skills from a directory - #3795
Open
vijaydeepsinha wants to merge 13 commits into
Open
vijaydeepsinha wants to merge 13 commits into
vijaydeepsinha wants to merge 13 commits into
Conversation
There was a problem hiding this comment.
1 issue found across 13 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/mcp/server/skills/provider.py">
<violation number="1" location="src/mcp/server/skills/provider.py:19">
P2: `FilesystemSkillProvider` omits dot-prefixed files, so it cannot satisfy this “every file” contract. Align the protocol with the intended hidden-file behavior or make the provider enumerate those files.</violation>
</file>
Reply to a comment to ask cubic a question or push back. It learns from your replies.
Re-trigger cubic
| """ | ||
|
|
||
| async def list_files(self) -> Sequence[str]: | ||
| """Return the path of every file, recursively. |
There was a problem hiding this comment.
P2: FilesystemSkillProvider omits dot-prefixed files, so it cannot satisfy this “every file” contract. Align the protocol with the intended hidden-file behavior or make the provider enumerate those files.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At src/mcp/server/skills/provider.py, line 19:
<comment>`FilesystemSkillProvider` omits dot-prefixed files, so it cannot satisfy this “every file” contract. Align the protocol with the intended hidden-file behavior or make the provider enumerate those files.</comment>
<file context>
@@ -0,0 +1,31 @@
+ """
+
+ async def list_files(self) -> Sequence[str]:
+ """Return the path of every file, recursively.
+
+ Directories are not listed, and each path appears once.
</file context>
This branch has not been deployed
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.
Fixes #3683
Adds an optional helper that serves a directory of skills through the existing
Skillsextension, without changing the protocol or theSkillsAPI.mcp/server/skills.pybecomes a package;from mcp.server.skills import Skillsand the handler aliases still work.Motivation and Context
Serving skills from disk currently means writing handlers and registering every file as a resource by hand. This adds:
SkillProvider: a small protocol for listing and reading files.FilesystemSkillProvider: a local-directory provider that skips symlinks and junctions and runs blocking I/O in a worker thread.SkillCatalog: aSkillsextension that scans a provider once, validates each skill, and answersskills/list,skills/getand optionallyresources/directory/read. Manifest digests always match whatresources/readserves, and a file that changed after load is refused.Optional pagination (
page_size) and SEP-2549 cache hints (ttl_ms,cache_scope) are supported.Server usage
How Has This Been Tested?
./scripts/test: 100% coverage,strict-no-coverclean.ruff format --check,ruff check,pyright: clean.2025-11-25and the2026-07-28protocol versions: list/get/read, pagination, and directory reads enabled and disabled.Conformance
Ran the SEP-2640 scenarios from
@modelcontextprotocol/conformance@0.2.0-alpha.12(the first release that includes them; the version pinned in CI,alpha.11, has none) against real servers built withSkillCatalog+FilesystemSkillProvider:sep-2640-skills-enumeration(skills/list+skills/get)sep-2640-skills-manifest(SKILL.mdresource metadata)sep-2640-skills-directory(resources/directory/read)--page-size 2: the same 32/32, 6/6 and 7/7, includingskills-list-pagination(4 pages),skills-list-entry-atomic(7 skills, none split across pages) anddirectory-read-pagination.--force --spec-version: 2026-07-28 runs and passes all 32 enumeration checks. 2025-11-25 passes 30 of 30 applicable checks; the two cache-attribute checks (ttlMs/cacheScope, 2026-07-28+ only) are skipped. Manifest 6/6 and directory 7/7 on both.Breaking Changes
None.
Types of changes
Checklist
Additional context