Skip to content

chore(deps): upgrade dev dependencies - #80

Merged
koistya merged 4 commits into
mainfrom
chore/upgrade-deps
Nov 1, 2026
Merged

koistya merged 4 commits into
mainfrom
chore/upgrade-deps

Conversation

@koistya

@koistya koistya commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Upgrades all dev dependencies to latest and raises the MCP SDK peer floor to 2.3. Supersedes Dependabot #77, #76, #64, #49 and #48. Also fixes a browserAuth() regression that MCP SDK 2.3 introduced.

Package From To
@modelcontextprotocol/client / server 2.2.0 2.4.0
typescript 5.9.3 7.0.2
@types/node 25.0.10 22.20.5
mermaid 11.12.2 12.2.0
vitepress 2.0.0-alpha.20 2.0.0-alpha.21
vitepress-plugin-llms 1.10 1.14
@types/bun, bun-types 1.4.2 1.4.4
@types/deno 2.5 2.7
prettier 3.9.6 3.9.10
publint 0.3.24 0.3.25
actions/setup-node (release.yml pin) v7.0.0 v7.1.0
  • Peer @modelcontextprotocol/client ^2.2.0 → ^2.3.0: earlier 2.x clients forward headers and request bodies, refresh tokens included, across origins on redirect (GHSA-6prh-2h8m-c8cw). The docs and ADR-006 now say 2.3+.
  • @types/node follows the oldest supported Node (engines: >=22), so APIs newer than that fail typecheck. Dependabot ignores its majors.
  • TypeScript 7: dist/ is byte-identical to the build on main, .d.ts files included.
  • Mermaid 12: vitepress-plugin-mermaid declares a peer range of mermaid 10 || 11. It only calls initialize, render and registerExternalDiagrams, which Mermaid 12 still exports, and both diagram pages render.

Version 3.2.0: minor, because installs still on SDK 2.2 now hit a peer conflict. The release also ships #78 and #79, merged since v3.1.1.

Redirected MCP traffic fix

MCP SDK 2.3 follows same-origin redirects itself, calling the transport's fetch once per hop. The fetch that connect() installs makes OAuth requests abort on credential invalidation, but leaves MCP requests alone. It recognized MCP traffic only by an exact serverUrl match. So when a server redirects /mcp → /mcp/, every invalidation, or the start of an interactive exchange, aborted in-flight MCP requests such as a pending tool call.

Each transport now learns the redirect targets of its MCP responses. It learns only those the SDK follows: followableRedirect() mirrors fetchWithinOrigin, and nothing is learned when transportOptions leave redirects to fetch (redirectPolicy: "follow", requestInit.redirect: "manual" | "error"). Otherwise a refused redirect could mark an OAuth endpoint as MCP traffic. The refresh-during-exchange guard now runs before the MCP check.

if (mcpUrls.has(href)) {
  const response = await base(url, init);
  const target = sdkFollows && followableRedirect(href, init, response);
  if (target) mcpUrls.add(target);
  return response;
}

Accepted limitation, recorded in ADR-006: a server that redirects its MCP endpoint to its own OAuth endpoint takes that endpoint's requests out of cancellation. Token saves stay generation-checked.

Verification

  • bun run validate (format, typecheck, 182 tests, build, publint), also with MCP SDK 2.3.0, the new peer minimum
  • bun run test:runtimes (Node, Deno, Bun)
  • bun run docs:build, plus a headless Chrome render of the Mermaid pages
  • A real-SDK test (/mcp 307 → /mcp/, invalidateCredentials("tokens" | "all") while a tool call is running) fails without the fix and passes with it. test/followable-redirect.test.ts covers the redirect rules case by case.

MCP SDK 2.3 follows same-origin redirects itself, calling the transport's
fetch once per hop. A redirected MCP request (e.g. /mcp -> /mcp/) no longer
matched serverUrl, so it inherited the OAuth abort signals: any credential
invalidation or interactive exchange aborted in-flight MCP requests.
Redirect targets learned from MCP responses now count as MCP traffic.
@koistya
koistya force-pushed the chore/upgrade-deps branch from 3d3b0de to 54c37d4 Compare November 1, 2026 13:25
MCP SDK 2.4, TypeScript 7, Mermaid 12, VitePress alpha.21, and
setup-node 7.1.0 in the release workflow. Supersedes the open Dependabot
PRs. The built package is byte-identical.

The MCP SDK peer floor rises to 2.3: earlier 2.x clients forward headers
and request bodies, refresh tokens included, across origins on redirect
(GHSA-6prh-2h8m-c8cw). @types/node moves to 22, the oldest supported
Node, so APIs newer than the engines floor fail typecheck.
Learning any Location let a refused redirect (cross-origin, POST turned
into GET) mark an OAuth endpoint as MCP traffic, exempting its requests
from cancellation and the refresh-during-exchange guard. Nothing is
learned when transportOptions leave redirects to fetch (redirectPolicy
'follow', requestInit.redirect 'manual' or 'error'). A malformed
Location threw from the fetch wrapper, and parsing avoids URL.parse
(Node 22.1+). The refresh guard now runs first.
@koistya
koistya force-pushed the chore/upgrade-deps branch from 9437e93 to e422011 Compare November 1, 2026 14:06
Minor, not patch: the MCP SDK peer floor rises to 2.3 (security fix), so
installs still on 2.2 now hit a peer conflict. Also ships #78 and #79.
@koistya
koistya merged commit 1837119 into main Nov 1, 2026
10 checks passed
@koistya
koistya deleted the chore/upgrade-deps branch November 1, 2026 14:15
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