Skip to content

chore(skills): take SEP-2640 constants and schemas from the SDK, move the rest to core/extension/skills - #2808

Merged
cliffhall merged 1 commit into
v2/mainfrom
v2/chore/2804-sdk-skills-client
Oct 25, 2026
Merged

cliffhall merged 1 commit into
v2/mainfrom
v2/chore/2804-sdk-skills-client

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Closes #2804

What changed

MCP TypeScript SDK 2.4.0 ships the Skills extension's client (@modelcontextprotocol/client/ext/skills) and schemas (@modelcontextprotocol/core/ext/skills). This PR compares that client with the Inspector's own code first, as the issue asks. Wherever the SDK can be used without changing what users see, its code replaces ours. Everything else moves to core/extension/skills/, which imports nothing from InspectorClient.

Taken from the SDK (our copies deleted)

What Now from
Extension id, skills/list, skills/get, resources/directory/read, inode/directory Re-exported from core/ext/skills. Same pattern as core/extension/tasks/constants.ts.
Per-skill limits (512 files / 16 MiB) SKILL_LIMITS
Digest grammar SKILL_DIGEST_PATTERN
ttlMs / cacheScope on every modern list/get schema The SDK's own field schemas
resources/directory/read result, both eras ReadResourceDirectoryResultSchema (modern) and .partial({ ttlMs, cacheScope }) (legacy). This is exactly how SkillsClient decodes a 2025-11-25 result.

Kept as ours, and why

Kept Why the SDK doesn't fit
Permissive entry schemas (SkillEntrySchema, list/get envelopes) The SDK's SkillSchema is built for a host. Its digest must match the pattern, its size must be an integer, and its name/description are required. list() throws on a non-conforming entry. With skipInvalid it returns the entry only as { index, uri, reason }, which loses the frontmatter and manifest the Skills screens display. get() throws too. Using either would turn every conformance finding into a page that fails to load.
list / get / readDirectory calls stay on client.request list() and get(): the entry-loss problem above. readDirectory() always walks every page, but the CLI and web expose cursor page by page. Only the directory schema was a clean swap.
Conformance report (conformance.ts) Reports every rule separately, with a code and a severity. "dynamic" resources stay a reported warning (#2405), not a silent verified: false. It also runs against entries the SDK would never hand back.
Verification walk (verification.ts) SkillsClient.read() throws SkillVerificationError at the first failed check and refuses an invalid entry before any request. The walk records each file's outcome, including unverifiable and the catalog read-budget cut-off. It now takes a narrow SkillResourceReader (readResource + getServerSettings) rather than InspectorClientProtocol.
Frontmatter parsing (skillFile.ts, yaml) The SDK's parser is internal, and it rejects anchors/aliases and multi-line quoted scalars. The yaml parser reports those as findings instead.
SHA-256 (sha256.ts) The SDK's digest helper is internal and uses crypto.subtle only. Ours falls back to a pure implementation over plain HTTP on a LAN IP, where subtle is absent.
Capability detection (getSkillsExtension) skillsCapabilityOf returns undefined for a declaration that doesn't parse (e.g. directoryRead: "yes"). That would hide the Skills tab for exactly the server an inspector is for.
Client-capability declaration (#2373) Unchanged in core/mcp/extensions.ts.

Layout

core/mcp/{skills,skillsSchemas,skillsVerification,skillFile,sha256}.ts move to core/extension/skills/{conformance,schemas,verification,skillFile,sha256}.ts, and their tests move to clients/web/src/test/core/extension/skills/. core/extension/** was already in the web coverage include. AGENTS.md, the project-structure skill and the roadmap doc are updated to the new paths.

No user-facing change

  • The Skills screens in web, TUI and CLI are untouched apart from import paths.
  • The integration suites for both eras pass (inspectorClient-skills, skills-strict-configs).
  • verify:bundle-externals passes, so the new ext/skills subpath stays external in all four bundles.
  • npm run local:gate is green.

One small difference: a directory child now keeps unknown members instead of having them stripped. The SDK's DirectoryResourceSchema is looseObject, so the CLI prints the result closer to what the server actually sent.

🤖 Generated with Claude Code

… the rest to core/extension/skills (#2804)

MCP TypeScript SDK 2.4.0 ships the client side of the Skills extension.
The wire constants, SKILL_LIMITS, the digest pattern, the caching fields
and the resources/directory/read result schema now come from
@modelcontextprotocol/core/ext/skills instead of being restated.

SkillsClient itself stays out of the call path: list() and get() run the
SDK's host-strict SkillSchema over every entry and throw on (or reduce to a
one-line reason) exactly the non-conforming entries the conformance report
exists to show, and read() throws on the first failed check. The
permissive entry schemas, the per-check conformance and verification
report, frontmatter parsing and capability detection stay ours, now in
core/extension/skills/, which imports nothing from InspectorClient.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: cliffhall <cliff@futurescale.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The SDK substitutions and module relocation preserve the inspection-specific contracts, with no unresolved blocking defects identified.

No open issues 🎉

What changed in this PR

This PR addresses #2804 by adopting SDK-owned Skills constants and compatible schemas while keeping Inspector-specific validation and reporting in core/extension/skills/.

Changes:

  • Reuses SDK constants, limits, digest grammar, cache-field schemas, and directory-read schemas.
  • Relocates inspection-specific helpers and introduces a narrow SkillResourceReader interface for verification.
  • Updates client imports, test locations, and architecture documentation while retaining permissive inspection of invalid skills.
File Description
docs/​inspector-roadmap-2026-h2.md Updates the conformance-module reference.
core/​react/​useManagedSkills.ts Updates the skill-type import.
core/​mcp/​state/​managedSkillsState.ts Imports relocated Skills schemas.
core/​mcp/​serverList.ts Imports relocated catalog-budget helpers.
core/​mcp/​remote/​node/​server.ts Updates catalog-limit validation import.
core/​mcp/​node/​config.ts Updates catalog-limit validation import.
core/​mcp/​inspectorClientProtocol.ts Updates Skills interface type imports.
core/​mcp/​inspectorClient.ts Uses relocated schemas and capability helpers.
core/​mcp/​extensions.ts Imports the SDK-backed extension identifier.
core/​mcp/​__tests__/​fakeInspectorClient.ts Updates test-double type imports.
core/​extension/​skills/​verification.ts Relocates verification and narrows its client interface.
core/​extension/​skills/​skillFile.ts Relocates frontmatter parsing helpers.
core/​extension/​skills/​sha256.ts Relocates the HTTP-compatible hashing fallback.
core/​extension/​skills/​schemas.ts Adopts compatible SDK schemas and constants.
core/​extension/​skills/​conformance.ts Relocates checks and adopts SDK limits and digest grammar.
core/​cli/​handlers/​skills-verify.ts Updates verification-report imports.
core/​cli/​handlers/​run-method.ts Updates Skills dispatch and verification imports.
core/​cli/​handlers/​output-file.ts Updates the byte-decoding helper import.
clients/​web/​src/​test/​integration/​mcp/​inspectorClient-skills.test.ts Points integration tests at relocated helpers.
clients/​web/​src/​test/​core/​react/​useManagedSkills.test.tsx Updates the hook test’s skill-type import.
clients/​web/​src/​test/​core/​mcp/​state/​managedSkillsState.test.ts Updates the store test’s skill-type import.
clients/​web/​src/​test/​core/​mcp/​inspectorClient-skills.test.ts Updates the extension-identifier import.
clients/​web/​src/​test/​core/​mcp/​extensions.test.ts Updates capability-test imports.
clients/​web/​src/​test/​core/​extension/​skills/​verification.test.ts Relocates verification tests and updates imports.
clients/​web/​src/​test/​core/​extension/​skills/​skillFileBytes.test.ts Relocates byte-conversion tests.
clients/​web/​src/​test/​core/​extension/​skills/​skillFile.test.ts Relocates frontmatter tests.
clients/​web/​src/​test/​core/​extension/​skills/​sha256.test.ts Relocates hashing tests.
clients/​web/​src/​test/​core/​extension/​skills/​schemas.test.ts Relocates schema tests and asserts SDK reuse.
clients/​web/​src/​test/​core/​extension/​skills/​conformance.test.ts Relocates conformance tests.
clients/​web/​src/​hooks/​useServerCommands.tsx Updates command-helper and result-type imports.
clients/​web/​src/​hooks/​useInspectorStores.ts Updates the Skills store type import.
clients/​web/​src/​components/​views/​InspectorView/​types.ts Updates Skills view-contract imports.
clients/​web/​src/​components/​views/​InspectorView/​InspectorView.tsx Updates capability-detection import.
clients/​web/​src/​components/​screens/​SkillsScreen/​SkillsScreen.tsx Uses relocated inspection helpers.
clients/​web/​src/​components/​screens/​SkillsScreen/​SkillsScreen.test.tsx Updates screen-test imports.
clients/​web/​src/​components/​screens/​SkillsScreen/​SkillsScreen.stories.tsx Updates story fixture imports.
clients/​web/​src/​components/​groups/​ServerSettingsForm/​ServerSettingsForm.tsx Updates catalog-budget helper imports.
clients/​web/​src/​components/​groups/​ConnectionInfoContent/​ConnectionInfoContent.tsx Updates Skills capability import.
clients/​web/​src/​App.tsx Updates Skills capability import.
clients/​tui/​src/​components/​SkillsTab.tsx Uses relocated Skills inspection modules.
clients/​tui/​__tests__/​SkillsTab.test.tsx Updates TUI test imports.
clients/​mcpdo/​__tests__/​skills-budget-hint.test.ts Updates the verification-report type import.
clients/​cli/​__tests__/​skills-verify-cli.test.ts Updates the verification-report type import.
clients/​cli/​__tests__/​run-method-skills.test.ts Updates CLI Skills test imports.
AGENTS.md Documents the Skills extension directory.
.claude/​skills/​project-structure/​SKILL.md Documents SDK ownership and retained Inspector logic.

Review effort: Balanced

@cliffhall

Copy link
Copy Markdown
Member Author

Copilot review loop closed: round 1 was clean (no inline comments, no suppressed findings, approval recommended), so no further round was requested.

@cliffhall
cliffhall merged commit 272bdad into v2/main Oct 25, 2026
11 checks passed
@cliffhall
cliffhall deleted the v2/chore/2804-sdk-skills-client branch October 25, 2026 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adopt the SDK's Skills client (SEP-2640) and replace the Inspector's own Skills protocol code

2 participants