Skip to content

Conversation

@jonathanhefner
Copy link
Member

@jonathanhefner jonathanhefner commented Feb 5, 2026

This PR contains 2 somewhat overlapping commits which add the following to JSDoc comments across the code base:

  1. {@linkcode} tags to cross-link code references, both for ease of reference and to catch docs drift (via pnpm run docs:check)
  2. Backticks for better formatting and semantic understanding of non-linkable code references.

The diff is somewhat large, but essentially uniform. The additional lines (404 lines vs 414 lines) are due to extra import statements and // eslint-disable-next-line @typescript-eslint/no-unused-vars comments to allow TypeDoc to reference previously-unimported types in some {@linkcode} tags (i.e., the imports are used by TypeDoc, but eslint doesn't recognize that).

@jonathanhefner jonathanhefner requested a review from a team as a code owner February 5, 2026 17:32
@changeset-bot
Copy link

changeset-bot bot commented Feb 5, 2026

⚠️ No Changeset found

Latest commit: 53a9bca

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

Open in StackBlitz

@modelcontextprotocol/client

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

@modelcontextprotocol/server

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

@modelcontextprotocol/express

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

@modelcontextprotocol/hono

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

@modelcontextprotocol/node

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

commit: 53a9bca

@jonathanhefner jonathanhefner force-pushed the jsdoc-links-and-backticks branch from 067ff0a to 3e75363 Compare February 5, 2026 22:45
import type { ReadableWritablePair } from 'node:stream/web';

import type { FetchLike, JSONRPCMessage, Transport } from '@modelcontextprotocol/core';
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Protocol used in JSDoc {@link}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no other way than peppering the code with these linter overrides? If they're not being used in this file, is this the right place to document them?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add explicit module paths for those links. I've added a commit to do that.

* @param resultSchema - Zod schema for validating the result (defaults to {@linkcode CallToolResultSchema})
* @param options - Optional request options (timeout, signal, task creation params, etc.)
* @returns AsyncGenerator that yields ResponseMessage objects
* @returns AsyncGenerator that yields {@linkcode ResponseMessage} objects
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General question: how do these comments stay up to date? Is this checked as part of the CI pipeline that all these comments are correct and still linked to the right places?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TypeDoc emits warnings for broken links, but we can turn those warnings into errors and check in CI: #1522

jonathanhefner and others added 3 commits February 10, 2026 18:10
Replace plain text and backtick-quoted symbol references in JSDoc
comments with proper `{@linkcode}` tags for TypeDoc. This makes class
names, function names, and other symbols clickable in the generated API
documentation.

Also adds type-only imports with ESLint disable comments for symbols
that are only referenced in JSDoc `{@link}` tags.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Wrap code identifiers in backticks throughout JSDoc documentation for
consistency. This includes parameter names, variable names, HTTP
headers, OAuth grant types, URL paths, and string literals.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use `index.` prefix in `{@linkcode}` tags to reference symbols via the
package index re-exports, eliminating the need for unused imports and
their eslint-disable comments.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jonathanhefner jonathanhefner force-pushed the jsdoc-links-and-backticks branch from 3e75363 to 53a9bca Compare February 11, 2026 00:11
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