Skip to content

[CI] (e97a8e7) typescript-sdk/stdio-server - #3751

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

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

Conversation

@wizard-ci-bot

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

Copy link
Copy Markdown

Automated wizard CI run

Source: context-mill-pr
Trigger ID: e97a8e7
App: typescript-sdk/stdio-server
App directory: apps/typescript-sdk/stdio-server
Workbench branch: wizard-ci-e97a8e7-typescript-sdk-stdio-server
Wizard branch: codex/mcp-analytics-ci-region
Context Mill branch: codex/mcp-modern-capture-wizard
PostHog (MCP) branch: master
Timestamp: 2026-09-01T18:20:39.951Z
Duration: 159.9s

YARA Scanner

✓ 13 tool calls scanned, 0 violations detected

No violations: ✓ 13 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR instruments a TypeScript MCP server (@modelcontextprotocol/sdk, STDIO transport) with PostHog analytics using @posthog/mcp's instrument() wrapper and posthog-node. The integration is clean and minimal — it adds the PostHog client, wraps the server with instrument(), and adds a SIGTERM shutdown handler to flush events.

Files changed Lines added Lines removed
4 +57 0

Confidence score: 5/5 🧙

  • Stale comment on line 11-12 still says "PostHog-less MCP server" and describes what the wizard should do — but it already did it. Minor code quality issue. [LOW]
  • No .env.example committed to document required environment variables for new developers — the report file covers it, but a committed example file is more discoverable. [LOW]

File changes

Filename Score Description
src/index.ts 4/5 Adds PostHog client initialization, instrument() call with captureModel: true, and SIGTERM shutdown handler. Clean and correct, but stale comment remains.
package.json 5/5 Adds @posthog/mcp and posthog-node dependencies with appropriate version ranges.
.gitignore 5/5 Excludes .env from version control.
posthog-mcp-analytics-report.md 4/5 Documents the integration, events captured, and manual steps. Serves as env var documentation.

App sanity check ✅

Criteria Result Description
App builds and runs Yes Valid TypeScript, correct imports, no syntax errors. tsc --noEmit should pass.
Preserves existing env vars & configs Yes Existing tools (echo, add), transport, and main function are untouched.
No syntax or type errors Yes All imports resolve to correct packages, process.env.POSTHOG_PROJECT_TOKEN! uses non-null assertion appropriately.
Correct imports/exports Yes PostHog from posthog-node and instrument from @posthog/mcp are correct.
Minimal, focused changes Yes Only PostHog-related additions: client init, instrument call, shutdown handler, deps.
Pre-existing issues None Base app is clean.

Issues

  • Stale comment: Lines 11-12 still read "A minimal, PostHog-less MCP server. The wizard mcp-analytics flow should detect the McpServer object below and wrap it with instrument(server, posthog)." This is now inaccurate since the instrumentation was added. Should be updated or removed. [LOW]

Other completed criteria

  • Environment variables documented in the committed report file (posthog-mcp-analytics-report.md)
  • Build configuration valid — package.json is well-formed with correct dependency entries
  • .env correctly excluded from version control via .gitignore

PostHog implementation ✅

Criteria Result Description
PostHog SDKs installed Yes posthog-node@^5.51.6 and @posthog/mcp@^0.12.0 added to package.json dependencies.
PostHog client initialized Yes new PostHog(process.env.POSTHOG_PROJECT_TOKEN!, { host: process.env.POSTHOG_HOST }) at module scope, then instrument(server, posthog, { captureModel: true }) called immediately after server creation.
capture() Yes instrument() automatically captures , , and `` events — no manual capture() calls needed.
identify() N/A Server-only MCP app; no user-facing sessions.
Error tracking Yes instrument() captures `` events when tool handlers throw. Shutdown handler ensures events flush on SIGTERM.
Reverse proxy N/A Server-only app using posthog-node — no ad-blocker concern.

Issues

No issues.

Other completed criteria

  • API key loaded from process.env.POSTHOG_PROJECT_TOKEN (not hardcoded)
  • Host configured from process.env.POSTHOG_HOST
  • posthog.shutdown() called on SIGTERM to flush batched events before exit
  • captureModel: true enriches tool call events with the LLM model identity

PostHog insights and events ✅

Filename PostHog events Description
src/index.ts , , `` Auto-captured by instrument(): tracks MCP protocol handshake, every tool invocation (echo, add) with parameters and model identity, and tool errors. Enables funnel analysis of tool usage patterns and error rates.

Issues

No issues.

Other completed criteria

  • Events represent real MCP protocol actions (initialization, tool calls, tool failures)
  • Events enable product insights — can build tool usage trends, error rate dashboards, and model usage breakdowns
  • Events enriched with captureModel: true to include LLM model identity on `` events
  • No PII in event properties — tool names and parameters are functional, not personal
  • Event naming follows PostHog MCP convention (* prefix, snake_case)

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