Repository navigation
fix(mcpdo): give resources/directory/read a URI and a cursor - #2775
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
🟢 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
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.
Closes #2767
Problem
mcpdo resources/directory/readcould never succeed. The handler requires a URI, but the subcommand registered no way to pass one:URI is required … Use --uri.--uriis rejected as an unknown option.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/readgets its own registration:[uri]/--uri <uri>, likeresources/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 })):connect.ttlMsandcacheScope(Modern resources/directory/read results must carry ttlMs and cacheScope (ext-skills stable spec) #2740).--uri, which returns the same page.nextCursorback 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.tsis 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