Skip to content

Rewrite docs/client.md as a code-heavy, prose-light how-to guide#1551

Open
jonathanhefner wants to merge 2 commits intomodelcontextprotocol:mainfrom
jonathanhefner:client-how-to
Open

Rewrite docs/client.md as a code-heavy, prose-light how-to guide#1551
jonathanhefner wants to merge 2 commits intomodelcontextprotocol:mainfrom
jonathanhefner:client-how-to

Conversation

@jonathanhefner
Copy link
Member

@jonathanhefner jonathanhefner commented Feb 17, 2026

Restructure the document: action-oriented H1, Imports section, section-opener concept links to the MCP overview docs (not the specification), inline example-file references instead of > [!NOTE] callouts, and a trailing "See also" section with cross-links plus an "Additional examples" table.

New sections: Imports, Disconnecting (terminateSession() + close()), Subscribing to resource changes (subscribeResource/unsubscribeResource), Roots (roots/list handler, sendRootsListChanged()), Error handling (tool errors vs protocol errors, connection lifecycle callbacks, timeouts), and setLoggingLevel() folded into Notifications.

All new code examples are type-checked regions in clientGuide.examples.ts and synced via pnpm sync:snippets.

@changeset-bot
Copy link

changeset-bot bot commented Feb 17, 2026

⚠️ No Changeset found

Latest commit: 747c838

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
Copy link

pkg-pr-new bot commented Feb 17, 2026

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/client@1551

@modelcontextprotocol/server

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server@1551

@modelcontextprotocol/express

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/express@1551

@modelcontextprotocol/hono

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/hono@1551

@modelcontextprotocol/node

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/node@1551

commit: 747c838

jonathanhefner and others added 2 commits February 18, 2026 13:39
Restructure the document: action-oriented H1, Imports section,
section-opener concept links to the MCP overview docs (not the
specification), inline example-file references instead of `> [!NOTE]`
callouts, and a trailing "See also" section with cross-links plus an
"Additional examples" table.

New sections: Imports, Disconnecting (`terminateSession()` + `close()`),
Subscribing to resource changes
(`subscribeResource`/`unsubscribeResource`), Roots (`roots/list`
handler, `sendRootsListChanged()`), Error handling (tool errors vs
protocol errors, connection lifecycle callbacks, timeouts), and
`setLoggingLevel()` folded into Notifications.

All new code examples are type-checked regions in
`clientGuide.examples.ts` and synced via `pnpm sync:snippets`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Expand the client guide with four new topics and their companion
`.examples.ts` snippets:

- Server instructions: retrieving `getInstructions()` and folding it
  into a system prompt
- Pagination: `listTools()`, `listResources()`, and `listPrompts()`
  examples now loop on `nextCursor` to collect all pages
- Structured tool output: `structuredContent` for machine-readable
  results alongside LLM-facing `content`
- Progress tracking: `onprogress`, `resetTimeoutOnProgress`, and
  `maxTotalTimeout` options for long-running tool calls

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jonathanhefner jonathanhefner marked this pull request as ready for review February 18, 2026 20:47
@jonathanhefner jonathanhefner requested a review from a team as a code owner February 18, 2026 20:47
@jonathanhefner jonathanhefner enabled auto-merge (squash) February 18, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments