Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Modern resources/directory/read results must carry ttlMs and cacheScope (ext-skills stable spec)

Chiusa
#2,740 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@olaservo ci sta già lavorando.

Dal 20/10/2026.

  • #2747 di @olaservo — integrata

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug v2

Problem

core/mcp/skillsSchemas.ts parses resources/directory/read results with one schema for both eras, and its closing comment says there is deliberately no modern variant because SEP-2640 "states nothing of the kind" about caching attributes on that method. The stable ext-skills specification (specification/stable/skills.mdx, updated upstream 2026-10-15 in ext-skills#157, decision recorded in docs/decisions.md) now settles that question the same way it settled skills/get in #2404:

ReadResourceDirectoryResult extends CacheableResult, so ttlMs and cacheScope are REQUIRED, as they are on resources/list, and carry the same semantics. They describe the freshness of the directory listing, not of the held entry, and do not alter Directory Reads and the Held Entry.

The spec's directory-read examples now carry "ttlMs": 300000, "cacheScope": "public".

As a result, the Inspector accepts a modern resources/directory/read result that is missing these required fields, so it reports a non-conforming server as clean. The test server has the same gap: readDirectoryPage in test-servers/src/skills.ts sends resultType only, with a comment saying a fixture that sent more than the SEP shows would make a client that wrongly required them look correct. Under the new text the fixture itself is non-conformant on the modern leg.

Expected

On modern (2026-07-28+) connections, validate resources/directory/read results against CacheableResult the same way skills/list and skills/get already are: require ttlMs as a non-negative integer and cacheScope as public or private. Legacy results stay permissive.

  • core/mcp/skillsSchemas.ts: add a ModernDirectoryReadResultSchema extending DirectoryReadResultSchema with the two attributes, and replace the "no modern variant" comment block with the new citation.
  • core/mcp/inspectorClient.ts readResourceDirectory: pick the schema from isModernEra(), as listSkills and getSkillResult do.
  • test-servers/src/skills.ts: readDirectoryPage and DirectoryReadResultShape send and validate the full modern envelope, matching the skills/* results.
  • Tests: the modern integration cases for resources/directory/read assert the attributes are required, mirroring the #2404 coverage for skills/get. The CLI --method resources/directory/read prints the result as received, so its output gains the two fields on modern connections and nothing else changes.

Checked and not affected

The same ext-skills change also added named params interfaces with required _meta on skills/get and resources/directory/read requests, optional _meta on Skill, and *ResultResponse types. The SDK already stamps the required request metadata on modern connections (the strict modern test server reads clientCapabilities from it, #2373), SkillEntrySchema is a looseObject so _meta passes through, and the response types are documentation only. No Inspector change is needed for those.

Context

Spec diff: ext-skills#157, fixing ext-skills#156. Precedent: #2404 (same change for skills/get), #2373 (why the modern schemas omit resultType).

Lingua principale
TypeScript
Stelle
11.1k
Fork
1.6k
Merge medio
5h 29m
PR unite (30g)
158

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelcontextprotocol/inspector

Tutte le issue di modelcontextprotocol/inspector

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.