Skip to content

test(e2e): Add MCP auto-instrumentation e2e apps - #24531

Open
mydea wants to merge 2 commits into
feat/mcp-server-auto-instrumentationfrom
feat/mcp-server-auto-instrumentation-e2e
Open

mydea wants to merge 2 commits into
feat/mcp-server-auto-instrumentationfrom
feat/mcp-server-auto-instrumentation-e2e

Conversation

@mydea

@mydea mydea commented Sep 21, 2026

Copy link
Copy Markdown
Member

Stacked on #24529.

Adds two Express e2e apps that construct an McpServer without calling wrapMcpServerWithSentry, so the mcpServer integration from #24529 is the only thing producing spans — over a real streamable-HTTP transport rather than the in-memory one used by the node-integration-tests:

  • node-express-mcp-v1@modelcontextprotocol/sdk (v1)
  • node-express-mcp-v2@modelcontextprotocol/server (v2)

Each asserts the expected mcp.server spans (initialize, tool call, resource read, error status) still appear with no manual wrap. Express is the existing convention for the sibling MCP e2e apps; MCP itself doesn't require it.

node-express-mcp-v2 replaces the previous manual-wrap app of that name — now that auto-instrumentation is the default path, these apps drop the interim -auto suffix and exercise the default. Manual-wrap e2e coverage remains via cloudflare-mcp (v2), cloudflare-mcp-agent (v1), and the v1 node-express* apps.

Bun/Deno/Cloudflare variants (hono-4 multi-entry style) are intentionally deferred to a follow-up — this PR keeps the auto-instrumentation e2e coverage node-only.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.09 kB - -
@sentry/browser - with treeshaking flags 27.35 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.26 kB - -
@sentry/browser (incl. Tracing) 50.56 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 50.58 kB - -
@sentry/browser (incl. Tracing, Profiling) 53.56 kB - -
@sentry/browser (incl. Tracing, Replay) 90.11 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.21 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 94.81 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 107.78 kB - -
@sentry/browser (incl. Feedback) 46.62 kB - -
@sentry/browser (incl. sendFeedback) 34.15 kB - -
@sentry/browser (incl. FeedbackAsync) 39.26 kB - -
@sentry/browser (incl. Metrics) 30.1 kB - -
@sentry/browser (incl. Logs) 30.35 kB - -
@sentry/browser (incl. Metrics & Logs) 31.02 kB - -
@sentry/react 30.84 kB - -
@sentry/react (incl. Tracing) 52.88 kB - -
@sentry/vue 36.34 kB - -
@sentry/vue (incl. Tracing) 52.86 kB - -
@sentry/svelte 29.11 kB - -
CDN Bundle 30.8 kB - -
CDN Bundle (incl. Tracing) 51.1 kB - -
CDN Bundle (incl. Logs, Metrics) 33.06 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.09 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.75 kB - -
CDN Bundle (incl. Tracing, Replay) 88.66 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 90.58 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 94.7 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 96.71 kB - -
CDN Bundle - uncompressed 91.16 kB - -
CDN Bundle (incl. Tracing) - uncompressed 152.53 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.73 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 158.49 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 227.14 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 272.1 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 278.04 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 285.81 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 291.74 kB - -
@sentry/nextjs (client) 55.21 kB - -
@sentry/sveltekit (client) 50.99 kB - -
@sentry/core/server 40.04 kB +0.11% +43 B 🔺
@sentry/core/browser 13.66 kB - -
@sentry/node 138.03 kB +3.54% +4.72 kB 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.25 kB +0.11% +86 B 🔺
@sentry/node - without tracing 90.02 kB +0.13% +111 B 🔺
@sentry/node - without channel injection 116.82 kB +4.18% +4.69 kB 🔺
@sentry/aws-serverless 98.3 kB +0.13% +121 B 🔺
@sentry/cloudflare (withSentry) - minified 204.74 kB - -
@sentry/cloudflare (withSentry) 509.41 kB - -

View base workflow run

@mydea
mydea added this pull request to stack #24534 September 21, 2026 08:30
@mydea
mydea force-pushed the feat/mcp-server-auto-instrumentation-e2e branch from bec2e7d to ea8d457 Compare September 21, 2026 08:39
mydea and others added 2 commits September 21, 2026 10:58
Add two Express e2e apps that construct an `McpServer` WITHOUT calling
`wrapMcpServerWithSentry`, exercising the `mcpServer` integration's
auto-wrapping over a real streamable-HTTP transport:

- `node-express-mcp-v1-auto` (`@modelcontextprotocol/sdk` v1)
- `node-express-mcp-v2-auto` (`@modelcontextprotocol/server` v2)

Both assert the expected `mcp.server` spans (initialize, tool call,
resource read, error status) still appear without a manual wrap.

Bun/Deno/Cloudflare variants are intentionally left as a follow-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the `-auto` suffix now that auto-instrumentation is the default path:
- `node-express-mcp-v1-auto` -> `node-express-mcp-v1`
- `node-express-mcp-v2-auto` -> `node-express-mcp-v2`, replacing the previous
  manual-wrap app of that name (same assertions, now exercising the default
  auto path). Manual-wrap coverage remains via the cloudflare-mcp apps and the
  v1 `node-express*` apps.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mydea
mydea force-pushed the feat/mcp-server-auto-instrumentation-e2e branch from ea8d457 to 59cc528 Compare September 21, 2026 08:58
@mydea mydea changed the title test(e2e): Add MCP auto-instrumentation e2e apps (node) test(e2e): Add MCP auto-instrumentation e2e apps Sep 21, 2026
@mydea
mydea marked this pull request as ready for review September 21, 2026 09:05

@betegon betegon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

great one!

could we keep the existing legacy coverage and add a no-wrapper HTTP scenario pinned to protocol 2026-07-28, using createMcpHandler?

The current SDK 2 scenario still uses the legacy initialization/session path (there's no initialization in v2), so it doesn't verify auto-instrumentation through the v2 entry point

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.

2 participants