Skip to content

docs: cover tool content types, prompt image content, elicitation defaults, ping, legacy SSE serving - #2679

Merged
felixweinberger merged 5 commits into
mainfrom
fweinberger/v2-docs-gaps
Aug 18, 2026
Merged

docs: cover tool content types, prompt image content, elicitation defaults, ping, legacy SSE serving#2679
felixweinberger merged 5 commits into
mainfrom
fweinberger/v2-docs-gaps

Conversation

@felixweinberger

Copy link
Copy Markdown
Contributor

Documents the last non-experimental features missing from the v2 guide site: tool results with image / audio / embedded resource content, prompt messages with image content, elicitation default values, ping, and serving the frozen SSEServerTransport from @modelcontextprotocol/server-legacy/sse.

Motivation and Context

The SEP-1730 documentation check for v2 came back 41/48: these seven features had no page or no example on main (v1.x's docs/protocol.md covered ping and content types; the v2 site did not). Each addition is a short section on the existing page with a synced, executed companion example.

How Has This Been Tested?

pnpm sync:snippets --check, pnpm --filter @modelcontextprotocol/examples typecheck, pnpm docs:examples (37 run / 0 failed — every quoted output block is real companion output), pnpm docs:build.

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

The SSE serving snippet adds @modelcontextprotocol/server-legacy as a workspace dependency of examples/ (plus a tsconfig path mapping) so the companion typechecks against source like the other packages.

…aults, ping, legacy SSE serving

No-Verification-Needed: docs and guide-companion examples only
@felixweinberger
felixweinberger requested a review from a team as a code owner August 17, 2026 18:14
@changeset-bot

changeset-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c5fcd34

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 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

@modelcontextprotocol/client

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

@modelcontextprotocol/codemod

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

@modelcontextprotocol/core

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

@modelcontextprotocol/server

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

@modelcontextprotocol/server-legacy

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

@modelcontextprotocol/express

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

@modelcontextprotocol/fastify

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

@modelcontextprotocol/hono

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

@modelcontextprotocol/node

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

commit: c5fcd34

Comment thread examples/guides/serving/legacy-clients.examples.ts Outdated
Comment thread examples/guides/serving/legacy-clients.examples.ts Outdated
Comment thread examples/guides/servers/tools.examples.ts Outdated
… Express options

No-Verification-Needed: docs and guide-companion examples only
Comment thread examples/guides/serving/legacy-clients.examples.ts Outdated
…bare host

No-Verification-Needed: docs and guide-companion examples only

@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 one new inline note, this round re-verified that the fixes from the earlier reviews all landed (400 vs 404 branching on sessionId, allowedHosts + jsonLimit: '4mb' on the SSE app, encodeURIComponent in the embedded-resource URI) and spot-checked the new factual claims: ping is present in the 2025-11-25 spec types and absent from 2026-07-28, matching the new protocol-versions row, and the elicitation.form.applyDefaults flag the docs describe exists in packages/client/src/client/client.ts.

Extended reasoning...

This is a findings-present run with one new minor [quality] inline comment (missing self-verification in the doc-quoted harness rounds). Rather than restate it, the body records what else was concretely checked this round: all three prior-round findings were confirmed fixed in the current HEAD of examples/guides/serving/legacy-clients.examples.ts, docs/serving/legacy-clients.md, and examples/guides/servers/tools.examples.ts, and the two most checkable new factual claims (the ping era-table row against the 2025 vs 2026 spec type files, and the client-side applyDefaults capability flag) were verified against the source. Not approving because a quality finding is being posted this run and the repo's CODEOWNERS assigns all paths to a team owner, so a human pass is expected regardless.

Comment thread examples/guides/servers/elicitation.examples.ts
No-Verification-Needed: docs and guide-companion examples only

@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 — all points from the earlier review rounds are now addressed, and this run over the latest push found no new issues.

What was reviewed: confirmed the SSE example now splits 400 (missing sessionId) from 404 (unknown session), passes { host: '0.0.0.0', allowedHosts, jsonLimit: '4mb' } (and jsonLimit is a real createMcpExpressApp option), and the docs prose matches; confirmed the embedded-resource URI now uses encodeURIComponent with the quoted output updated to Travel%20mug; confirmed the four new harness rounds (ping, elicitation defaults, prompt image, tool content types) assert the exact output the pages quote and throw on mismatch; checked the examples/ package.json / tsconfig / lockfile plumbing for the server-legacy workspace link — consistent with the existing path-mapping pattern.

Extended reasoning...

Overview

Docs-only PR: five guide pages gain short sections (client ping, elicitation default + applyDefaults, prompt image content, mixed tool content blocks, mounting the frozen v1 SSEServerTransport on Express), each backed by new //#region blocks in the corresponding examples/guides/*.examples.ts companion, plus a one-row addition to the docs/protocol-versions.md era table and workspace plumbing (examples/package.json, examples/tsconfig.json, pnpm-lock.yaml) for the @ modelcontextprotocol/server-legacy dependency. No package source code changes.

Security risks

The only security-relevant surface is the copy-paste SSE mounting recipe, which earlier rounds of this review flagged (bare host value silently disabling Host/Origin validation, conflated 400/404 session handling, 100kb body cap). Commits 465dc34 and 472c0ce fixed all three: the example now uses { host: '0.0.0.0', allowedHosts: ['sse.example.com'], jsonLimit: '4mb' } matching the express.md recipe, and the POST route branches typeof sessionId !== 'string' → 400 before the map lookup → 404, exactly per the Recurring Catches rule (#1707/#1770). I verified jsonLimit is a real option in packages/middleware/express/src/express.ts. No other injection/auth/data-exposure surface exists in a docs diff.

Level of scrutiny

Moderate scrutiny was appropriate because documented recipes get copied verbatim into deployments, and three prior review rounds applied it — every finding was fixed in a follow-up commit, and the final push (aabf3c4) added the missing self-verification assertions so pnpm docs:examples now fails if any quoted output rots (ping {}, Exported quarterly-sales as pdf., image mimeType, image,audio,resource block order). The bug hunt on the latest push ran dry with zero findings and zero ruled-out candidates.

Other factors

The companions are typechecked and executed in CI (docs:examples gate), the fence bodies match their regions in the diff, and the URI-encoding fix is reflected in the quoted output (catalog://products/Travel%20mug). CODEOWNERS only has a repo-wide default team plus auth-path entries that this diff does not touch. No unresolved third-party objections appear in the timeline — the only review activity is this bot's own, and every raised item is verifiably fixed in the code. Given the docs-only scope, self-verifying CI coverage, and the completed feedback loop, I have high confidence no human needs to re-review this.

@felixweinberger
felixweinberger merged commit 6852368 into main Aug 18, 2026
19 checks passed
@felixweinberger
felixweinberger deleted the fweinberger/v2-docs-gaps branch August 18, 2026 12:42

@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 — all feedback from the earlier review rounds has been addressed, and a fresh pass over the current diff found no new issues.

What was reviewed: the reworked SSE mounting example now branches 400 (missing sessionId) vs 404 (unknown session), uses host: '0.0.0.0' with allowedHosts per the express.md recipe, and raises jsonLimit to the transport's 4mb; the embedded-resource URI now uses encodeURIComponent (docs quote Travel%20mug); each new doc-quoted round (ping, applyDefaults, prompt image, product-card content types) now has a throwing assertion so pnpm docs:examples catches drift; fenced code in all five pages byte-matches the companion //#region blocks, and the new ping era row lives only in the protocol-versions table.

Extended reasoning...

Overview

This is a docs-only PR: five new guide sections (client ping, elicitation default/applyDefaults, prompt image content, mixed tool content blocks, legacy SSEServerTransport Express mounting) with matching type-checked companion snippets under examples/guides/, plus plumbing (examples/package.json, examples/tsconfig.json, pnpm-lock.yaml) to let the companions typecheck against @ modelcontextprotocol/server-legacy. No SDK source, transport, or auth code is touched.

Security risks

The only security-relevant surface is the documented SSE deployment recipe, which earlier rounds of this review flagged twice (Host/Origin validation silently disabled by a bare non-localhost host value; body-parser limit below the transport's 4mb). The current code fixes both: createMcpExpressApp({ host: '0.0.0.0', allowedHosts: ['sse.example.com'], jsonLimit: '4mb' }) matches the repo's own express.md recipe and the accompanying prose explains why. The session routing now distinguishes 400 (missing param) from 404 (unknown session), satisfying the REVIEW.md recurring catch for HTTP transports. Nothing else in the diff executes at runtime outside CI.

Level of scrutiny

This PR received four full review rounds already; each finding was fixed by a follow-up commit visible in the current diff. This run's bug hunt exited on a dry streak with zero findings and zero ruled-out candidates. I re-read the entire diff and verified every previously raised item against the current code rather than trusting thread resolutions (which were bot-session resolutions). With all findings demonstrably closed in code and the change confined to docs plus self-verifying, CI-executed examples, remaining risk is low enough that a human pass is not required.

Other factors

The companions are executed by pnpm docs:examples in CI and now assert every quoted output (ping {}, applyDefaults producing 'Exported quarterly-sales as pdf.', the image block round-trip, the image/audio/resource block sequence), so documentation drift will fail CI rather than rot silently. The era-difference claim for ping was added to the single canonical table in docs/protocol-versions.md rather than duplicated, per that file's stated convention. The workspace-dependency and tsconfig path additions follow the existing pattern for sibling packages exactly.

@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
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