feat(mcp): add client identity to tool spans#2700
Conversation
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
🦋 Changeset detectedLatest commit: e071959 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR adds MCP client identity to tool tracing. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "Merge branch 'main' into brandon/brandon..." | Re-trigger Greptile |
E2E Test Results✅ All tests passed • 243 passed • 1 skipped • 1035s
Tests ran across 4 shards in parallel. |
Deep Review✅ No critical issues found. This is a small, fully additive telemetry change: a bounded User-Agent parser ( No P2-level findings survive re-grading. 🔵 P3 nitpicks (2)
Reviewers (4): correctness, security, testing, maintainability. Testing gaps:
Environment note: |
Summary
MCP tool spans now identify the calling client application and version, making MCP traffic segmentable by clients such as Claude Code, OpenCode, and Cursor. Because the HTTP endpoint is stateless, identity is derived from a bounded first-product token in each request's User-Agent rather than relying on initialization state. Missing or malformed headers safely omit the attributes, and client values remain telemetry-only.
Test Plan
yarn ci:unit src/mcpyarn tsc --noEmitmcp.client.name=opencodeandmcp.client.version=1.18.0onmcp.tool.*spans