Skip to content

docs: turn the version banners into working cross-site links#2396

Merged
felixweinberger merged 1 commit into
mainfrom
fweinberger/docs-banner
Jun 30, 2026
Merged

docs: turn the version banners into working cross-site links#2396
felixweinberger merged 1 commit into
mainfrom
fweinberger/docs-banner

Conversation

@felixweinberger

Copy link
Copy Markdown
Contributor

The version banners on both doc sites linked the sibling site with a plain same-origin anchor. The VitePress client-side router intercepts same-origin links and resolves them inside the current site — which has no such page — so clicking either banner rendered a client-side 404 (a hard reload then loaded the right site). This adds target="_self", which the router does not intercept, and rewords both banners.

Motivation and Context

Live defect on ts.sdk.modelcontextprotocol.io after #2395: the banner cross-links 404 in both directions until the page is reloaded.

How Has This Been Tested?

  • Root cause confirmed in the shipped router (vitepress/dist/client/app/router.js skips links with a target attribute).
  • pnpm docs:build green; the rendered banner anchor carries target="_self" and the new copy.

Breaking Changes

None — docs site only.

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

Banner copy is now "Looking for the v1 documentation?" on the v2 site and "Looking for the v2 beta documentation?" on the v1 site, with the destination as the underlined link.

The VitePress client router intercepts same-origin anchors and resolves them
inside the current site, so the banners' absolute URLs rendered the client-side
404 in production (a hard reload then loaded the right site). A target
attribute opts a link out of interception, so navigation is a real page load.
Reword both banners to a one-line question with the destination as the link.
@felixweinberger felixweinberger requested a review from a team as a code owner June 30, 2026 15:22
@changeset-bot

changeset-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: fbe4285

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 Jun 30, 2026

Copy link
Copy Markdown

Open in StackBlitz

@modelcontextprotocol/client

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

@modelcontextprotocol/codemod

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

@modelcontextprotocol/core

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

@modelcontextprotocol/server

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

@modelcontextprotocol/server-legacy

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

@modelcontextprotocol/express

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

@modelcontextprotocol/fastify

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

@modelcontextprotocol/hono

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

@modelcontextprotocol/node

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

commit: fbe4285

@pkg-pr-new

pkg-pr-new Bot commented Jun 30, 2026

Copy link
Copy Markdown

Open in StackBlitz

@modelcontextprotocol/client

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

@modelcontextprotocol/codemod

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

@modelcontextprotocol/core

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

@modelcontextprotocol/server

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

@modelcontextprotocol/server-legacy

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

@modelcontextprotocol/express

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

@modelcontextprotocol/fastify

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

@modelcontextprotocol/hono

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

@modelcontextprotocol/node

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

commit: fbe4285

@felixweinberger felixweinberger merged commit 708d545 into main Jun 30, 2026
19 checks passed
@felixweinberger felixweinberger deleted the fweinberger/docs-banner branch June 30, 2026 15:28

@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 — docs-only banner fix; target="_self" correctly bypasses the VitePress SPA router so the cross-site links resolve with a full navigation.

Extended reasoning...

Overview

This PR touches only two Vue SFC banner components under docs/.vitepress/theme/ and docs/v1/.vitepress/theme/. Each change adds target="_self" to the cross-site anchor and rewords the banner copy. No SDK source, build config, or workflow files are affected.

Correctness of the fix

The root-cause claim checks out: VitePress 1.x (the repo pins vitepress@^1.6.4) intercepts same-origin anchor clicks in its client router only when the link has no target attribute, so target="_self" opts the link out of SPA navigation and forces a full page load — which is exactly what's needed since the v1 and v2 docs are separately built sites sharing one origin. The link destinations are unchanged from the previous banner text (v1 root and /v2/), so there is no behavioral risk beyond the intended hard navigation.

Security risks

None. The links are static, hard-coded, same-origin HTTPS URLs in documentation templates; no user input, scripts, or external targets are involved.

Level of scrutiny

Low — this is a two-line, docs-site-only presentational fix with no impact on the published packages, the protocol implementation, or CI. The changeset-bot warning about a missing changeset is expected since docs changes do not version any package.

Other factors

No bugs were found by the bug-hunting pass, there are no outstanding reviewer comments, and the change is small, self-contained, and clearly motivated by a live defect introduced in #2395.

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.

1 participant