Skip to content

fix(mcpdo): give resources/directory/read a URI and a cursor - #2775

Merged
cliffhall merged 1 commit into
v2/mainfrom
v2/fix/2767-mcpdo-directory-read-uri
Oct 21, 2026
Merged

cliffhall merged 1 commit into
v2/mainfrom
v2/fix/2767-mcpdo-directory-read-uri

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Closes #2767

Problem

mcpdo resources/directory/read could never succeed. The handler requires a URI, but the subcommand registered no way to pass one:

  • With no URI, the handler says URI is required … Use --uri.
  • --uri is rejected as an unknown option.
  • A positional URI is rejected with "too many arguments".

The release smoke for #2740 hit this (#2764), and 2.11.0 has the same gap.

Change

clients/mcpdo/src/connection/mcp.ts: resources/directory/read gets its own registration:

  • [uri] / --uri <uri>, like resources/read.
  • --cursor <cursor>, the option the one-shot CLI already has. The handler returns one page per call, so without it a script could only ever read the first page.

Tests

New file clients/mcpdo/__tests__/directory-read.test.ts, end to end against a real skills server (createTestServerHttp({ skills: true })):

  1. connect.
  2. Read the directory by positional URI. The test checks the entries sit under the directory and that the result carries ttlMs and cacheScope (Modern resources/directory/read results must carry ttlMs and cacheScope (ext-skills stable spec) #2740).
  3. Read it again with --uri, which returns the same page.
  4. Pass the first page's nextCursor back through --cursor, which returns a different page.

Mutation check: with the new registration removed, the test fails with the original too many arguments for 'resources/directory/read'.

Coverage: mcp.ts is at 95.94 / 91.56 / 97.33 / 97. npm run local:gate: green (exit 0).

No UI change, so no screenshots.

🤖 Generated with Claude Code

The subcommand registered neither, so the handler's 'URI is required'
error was its only outcome: --uri was an unknown option and a positional
URI was 'too many arguments'. It now takes [uri] / --uri like
resources/read, plus --cursor, as the one-shot CLI does, so a script can
page a listing.

Closes #2767

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: cliffhall <cliff@futurescale.com>
@cliffhall cliffhall added the v2 Issues and PRs for v2 label Oct 21, 2026
@cliffhall
cliffhall requested a balanced review from Copilot October 21, 2026 17:07

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 focused registration fix matches the handler contract, with regression coverage and no unresolved findings.

No open issues 🎉

What changed in this PR

Fixes the unusable mcpdo resources/directory/read command by exposing the URI and pagination inputs its handler requires.

Changes:

  • Accepts a positional URI or --uri, plus --cursor.
  • Adds end-to-end coverage for both URI forms, pagination, and cache metadata.
File Description
clients/​mcpdo/​src/​connection/​mcp.ts Registers and forwards directory URI and cursor arguments.
clients/​mcpdo/​__tests__/​directory-read.test.ts Tests directory reads against a real skills server.

Review effort: Balanced

@cliffhall
cliffhall merged commit 63c5a06 into v2/main Oct 21, 2026
11 checks passed
@cliffhall
cliffhall deleted the v2/fix/2767-mcpdo-directory-read-uri branch October 21, 2026 17:21
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.

mcpdo resources/directory/read accepts no URI, so it can never succeed

2 participants