Skip to content

Add JSDoc @example tags with companion .examples.ts files#1524

Merged
jonathanhefner merged 2 commits intomodelcontextprotocol:mainfrom
jonathanhefner:jsdoc-server-package-examples
Feb 13, 2026
Merged

Add JSDoc @example tags with companion .examples.ts files#1524
jonathanhefner merged 2 commits intomodelcontextprotocol:mainfrom
jonathanhefner:jsdoc-server-package-examples

Conversation

@jonathanhefner
Copy link
Member

@jonathanhefner jonathanhefner commented Feb 12, 2026

Create companion .examples.ts files for JSDoc @example tags:

  • mcp.examples.tsMcpServer, registerTool(), registerResource(), registerPrompt(), connect(), sendLoggingMessage(), and tool logging
  • stdio.examples.tsStdioServerTransport
  • completable.examples.tscompletable() shown in prompt context
  • streamableHttp.examples.tsWebStandardStreamableHTTPServerTransport (stateful, stateless, Hono, Workers)
  • node/streamableHttp.examples.tsNodeStreamableHTTPServerTransport (stateful, stateless, Express)

Add @example tags (with titles) to the source files for McpServer, StdioServerTransport, completable(), and both Streamable HTTP transport classes. Prose bullet lists on the transport classes are placed before @example block tags so TypeDoc renders them in the description section.

@changeset-bot
Copy link

changeset-bot bot commented Feb 12, 2026

⚠️ No Changeset found

Latest commit: 6a13930

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

Open in StackBlitz

@modelcontextprotocol/client

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

@modelcontextprotocol/server

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

@modelcontextprotocol/express

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

@modelcontextprotocol/hono

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

@modelcontextprotocol/node

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

commit: 6a13930

Create companion `.examples.ts` files for JSDoc `@example` tags:

- `mcp.examples.ts` — `McpServer`, `registerTool()`,
  `registerResource()`, `registerPrompt()`, `connect()`,
  `sendLoggingMessage()`, and tool logging
- `stdio.examples.ts` — `StdioServerTransport`
- `completable.examples.ts` — `completable()` shown in prompt context
- `streamableHttp.examples.ts` —
  `WebStandardStreamableHTTPServerTransport` (stateful, stateless, Hono,
  Workers)
- `node/streamableHttp.examples.ts` —
  `NodeStreamableHTTPServerTransport` (stateful, stateless, Express)

Add `@example` tags (with titles) to the source files for `McpServer`,
`StdioServerTransport`, `completable()`, and both Streamable HTTP
transport classes. Prose bullet lists on the transport classes are
placed before `@example` block tags so TypeDoc renders them in the
description section.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jonathanhefner jonathanhefner force-pushed the jsdoc-server-package-examples branch from 63b3560 to e6cc919 Compare February 13, 2026 17:16
@jonathanhefner jonathanhefner marked this pull request as ready for review February 13, 2026 17:17
@jonathanhefner jonathanhefner requested a review from a team as a code owner February 13, 2026 17:17
@jonathanhefner jonathanhefner enabled auto-merge (squash) February 13, 2026 17:21
@jonathanhefner jonathanhefner merged commit c9ac842 into modelcontextprotocol:main Feb 13, 2026
16 of 17 checks passed
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