| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…rs, pagination docs, path-sanitization note) - McpServer eagerly installs tools/resources/prompts handlers for capabilities declared in ServerOptions.capabilities, so declared-but-empty capabilities answer their list methods with empty results instead of -32601 (draft spec MUST) - Fix pagination doc examples to loop while (cursor !== undefined) so an empty-string cursor is not treated as end-of-results (draft spec MUST NOT) - Add path-sanitization security note to docs/server.md resources section - Add regression tests for deterministic tools/list ordering (already compliant; insertion order) - Completion 100-cap + hasMore already implemented and covered by e2e tests Closes #2202
🦋 Changeset detectedLatest commit: c219f2a The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Sorry, something went wrong.
|
@modelcontextprotocol/client
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/client@2269
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/codemod@2269
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server@2269
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server-legacy@2269
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/express@2269
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/fastify@2269
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/hono@2269
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/node@2269 commit: c219f2a |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM, thanks
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Implements the non-SEP changes from the 2025-11-25 → draft spec diff tracked in #2202. Per-item breakdown:
(a) Deterministic tools/list ordering — already compliant, tests added
McpServer lists tools via Object.entries(this._registeredTools), which is stable insertion order — no code change needed. Added regression tests (identical order across repeated tools/list calls, and stability across disable()/enable() toggles, including that re-enabling restores insertion position rather than appending) plus a short comment on the list handler documenting the guarantee.
(b) List responses when capability declared — the only behavioral change
Previously, McpServer installed list/call handlers lazily on first registerTool/registerResource/registerPrompt, so a server constructed with capabilities: { tools: {} } and zero registrations answered tools/list with -32601 (Method not found). The constructor now eagerly installs handlers for every primitive capability declared in ServerOptions.capabilities:
Undeclared capabilities with no registrations still return -32601, and lazy installation on first registration is unchanged for servers that don't declare capabilities up front. Low-level Server users remain responsible for their own handlers — documented on ServerOptions.capabilities.
Happy to split this item into its own PR if you'd prefer to keep behavioral and docs-only changes separate.
(c) Empty-string cursor — doc examples fixed
The SDK has no runtime pagination loop, but the pagination examples in client.examples.ts (and the JSDoc on listTools/listPrompts/listResources generated from them via sync:snippets) used } while (cursor);, which stops on an empty-string cursor. Fixed to while (cursor !== undefined) and re-ran pnpm sync:snippets.
(d) Resource path sanitization — docs only
The SDK serves no files itself; added a security note to the Resources section of docs/server.md about sanitizing user-influenced paths (traversal sequences, encoded forms, symlink escapes).
(e) Completion value caps — already compliant, already tested
createCompletionResult in mcp.ts already slices to 100 and sets hasMore/total, and test/e2e/scenarios/completion.test.ts (requirement completion:result-shape, 150-item fixture) already asserts the 100-cap, total, and hasMore: true. No change needed.
Notes
Validation
Closes #2202