Skip to content

feat(mcp): add a typed PostHog wrapper module for packages/loopover-mcp (local, opt-in) #6236

Description

@JSONbored

Context

Part of #6228 (telemetry spec). The local --stdio server needs its own wrapper, separate from the remote server's (per #6228: the local CLI's telemetry must default to opt-in, not opt-out, since it runs on a user's own machine — a materially different trust posture than the hosted remote server).

Requirements

  • Add the PostHog Node SDK as a dependency of packages/loopover-mcp.
  • Create a small wrapper module exposing the same shape of function as the remote-side wrapper (recordMcpToolCall({ tool, callerType: "local", ok, durationMs })), for consistency between the two.
  • The wrapper must check a persisted opt-in flag (see the companion telemetry enable/disable CLI-command issue) before sending anything — default OFF until a user explicitly opts in.
  • Must be a safe no-op if telemetry isn't enabled or the network call fails — never affect the CLI's actual command behavior.

Test Coverage Requirements

99%+ Codecov patch coverage; test both the opted-in and default-off (safe no-op) paths.

Deliverables

  • A typed wrapper module in packages/loopover-mcp, mirroring the remote side's shape.
  • Default-off behavior verified.

Expected Outcome

The local CLI has a ready-to-use, opt-in-gated telemetry function for the tool-dispatch instrumentation issue to call.

Links & Resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions