Skip to content

[CI] (3f39e0e) typescript-sdk/stdio-server - #4181

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-3f39e0e-typescript-sdk-stdio-server
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-3f39e0e-typescript-sdk-stdio-server

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Sep 23, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 3f39e0e
App: typescript-sdk/stdio-server
App directory: apps/typescript-sdk/stdio-server
Workbench branch: wizard-ci-3f39e0e-typescript-sdk-stdio-server
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-09-23T22:24:21.139Z
Duration: 126.1s

YARA Scanner

✓ 22 tool calls scanned, 0 violations detected

No violations: ✓ 22 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Sep 23, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR adds PostHog analytics to a minimal MCP (Model Context Protocol) stdio server by installing posthog-node and @posthog/mcp, initializing the PostHog client from environment variables, and wrapping the MCP server with instrument() for automatic tool-call event capture. A graceful shutdown handler is also added.

Files changed Lines added Lines removed
3 +20 -0

Confidence score: 4/5 👍

  • No .env.example file: The required environment variables (POSTHOG_PROJECT_TOKEN, POSTHOG_HOST) are not documented in a committed example file. The runtime validation is helpful but not a substitute for a committed .env.example. [MEDIUM]
  • No error tracking: Process-level errors in main().catch() are logged to stderr and exit, but are never captured to PostHog. Adding posthog.capture({ distinctId: 'server', event: '', properties: { : err.message } }) before exit would close this gap. [MEDIUM]
  • Stale code comment: Line 16–17 still reads "A minimal, PostHog-less MCP server" — this is now inaccurate after the integration. [LOW]

File changes

Filename Score Description
apps/mcp-analytics/typescript-sdk/stdio-server/.gitignore 5/5 Adds .env to prevent committing secrets
apps/mcp-analytics/typescript-sdk/stdio-server/package.json 4/5 Adds @posthog/mcp and posthog-node dependencies with pinned versions
apps/mcp-analytics/typescript-sdk/stdio-server/src/index.ts 3/5 Initializes PostHog, instruments MCP server, adds shutdown handler; missing error tracking and has stale comment

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes Valid TypeScript, correct imports, no syntax issues
Preserves existing env vars & configs Yes Existing server tools and transport logic are untouched
No syntax or type errors Yes All new code is syntactically valid TypeScript
Correct imports/exports Yes PostHog from posthog-node and instrument from @posthog/mcp are correct
Minimal, focused changes Yes Only PostHog-related additions, no scope creep
Pre-existing issues Stale package.json description says "PostHog-less" Not introduced by this PR

Issues

  • Missing .env.example: The two required environment variables (POSTHOG_PROJECT_TOKEN, POSTHOG_HOST) are only documented via a runtime throw. A committed .env.example with placeholder values would make setup self-documenting. [MEDIUM]

Other completed criteria

  • Build configuration is valid — package.json scripts and dependencies are well-formed
  • Existing app code and configs are fully preserved
  • Changes are minimal and focused on PostHog integration only

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-node@5.53.0 and @posthog/mcp@0.18.0 added to package.json
PostHog client initialized Yes new PostHog(token, { host }) — correct Node SDK initialization pattern
capture() Yes instrument(server, posthog, { captureModel: true }) auto-captures MCP tool calls
identify() N/A Server-only app — no browser sessions to identify
Error tracking No Process-level errors in main().catch() are not captured to PostHog
Reverse proxy N/A Server-only app — reverse proxy is only for browser SDKs

Issues

  • No error tracking: The main().catch() handler writes to stderr and exits but does not send the error to PostHog. Capturing exceptions before shutdown would provide visibility into server crashes. [MEDIUM]

Other completed criteria

  • API key correctly loaded from process.env.POSTHOG_PROJECT_TOKEN (not hardcoded)
  • Host correctly loaded from process.env.POSTHOG_HOST
  • Graceful shutdown via process.on('SIGTERM') calls posthog.shutdown() to flush events
  • instrument() call is placed immediately after server creation, before tool registrations — correct order

PostHog insights and events ✅

Filename PostHog events Description
src/index.ts mcp_tool_called (auto via instrument()) instrument(server, posthog, { captureModel: true }) automatically captures every MCP tool invocation (echo, add) with model metadata. These events enable tracking tool usage patterns across MCP sessions.

Issues

None — the @posthog/mcp instrument() function handles event capture automatically with meaningful names and properties.

Other completed criteria

  • Events represent real user/agent actions (MCP tool invocations)
  • Events enable product insights (tool usage funnels, frequency analysis)
  • Events enriched with model properties via captureModel: true
  • No PII placed in event properties
  • Event naming is handled by the SDK with consistent conventions

Reviewed by wizard workbench PR evaluator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants