Skip to content

fix(mcp): close Skills conformance gaps with directory reads and resource metadata - #905

Merged
runkids merged 4 commits into
runkids:mainfrom
salmonumbrella:feat/issue-895-nov14
Nov 14, 2026
Merged

runkids merged 4 commits into
runkids:mainfrom
salmonumbrella:feat/issue-895-nov14

Conversation

@salmonumbrella

@salmonumbrella salmonumbrella commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Type

Linked Issue

#895: directory reads and the remaining SEP-2640 conformance gaps.

What changed

  • mcp serve advertises directoryRead: true and implements resources/directory/read for served skill roots and subdirectories. It returns direct children with file MIME types and inode/directory for directories. Empty directories return resources: []; files and unknown directories return -32602.
  • resources/list lists served SKILL.md files with their frontmatter name and description. Supporting files remain available through directory browsing and the existing resource template. Cached listings use catalog metadata without rereading payloads; catalog refresh still performs the existing file reads. Listings follow the same selection and refresh rules as skills and return at most 100 resources per page in URI order.
  • The strict frontmatter JSON view follows YAML 1.2 Core scalar rules so it matches the served SKILL.md: dates stay strings and leading-zero decimal integers stay decimal. Source bytes remain unchanged.
  • Adds regression tests, a pinned official conformance helper, and runbook coverage for directory browsing and resource metadata. Updates the MCP reference in English and all four translated docs.

Why

The server already served skill manifests and files, but clients could not browse directories. Without directoryRead, the official suite skips directory checks; without SKILL.md in resources/list, its name and description checks warn as untestable. YAML scalar differences could also make manifest frontmatter disagree with the file clients received. This closes those gaps while keeping listings within the served catalog.

fix-mcp-close-Skills-conformance-gaps-with-directory-reads-and-resource-metadata.mp4

Usage

Start the server as before:

skillshare mcp serve -g

An MCP client can now call resources/list for skill metadata, or resources/directory/read with {"uri":"skill://example/templates"} to browse a served skill's directory. Use directory URIs without a trailing slash. Pass a returned nextCursor as cursor to continue either listing.

Verification

Local measured results from isolated Linux devcontainer runs with synthetic sources:

  • Pinned official Skills suite: 45 checks SUCCESS, 0 warnings: enumeration 32, manifest 6, directory 7. Both metadata checks and the directory, wire, and frontmatter checks executed.
  • MCP serve runbook: 13/13 passed.
  • Go checks passed for internal/utils and internal/skillserve; internal/skillpkg compiled and its supporting-file benchmark matrix was exercised. MIME boundary cases are covered by skillserve tests. Integration TestMCPServe passed. Scoped utils/skillserve race checks and package vet were clean.
  • Conformance helper shellcheck, English website build, context-router check, and diff check passed.

Upstream CI at df41a292: all 7 active checks passed across the Test and Nix workflows: unit tests, Windows tests, Ubuntu and macOS integration tests, redteam, offline Docker sandbox, and Nix check. docker-sandbox-online and redteam-signal were skipped per policy.

Not run locally: make check, the full Go or integration suites, the all-locale website build, Windows guest checks, or dashboard tests. The upstream suites above passed separately. There are no rendered UI changes.

The final GLM-5.3-flash source review at high effort passed with no issues. GitHub Codex's automatic review after the draft was marked ready completed at df41a292 with no findings; the two earlier manually requested reviews failed because of a service limitation.

Checklist

  • I've read CONTRIBUTING.md, including its AI-assisted contributions section — read during automated preparation; this does not attest to a human read.
  • I've reviewed every line of the diff and can explain it — automated source review complete; human author review pending. This change and PR prose used AI assistance.
  • Tests included and passing (make check) — for code changes. Scoped local checks and upstream CI passed as listed above; full local make check was not run.
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

Closes #895

Expose accepted skill directories and SKILL.md metadata so MCP hosts can
browse served packages without guessing manifest filenames. Reuse catalog
selection and refresh boundaries, including empty directories and stable
pagination, and normalize strict frontmatter for YAML 1.2 Core readback.

Add regressions and a pinned official conformance runner, and update the
runbook and MCP references to describe the browsing contract.

Refs runkids#895
Record UTF-8 classification from the same bounded bytes used for package
digests so directory metadata agrees with resource reads for extensionless
and unknown-extension text. Reuse the existing bounded reader without
adding listing-time payload reads or changing package limits.

Share pagination with skills/list, trust the SDK's typed request boundary,
and repair the pagination regression to detect stale catalog snapshots.

Refs runkids#895
Buffering supporting files during catalog refresh allocated with asset size.
Restore one bounded stream for digest, size and UTF-8 classification, retaining
at most three incomplete rune bytes and consuming invalid text through EOF.
Preserve the existing same-file checks, package caps and SKILL.md byte reader.

Keep real package-load benchmarks and strengthen the existing MIME fixtures
for split runes and bytes after invalid sequences. Use one first-match sed
command for the conformance URL without a truncated pipeline under pipefail.

Scoped packages, focused race tests, vet, shell syntax/shellcheck and all 45
pinned official checks pass. Allocation stays near 48 KB for 64 KiB and 8 MiB
assets; multibyte UTF-8 validation still costs CPU versus digest-only loading.
Check every directory continuation URI so a duplicated middle entry cannot
hide a missing resource. Keep the existing before/after-cursor refresh cases.

Merge nested-skill acceptance fixtures in the catalog owner, preserving all
skill-count, skip-warning and directory assertions across configured and
targetless cases. Move directory capability coverage to initialization and
merge scalar, alias and rejection cases under the existing parser test.

Give cached-page benchmark skills names that match their URI directories.
Narrow tests, benchmark smoke and vet pass; duplicate-result and stale-catalog
mutations both fail, then restored source passes. Production is unchanged.
@salmonumbrella

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T10:55:58.199741Z df41a29 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@salmonumbrella

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@salmonumbrella
salmonumbrella marked this pull request as ready for review November 14, 2026 10:51
@runkids
runkids merged commit e969ebc into runkids:main Nov 14, 2026
9 checks passed
runkids added a commit that referenced this pull request Nov 14, 2026
 (#911)

Follow-up to #905.

The conformance script builds and serves skillshare and runs npm ci, which
the repository only allows inside a container, but nothing stopped it from
running on the host. It now refuses outside a container, with the same check
scripts/hooks/git-e2e.sh uses. Nothing referred to the script either, so the
testing topic now says when and how to run it.

The translated mcp reference pages left out the example URI the English page
gives for a skill root. All four now carry it.

The streaming UTF-8 check in the package loader was only exercised with a
rune split one byte before the read boundary. Two fixtures in the existing
directory test add the 2+2 and 3+1 splits, so a mistake in the carried-over
bytes shows up as a wrong MIME type.
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.

mcp serve: directory reads and the remaining SEP-2640 conformance gaps

2 participants