Skip to content

[CI] (e2f7ab0) typescript-sdk/stdio-server#2433

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

[CI] (e2f7ab0) typescript-sdk/stdio-server#2433
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-e2f7ab0-typescript-sdk-stdio-server

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: e2f7ab0
App: typescript-sdk/stdio-server
App directory: apps/typescript-sdk/stdio-server
Workbench branch: wizard-ci-e2f7ab0-typescript-sdk-stdio-server
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-07-06T22:17:07.295Z
Duration: 66.6s

YARA Scanner

✓ 14 tool calls scanned, 0 violations detected

No violations: ✓ 14 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown
Author

Now I have all the context needed. Let me produce the evaluation.


PR Evaluation Report

Summary

This PR integrates PostHog MCP analytics into a TypeScript STDIO-based MCP server by adding @posthog/mcp and posthog-node, calling instrument(server, posthog) on the existing McpServer, and implementing graceful shutdown handlers. The integration follows the official @posthog/mcp documentation closely.

Files changed Lines added Lines removed
3 +48 -3

Confidence score: 4/5 👍

  • No .env.example file committed to document required environment variables (POSTHOG_PROJECT_API_KEY, POSTHOG_HOST). The report.md mentions them but is not a standard env documentation mechanism. [MEDIUM]

File changes

Filename Score Description
package.json 5/5 Adds @posthog/mcp and posthog-node as dependencies — correct packages for MCP analytics
src/index.ts 5/5 Initializes PostHog client from env vars, calls instrument(server, posthog), adds graceful shutdown on SIGTERM/SIGINT/error
posthog-mcp-analytics-report.md 4/5 Wizard-generated integration report; documents changes and next steps

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes Report confirms tsc --noEmit passes; no syntax issues visible
Preserves existing env vars & configs Yes Existing tools (echo, add), server config, and main() structure are preserved
No syntax or type errors Yes Valid TypeScript; process.env.POSTHOG_PROJECT_API_KEY! uses non-null assertion appropriately for env vars
Correct imports/exports Yes All imports resolve: @posthog/mcp, posthog-node, @modelcontextprotocol/sdk
Minimal, focused changes Yes Only PostHog-related additions; no unrelated modifications
Pre-existing issues None Base app is clean

Issues

  • No .env.example committed: The required environment variables (POSTHOG_PROJECT_API_KEY, POSTHOG_HOST) are only mentioned in the wizard report markdown file. A .env.example file should be committed to properly document required env vars for other developers. [MEDIUM]

Other completed criteria

  • Build configuration (package.json) is valid with correct dependency specifications
  • Existing echo and add tools are fully preserved
  • Comment updated from "PostHog-less" to "instrumented with PostHog MCP analytics"

PostHog implementation ✅

Criteria Result Description
PostHog SDKs installed Yes @posthog/mcp@^0.8.0 and posthog-node@^5.39.4 added to package.json dependencies
PostHog client initialized Yes new PostHog(process.env.POSTHOG_PROJECT_API_KEY!, { host: process.env.POSTHOG_HOST }) at module scope, then instrument(server, posthog) — matches the official docs pattern exactly
capture() Yes instrument() auto-captures , , ``, and other MCP protocol events
identify() N/A Server-only MCP server — no browser sessions
Error tracking Yes enableExceptionAutocapture defaults to true per the docs; `` events are emitted on tool failures
Reverse proxy N/A Server-only app using posthog-node — reverse proxy is not applicable

Issues

None.

Other completed criteria

  • API key correctly loaded from process.env.POSTHOG_PROJECT_API_KEY (not hardcoded in source)
  • Host correctly loaded from process.env.POSTHOG_HOST
  • Graceful shutdown implemented for SIGTERM, SIGINT, and fatal startup errors with await posthog.shutdown()
  • instrument() called before server.connect(), ensuring tools registered both before and after are wrapped
  • void analytics correctly suppresses unused-variable lint warning for the analytics handle

PostHog insights and events ✅

Filename PostHog events Description
src/index.ts , , , instrument() auto-captures all MCP protocol events: tool invocations (echo, add), tool listings, client handshakes, and exceptions from failed tool calls

Issues

None.

Other completed criteria

  • Events represent real MCP protocol actions (tool calls, initialization, tool listings)
  • Events enable product insights: can track tool popularity, usage patterns, error rates, and session-level MCP activity
  • Events are enriched with properties by @posthog/mcp (tool name, arguments, duration, session_id, server info)
  • No PII in event properties — only tool names and structured MCP protocol data
  • Event naming follows PostHog's standard * convention (consistent, descriptive)

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