Skip to content

test(mcp): Add Canary E2E tests to catch API drifts - #27135

Open
logaretm wants to merge 3 commits into
awad/js-4221-addfeedbacktool-turns-an-aborted-fetch-into-cannot-set-propertyfrom
awad/mcp-e2e-sdk-canary
Open

logaretm wants to merge 3 commits into
awad/js-4221-addfeedbacktool-turns-an-aborted-fetch-into-cannot-set-propertyfrom
awad/mcp-e2e-sdk-canary

Conversation

@logaretm

@logaretm logaretm commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

This PR adds 3 E2E canary variants covering the MCP v1, v2 and cloudflare implementations with Canary variants to make sure we catch any API drifts that may happen.

We already have a drift caught that fails in a direct API call:

server.registerTool(feedbackTool.name, feedbackTool.config, feedbackTool.handler);
// error TS2769: 'FeedbackToolResult' is not assignable to
//   'ToolErrorResult | ToolResultWithStructuredContent<{ feedbackId: string }> | InputRequiredResult'

This PR also fixes that by following the more stricter type required by the new canary releases.

// Before, optional properties

export interface FeedbackToolResult {
  content: Array<{ type: 'text'; text: string }>;
  structuredContent?: { feedbackId: string }; // optional
  isError?: boolean;                          // optional
  [key: string]: unknown;
}

// After, two objects with a discriminator on `isError`

interface FeedbackToolResultBase {
  content: Array<{ type: 'text'; text: string }>;
  // MCP SDKs type tool results with an index signature, so a handler without one is not assignable.
  [key: string]: unknown;
}

export type FeedbackToolResult =
  | (FeedbackToolResultBase & { isError: true })
  | (FeedbackToolResultBase & { isError?: false; structuredContent: { feedbackId: string } });

@logaretm
logaretm added this pull request to stack #27136 December 3, 2026 15:51
@logaretm logaretm changed the title awad/mcp e2e sdk canary fix(mcp): Match MCP SDK v2's stricter tool result types, caught by a new nightly canary Dec 3, 2026
@logaretm logaretm changed the title fix(mcp): Match MCP SDK v2's stricter tool result types, caught by a new nightly canary test(mcp): Add Canary E2E tests to catch API drifts Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: d79f56a (PR test merge using base PR #27132 at 9e0980e)

Against: 9e0980e (base PR #27132) · base run #68756

✅ Baseline matches: this diff contains only this PR's changes.

Path Size % Change Change
@sentry/browser 30.73 kB - -
@sentry/browser - with treeshaking flags 28.85 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.7 kB - -
@sentry/browser (incl. Tracing) 54.07 kB - -
@sentry/browser (incl. Tracing Core) 40.89 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 54.08 kB - -
@sentry/browser (incl. Tracing, Profiling) 56.97 kB - -
@sentry/browser (incl. Tracing, Replay) 94.06 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 82.59 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 98.9 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 111.85 kB - -
@sentry/browser (incl. Feedback) 48.59 kB - -
@sentry/browser (incl. sendFeedback) 31.29 kB - -
@sentry/browser (incl. FeedbackAsync) 36.34 kB - -
@sentry/browser (incl. Metrics) 32.04 kB - -
@sentry/browser (incl. Logs) 32.32 kB - -
@sentry/browser (incl. Metrics & Logs) 33 kB - -
@sentry/react 32.61 kB - -
@sentry/react (incl. Tracing) 56.57 kB - -
@sentry/vue 39.07 kB - -
@sentry/vue (incl. Tracing) 57.19 kB - -
@sentry/svelte 30.77 kB - -
@sentry/effect (client) 42.29 kB - -
@sentry/effect (client, incl. Tracing) 55.1 kB - -
@sentry/effect (client, incl. Tracing, Logs, Metrics) 66.59 kB - -
@sentry/remix (Remix 3 client bundle) 59.55 kB - -
CDN Bundle 32.54 kB - -
CDN Bundle (incl. Tracing) 54.17 kB - -
CDN Bundle (incl. Logs, Metrics) 35.25 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 56.63 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 76.2 kB - -
CDN Bundle (incl. Tracing, Replay) 91.98 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 94.49 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 97.44 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 99.89 kB - -
CDN Bundle - uncompressed 94.94 kB - -
CDN Bundle (incl. Tracing) - uncompressed 160.29 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 103.28 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 167.92 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 233.67 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 280.72 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 288.35 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 292.65 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 300.27 kB - -
@sentry/nextjs (client) 59.93 kB - -
@sentry/sveltekit (client) 54.89 kB - -
@sentry/astro (client) - rolldown, without tracing 35.83 kB +0.01% +2 B 🔺
@sentry/core/server 45.96 kB - -
@sentry/core/browser 14.55 kB - -
@sentry/node 157.76 kB - -
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.63 kB - -
@sentry/node - without tracing 89.74 kB -0.01% -5 B 🔽
@sentry/node - without channel injection 147.11 kB - -
@sentry/aws-serverless 100.65 kB - -
@sentry/cloudflare (withSentry) - minified 213.32 kB - -
@sentry/cloudflare (withSentry) 495.18 kB - -
@sentry/cloudflare (withSentry, instrumented CommonJS package) - minified 216.26 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 241.52 kB - -

View base workflow run

@logaretm
logaretm force-pushed the awad/mcp-e2e-sdk-canary branch from df8221c to c1a3672 Compare December 3, 2026 15:57
@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Optional E2E tests

Some optional checks were not successful. They do not block the merge. 1 not successful, 64 successful. See the run.

Check Status
❌ CI: Optional E2E Tests / E2E cloudflare-flue-send-to-sentry Test (optional) Failing after 4m Details
Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E astro-7 (static trace lifecycle) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E debug-id-sourcemaps Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-workers-without-tracing-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-think (ai v6) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E hono-5 (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry (static trace lifecycle) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps (manual upload) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E hapi-21 (bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E astro-7 Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-agent Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E hapi-21 (deno) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E hono-5 Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-eve (content off) Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E deno (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E hono-5 (deno) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-mastra (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-workers-send-to-sentry Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (deno) Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (development) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (kv-cache) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v1 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E vinext-cf-workers (workers cache) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-14-supabase Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E node-flue (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps (no upload) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (no upload) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-eve (orchestrion) Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E hono-5 (bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-tunnel (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E solidstart-2-tunnel Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (bun) Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (cloudflare) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E solidstart-2 (delete all) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-4-sourcemaps (Vite server) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-tunnel Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps (delete all) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 (MCP SDK OpenTelemetry) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-eve (0.x) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E solidstart-2 (manual upload) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-pi-durable (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps enabled by Sentry) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E react-send-to-sentry Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E solidstart-2 (no upload) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E vue-3 (no Options API) Test (optional) Successful in 2m Details

@logaretm
logaretm force-pushed the awad/mcp-e2e-sdk-canary branch from c1a3672 to 5bc9b75 Compare December 3, 2026 15:58
@logaretm
logaretm marked this pull request as ready for review December 3, 2026 15:58
@logaretm
logaretm requested a review from nicohrubec December 3, 2026 15:59
@logaretm
logaretm force-pushed the awad/mcp-e2e-sdk-canary branch 2 times, most recently from 579ca0f to d5d92ff Compare December 3, 2026 16:15
@logaretm
logaretm force-pushed the awad/mcp-e2e-sdk-canary branch from d5d92ff to 49767f8 Compare December 3, 2026 16:17
Adds a canary variant to the v1 and v2 Express apps and the Cloudflare McpAgent app, so a change in the MCP SDKs or agents that breaks the feedback hint shows up before a release does. Each app also gets one failing tool per hint path: a thrown DOMException, a returned error result and an output schema failure.
… structured content

MCP SDK v2 main only accepts a handler for a tool with an outputSchema if every success carries structuredContent and every error sets isError: true, so createFeedbackTool's handler no longer type-checked against it.

This branch has not been deployed

No deployments
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