Skip to content

Stamp client identity on MCP execution spans - #1621

Merged
RhysSullivan merged 1 commit into
mainfrom
client-attribution
Aug 17, 2026
Merged

RhysSullivan merged 1 commit into
mainfrom
client-attribution

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

Execution spans (execute, execute-action, resume, and their descendants) now carry mcp.client.name / mcp.client.version / mcp.client.title alongside the existing mcp.request.session_id / mcp.rpc.id join keys.

Why: the initialize-reported clientInfo only existed on the initialize request span, which carries no session id yet, so execution telemetry could not be segmented by client (per-client search/tool-call funnels required a user-agent proxy).

How:

  • Sessionful servers read the live identity from the SDK after initialize (getClientVersion) and re-sync on the same oninitialized hook that syncs apps capabilities.
  • Session Durable Objects persist the identity in session meta (persistClientInfo, mirroring persistAppsEnabled) so attribution survives cold restores; a new restoredClientInfo config seeds the rebuilt server.
  • Modern per-request servers parse the spec 2026-07-28 per-request _meta clientInfo (falling back to the initialize body) and thread it through ModernMcpServerRequestOptions; the DO persists what a request reports.

The identity feeds span attributes only, never behavior. Absent identity emits no keys rather than empty strings.

Tests: span attribution through a real MCP client, the onClientInfoChange persistence contract, and the body parser. format:check, lint, typecheck, and the mcp/cloudflare/cloud test suites are green.

@github-actions

github-actions Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@cloudflare-workers-and-pages

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 d9ab930 Commit Preview URL

Branch Preview URL
Aug 17 2026, 04:36 PM

@pkg-pr-new

pkg-pr-new Bot commented Aug 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

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

@executor-js/config

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

@executor-js/execution

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

@executor-js/sdk

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

@executor-js/codemode-core

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

@executor-js/runtime-quickjs

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

@executor-js/plugin-file-secrets

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

@executor-js/plugin-graphql

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

@executor-js/plugin-keychain

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

@executor-js/plugin-mcp

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

@executor-js/plugin-onepassword

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

@executor-js/plugin-openapi

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

executor

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

commit: d9ab930

@cloudflare-workers-and-pages

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 d9ab930 Aug 17 2026, 04:37 PM

@RhysSullivan
RhysSullivan marked this pull request as ready for review August 17, 2026 16:47
@RhysSullivan
RhysSullivan merged commit 86c68af into main Aug 17, 2026
20 of 21 checks passed
@RhysSullivan
RhysSullivan deleted the client-attribution branch August 17, 2026 16:48
@RhysSullivan RhysSullivan mentioned this pull request Aug 18, 2026
omega-alpha-matt Bot pushed a commit to airbooksio/executor that referenced this pull request Aug 18, 2026
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