Context
src/mcp/telemetry.ts (added by #6235) carries this comment block at the top of the file (lines 14-15):
// NOT WIRED YET: per #6235 this module is deliberately NOT called from the tool-dispatch path — that (and the
// client lifecycle/flush strategy a live Worker needs) is the separate instrumentation issue's job.
This is now factually incorrect. Issue #6237 ("feat(mcp): instrument the remote MCP tool-dispatch chokepoint with PostHog events"), closed via merged PR #6358, wired recordMcpToolCall into the actual dispatch path. src/mcp/server.ts:1673-1683 now defines recordMcpToolTelemetry(env, tool, ok, durationMs) — explicitly documented as "Single chokepoint for the #6228 PostHog tool-call telemetry (#6237): every tools/call request that reaches handleMcpRequest routes through here exactly once, whether it succeeds or throws" — and that function calls recordMcpToolCall(env, { tool, callerType: "remote", ok, durationMs }) directly (src/mcp/server.ts:1679).
So recordMcpToolCall — the exact function the stale comment says is "NOT called from the tool-dispatch path" — IS called from the tool-dispatch path, and has been since PR #6358 merged. The comment in src/mcp/telemetry.ts was written when #6235 landed (before #6237 existed) and was never updated once #6237 shipped, leaving stale/misleading guidance at the top of the file for anyone reading this specific module in isolation.
Requirements
Deliverables
Test Coverage Requirements
This is a comment-only change with no new branches or logic, so no new test is required. Run the existing test/unit/mcp-telemetry.test.ts and test/unit/mcp-server-telemetry.test.ts suites unchanged to confirm the file still behaves identically (they must continue to pass without modification). Do not add a test that merely asserts a comment string — that is not meaningful coverage.
Expected Outcome
A future reader of src/mcp/telemetry.ts in isolation sees accurate, current information about where and how recordMcpToolCall is invoked, instead of a claim that was true under #6235 but has been false since #6237 / PR #6358 merged.
Links & Resources
Context
src/mcp/telemetry.ts(added by #6235) carries this comment block at the top of the file (lines 14-15):This is now factually incorrect. Issue #6237 ("feat(mcp): instrument the remote MCP tool-dispatch chokepoint with PostHog events"), closed via merged PR #6358, wired
recordMcpToolCallinto the actual dispatch path.src/mcp/server.ts:1673-1683now definesrecordMcpToolTelemetry(env, tool, ok, durationMs)— explicitly documented as "Single chokepoint for the #6228 PostHog tool-call telemetry (#6237): everytools/callrequest that reaches handleMcpRequest routes through here exactly once, whether it succeeds or throws" — and that function callsrecordMcpToolCall(env, { tool, callerType: "remote", ok, durationMs })directly (src/mcp/server.ts:1679).So
recordMcpToolCall— the exact function the stale comment says is "NOT called from the tool-dispatch path" — IS called from the tool-dispatch path, and has been since PR #6358 merged. The comment insrc/mcp/telemetry.tswas written when #6235 landed (before #6237 existed) and was never updated once #6237 shipped, leaving stale/misleading guidance at the top of the file for anyone reading this specific module in isolation.Requirements
src/mcp/telemetry.ts(currently lines 3-15) to reflect that the module IS wired into the remote tool-dispatch path viarecordMcpToolTelemetryinsrc/mcp/server.ts(cite the chokepoint by name), and that this shipped in feat(mcp): instrument the remote MCP tool-dispatch chokepoint with PostHog events #6237 / PR feat(mcp): instrument the remote tool-dispatch chokepoint with PostHog events #6358.recordMcpToolCall's exported signature, no-op-when-unconfigured behavior, and never-throw guarantee must remain byte-identical.packages/loopover-mcp/lib/telemetry.js(the LOCAL/CLI-side counterpart) — that module's own wiring status (per feat(mcp): add a typed PostHog wrapper module for packages/loopover-mcp (local, opt-in) #6236/feat(mcp): instrument the local MCP tool-dispatch chokepoint with PostHog events (opt-in) #6238) is a separate, already-accurate comment and out of scope for this issue.Deliverables
src/mcp/telemetry.ts's header comment corrected to describe the current (wired) state, citingrecordMcpToolTelemetryinsrc/mcp/server.tsand issue feat(mcp): instrument the remote MCP tool-dispatch chokepoint with PostHog events #6237 / PR feat(mcp): instrument the remote tool-dispatch chokepoint with PostHog events #6358src/mcp/telemetry.tsTest Coverage Requirements
This is a comment-only change with no new branches or logic, so no new test is required. Run the existing
test/unit/mcp-telemetry.test.tsandtest/unit/mcp-server-telemetry.test.tssuites unchanged to confirm the file still behaves identically (they must continue to pass without modification). Do not add a test that merely asserts a comment string — that is not meaningful coverage.Expected Outcome
A future reader of
src/mcp/telemetry.tsin isolation sees accurate, current information about where and howrecordMcpToolCallis invoked, instead of a claim that was true under #6235 but has been false since #6237 / PR #6358 merged.Links & Resources
src/mcp/telemetry.ts:1-16(the stale comment)src/mcp/server.ts:1673-1683(recordMcpToolTelemetry, the actual chokepoint, and its own accurate feat(mcp): instrument the remote MCP tool-dispatch chokepoint with PostHog events #6237 comment to model the correction on)