Skip to content

docs: client log levels, elicitation completion notification; drive json-schema-2020-12-preservation on the alpha.11 referee - #2686

Merged
felixweinberger merged 2 commits into
mainfrom
fweinberger/v2-docs-logging-elicitation
Aug 18, 2026
Merged

docs: client log levels, elicitation completion notification; drive json-schema-2020-12-preservation on the alpha.11 referee#2686
felixweinberger merged 2 commits into
mainfrom
fweinberger/v2-docs-logging-elicitation

Conversation

@felixweinberger

Copy link
Copy Markdown
Contributor

Documents the two remaining guide gaps — a client raising the log level (setLoggingLevel) and the URL-elicitation completion notification — and makes the conformance harness drive the json-schema-2020-12-preservation client scenario against the 0.2.0-alpha.11 referee.

Motivation and Context

The SEP-1730 documentation check for v2 came back 46/48 after #2679: client.setLoggingLevel() and notifications/elicitation/complete had runnable code under examples/ but no how-to prose on the guide site. Separately, the client conformance leg reported one un-baselined failure: json-schema-2020-12-preservation landed in the referee after our alpha.10 pin and the everything client had no driver for it, so the run hit "Unknown scenario".

  • docs/servers/logging-progress-cancellation.md — "Let the client set the level": setLoggingLevel, the auto-installed logging/setLevel handler, filtered output; one-line 2026-07-28 note.
  • docs/servers/elicitation.md — "Signal that the URL flow finished": createElicitationCompletionNotifier server-side, the client-side wait on the notification; 2025-era-only note.
  • test/conformance/src/everythingClient.ts — registers the preservation scenario (list tools, echo the observed inputSchema verbatim through json_schema_echo; modern lifecycle under a 2026-07-28 run).
  • test/conformance/package.json — referee pin 0.2.0-alpha.100.2.0-alpha.11; both expected-failures*.yaml reconciled (no entries added or removed; the two scenarios alpha.11 added both pass).

How Has This Been Tested?

pnpm sync:snippets --check, examples typecheck + lint, both guide companions run and assert the quoted output. Conformance legs as CI runs them: client:all 449 passed / 9 baselined, client:2026 385 passed / 0 failed, server:all 199 passed / 30 baselined, server:2026 151 passed / 0 failed. The preservation scenario passes 9/9 on both wires, and the frozen-set runs (conformance sdk --requirements 2025-11-25 and 2026-07-28) score 18/18 and 32/32 with it reported as added-after-release.

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Lockfile: besides the pin, alpha.11 declares ajv ^8.20.0, so pnpm added ajv@8.20.0 for the referee and re-resolved the referee's transitive @modelcontextprotocol/sdk@1.29.0 snapshot onto it; workspace packages stay on ajv 8.18.0.

@felixweinberger
felixweinberger requested a review from a team as a code owner August 18, 2026 13:55
@changeset-bot

changeset-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 49b9cad

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Aug 18, 2026

Copy link
Copy Markdown

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/@modelcontextprotocol/client@2686

@modelcontextprotocol/codemod

npm i https://pkg.pr.new/@modelcontextprotocol/codemod@2686

@modelcontextprotocol/core

npm i https://pkg.pr.new/@modelcontextprotocol/core@2686

@modelcontextprotocol/server

npm i https://pkg.pr.new/@modelcontextprotocol/server@2686

@modelcontextprotocol/server-legacy

npm i https://pkg.pr.new/@modelcontextprotocol/server-legacy@2686

@modelcontextprotocol/express

npm i https://pkg.pr.new/@modelcontextprotocol/express@2686

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/@modelcontextprotocol/fastify@2686

@modelcontextprotocol/hono

npm i https://pkg.pr.new/@modelcontextprotocol/hono@2686

@modelcontextprotocol/node

npm i https://pkg.pr.new/@modelcontextprotocol/node@2686

commit: 49b9cad

@claude claude Bot 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.

Beyond the inline findings (all on the elicitation guide snippets), I also checked the other strand of this PR and found no issues: the new json-schema-2020-12-preservation scenario in test/conformance/src/everythingClient.ts mirrors the existing scenarios' lifecycle/negotiation pattern and passes the observed inputSchema through verbatim; the setLoggingLevel snippet in logging-progress-cancellation.examples.ts is self-asserting with a fail-fast throw; and both expected-failures*.yaml changes are comment-only reconciliation matching the alpha.11 pin bump.

Extended reasoning...

The three confirmed findings all concern the URL-elicitation documentation pattern in examples/guides/servers/elicitation.examples.ts (missing request-timeout handling in the documented parked elicitInput flow, no cancellation path in the client-side wait, and unbounded polling loops in the harness). Since findings are present and the hunt exited on max_rounds, approval is off the table; this note only records what else was examined and ruled out. I read the full diff for the conformance strand: the new client scenario follows the established registerScenario pattern with the same isModernConformanceRun() era branching as tools_call, and echoes focal.inputSchema untouched, which is exactly what a preservation check needs. The logging guide addition's assertion (delivered.join(',') !== 'warning' plus the exact filtered text) correctly verifies the documented filtering claim and throws on mismatch. The expected-failures YAML edits add only reconciliation comments alongside the pin bump from alpha.10 to alpha.11, consistent with the convention stated in those files.

Comment thread examples/guides/servers/elicitation.examples.ts Outdated
Comment thread examples/guides/servers/elicitation.examples.ts Outdated
Comment thread examples/guides/servers/elicitation.examples.ts Outdated
@felixweinberger
felixweinberger force-pushed the fweinberger/v2-docs-logging-elicitation branch from 01a76c4 to 99299f2 Compare August 18, 2026 14:08
Comment thread examples/guides/servers/elicitation.examples.ts Outdated
Comment thread docs/servers/elicitation.md Outdated
@claude claude Bot added the v2 Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes label Aug 18, 2026
…ication

Add "Let the client set the level" to the logging page (setLoggingLevel,
the auto-installed logging/setLevel handler, filtered output) and "Signal
that the URL flow finished" to the elicitation page
(createElicitationCompletionNotifier + the client-side wait on
notifications/elicitation/complete). Both companions run the new rounds
and assert the quoted output.
… alpha.11 referee

Register the client-side json-schema-2020-12-preservation scenario in the
everything client (tools/list, then echo the observed inputSchema through
json_schema_echo; modern lifecycle under a 2026-07-28 run), bump
@modelcontextprotocol/conformance 0.2.0-alpha.10 -> 0.2.0-alpha.11 and
record the reconciliation in both expected-failures baselines. All four
legs pass with no new entries.
@felixweinberger
felixweinberger force-pushed the fweinberger/v2-docs-logging-elicitation branch from 99299f2 to 49b9cad Compare August 18, 2026 14:44

@claude claude Bot 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.

LGTM — the latest push addresses all of my earlier feedback and this run found no new issues.

What was reviewed:

  • Confirmed the elicitation doc/example now raises the elicitInput timeout, forwards ctx.mcpReq.signal, handles client-side cancellation (abort listener cleans up the finished map), raises the host's tools/call timeout, and replaces the unbounded polling with a bounded waitFor that throws — all four prior comments resolved.
  • Checked doc claims against the SDK: createElicitationCompletionNotifier(elicitationId, options?) matches packages/server/src/server/server.ts:1249, and the 2025-11-25-only note matches the changelog's wire-registry removal for 2026-07-28.
  • Read the logging section and its self-verifying harness (delivered-level assertion), the new json-schema-2020-12-preservation conformance driver, the alpha.11 pin/lockfile, and both expected-failures reconciliations — consistent, test-harness-only changes with no runtime SDK code touched.
Extended reasoning...

Overview

The PR touches docs and test infrastructure only: two guide pages (docs/servers/elicitation.md, docs/servers/logging-progress-cancellation.md) plus their type-checked .examples.ts companions under examples/guides/servers/, and a conformance-harness update (test/conformance/package.json pin bump to @ modelcontextprotocol/conformance@ 0.2.0-alpha.11, lockfile, a new json-schema-2020-12-preservation scenario in everythingClient.ts, and reconciled expected-failures*.yaml headers). No package under packages/ changes, so nothing ships to consumers beyond documentation.

Security risks

None. There is no runtime code, no auth/crypto/permission path, and no new dependency in the workspace packages — the lockfile change is confined to the conformance referee's own dependency tree (ajv 8.20.0 for the referee only, per the lockfile diff). The doc snippets model good practice (signal forwarding, cleanup on abort) rather than introducing risk.

Level of scrutiny

Moderate scrutiny was appropriate because doc snippets here are load-bearing: they sync into the guide pages and run in CI as self-verifying examples, and the previous two review rounds found real problems in exactly this material (missing timeouts, missing signal forwarding, leak-prone client handler, unbounded polling). I re-read the current diff against each prior finding and confirmed every one is fixed in the pushed commits: { timeout: 10 * 60_000, signal: ctx.mcpReq.signal } on elicitInput, an abort listener that deletes the finished entry and resolves cancelled, a { timeout: 10 * 60_000 } on the host's callTool, and a bounded waitFor (400 × 5 ms, throws a diagnostic) replacing the infinite loops. I also verified the documented API surface exists as described (createElicitationCompletionNotifier signature in server.ts, the 2025-11-25-only availability matching the changelog's wire-registry note, and the setLoggingLevel/logging/setLevel claim backed by the harness assertion that only warning is delivered).

Other factors

The bug hunt ran to dry_streak with zero findings this run. The examples are executed in CI (pnpm docs:examples) and assert the exact quoted output, so the pages' behavioral claims are machine-checked rather than prose-only. The conformance changes follow the convention stated in the YAML headers (bump the pin and reconcile baselines in the same change), the new scenario mirrors the existing scenario structure in everythingClient.ts (including the modern-lifecycle branch), and no baseline entries were added or removed. No outstanding third-party objections exist in the timeline — the only inline comments were my own, now addressed by the new commits — so approval is safe.

@felixweinberger
felixweinberger merged commit a81ef34 into main Aug 18, 2026
20 checks passed
@felixweinberger
felixweinberger deleted the fweinberger/v2-docs-logging-elicitation branch August 18, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant