Skip to content

Restore MCP request span export on the cloud worker#1410

Merged
RhysSullivan merged 1 commit into
mainfrom
fix/mcp-span-export
Jul 14, 2026
Merged

Restore MCP request span export on the cloud worker#1410
RhysSullivan merged 1 commit into
mainfrom
fix/mcp-span-export

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

Since the Agents-bridge migration, the /mcp auth path ran its Effect programs outside the app's tracer layer, so the mcp.request spans (client name/version, rpc method, auth verdict) were created but never exported. This restores the export: the worker opens the http.server envelope span for MCP traffic and the handler runs its programs under the worker telemetry layer, parented to that span, with the same trace propagated into the session DO.

The new e2e scenario asserts the contract against the exported trace store (motel), and fails on the pre-fix code.

The Agents-bridge migration moved /mcp off the Effect app, so the auth
path's Effect programs ran under the default no-op tracer and the
mcp.request span (client fingerprint, rpc method, auth verdict) was
created but never exported. Run those programs under the worker
telemetry layer, open the http.server envelope span for MCP traffic at
the worker edge, and propagate its context through the handler into the
session DO so the whole request is one trace.

currentPropagationHeaders now reads currentParentSpan instead of
currentSpan so an external (edge) span still propagates into the DO.
The e2e scenario asserts the contract against the exported store.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 14, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud cca1176 Jul 14 2026, 06:35 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 14, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing cca1176 Commit Preview URL

Branch Preview URL
Jul 14 2026, 06:33 PM

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@pkg-pr-new

pkg-pr-new Bot commented Jul 14, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@1410

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@1410

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@1410

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@1410

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@1410

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@1410

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@1410

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@1410

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@1410

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@1410

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@1410

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@1410

executor

npm i https://pkg.pr.new/executor@1410

commit: cca1176

@RhysSullivan RhysSullivan marked this pull request as ready for review July 14, 2026 18:40
@RhysSullivan RhysSullivan merged commit 13732fe into main Jul 14, 2026
21 checks passed
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