Skip to content

fix(site): prevent MCP subscription timeouts - #3596

Merged
diegomura merged 1 commit into
masterfrom
codex/fix-mcp-subscription-timeouts
Oct 20, 2026
Merged

diegomura merged 1 commit into
masterfrom
codex/fix-mcp-subscription-timeouts

Conversation

@diegomura

Copy link
Copy Markdown
Owner

Problem

MCP subscriptions/listen requests return 200 and hold a notification stream open until Vercel's 10-second timeout. A live request reproduced this at approximately 10.5 seconds. The SDK advertises tool-list changes by default, although this site's documentation tools do not change during an invocation.

Change

Disable the tools.listChanged capability and set maxSubscriptions: 0 so subscription attempts receive an immediate JSON error. Keep normal MCP tool calls and legacy protocol support unchanged.

Validation

  • Five regression tests pass, covering capability discovery, subscription rejection, legacy tool listing, searches, and GET rejection. The first two tests failed before the fix.
  • Site TypeScript check passes after generating Next.js route types.
  • Run tests from apps/site with Node 22: node ../../node_modules/vitest/vitest.mjs run --root . --config ../../vitest.config.js 'app/api/mcp/[transport]/route.test.ts'.

Production logs identify Copilot CLI among timed-out requests but do not expose their MCP method. After deployment, verify that /mcp timeout rate and billed duration fall; this reproduces and fixes the subscription timeout, but does not establish that every observed timeout had that cause.

@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
react-pdf Error Error Oct 20, 2026 10:19pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Oct 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 20d350d

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

@diegomura
diegomura merged commit 3cdb86d into master Oct 20, 2026
3 of 17 checks passed
@diegomura
diegomura deleted the codex/fix-mcp-subscription-timeouts branch October 20, 2026 22:26

This branch had an error being deployed

1 failed deployment
Preview — 20d350d1 Deployed Oct 20, 2026 by vercel[bot]
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