Skip to content

[CI] (8dccaac) custom-dispatcher/hono-server - #2368

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-8dccaac-custom-dispatcher-hono-server
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-8dccaac-custom-dispatcher-hono-server

Conversation

@wizard-ci-bot

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

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 8dccaac
App: custom-dispatcher/hono-server
App directory: apps/custom-dispatcher/hono-server
Workbench branch: wizard-ci-8dccaac-custom-dispatcher-hono-server
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-07-03T00:57:11.194Z
Duration: 141.0s

YARA Scanner

✓ 14 tool calls scanned, 0 violations detected

No violations: ✓ 14 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog MCP analytics into a custom Hono-based MCP dispatcher server. It uses @posthog/mcp's PostHogMCP client to manually capture initialize and tools/call events at each dispatch point, with proper timing, error tracking, and graceful shutdown handling.

Files changed Lines added Lines removed
4 +89 -3

Confidence score: 5/5 🧙

  • No .env.example file committed: The .env is gitignored (correctly), but there's no .env.example to guide developers on required variables. Env vars are documented in the report markdown, which partially compensates. [MEDIUM]
  • Non-null assertion on missing env var: process.env.POSTHOG_PROJECT_API_KEY! will silently pass undefined to PostHogMCP if the env var is unset, potentially causing runtime errors. A guard or fallback would be safer. [LOW]

File changes

Filename Score Description
src/index.ts 4/5 PostHogMCP client initialization, captureInitialize on handshake, captureToolCall with timing/error data on tool dispatch, SIGTERM shutdown flush
package.json 5/5 Added @posthog/mcp@0.7.0 (pinned) and posthog-node@^5.39.4 to dependencies
.gitignore 5/5 Added .env to prevent secret leakage
posthog-mcp-analytics-report.md 4/5 Clear instrumentation report documenting events, env vars, and manual steps

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 logic and endpoints fully preserved; analytics code wraps without altering behavior
No syntax or type errors Yes All added code is syntactically valid TypeScript
Correct imports/exports Yes PostHogMCP imported from @posthog/mcp, package added to dependencies
Minimal, focused changes Yes Only PostHog MCP analytics additions, no scope creep
Pre-existing issues None Base app is clean

Issues

  • No .env.example committed: Developers cloning the repo have no template for required environment variables. The report.md documents them, but an .env.example file is the standard pattern. [MEDIUM]

Other completed criteria

  • All changes are relevant to PostHog MCP analytics integration
  • Code follows existing codebase patterns (naming, structure, indentation)
  • Build configuration (package.json) is valid with correct dependency additions
  • Environment variables documented in the instrumentation report

PostHog implementation ✅

Criteria Result Description
PostHog SDKs installed Yes posthog-node@^5.39.4 and @posthog/mcp@0.7.0 added to dependencies
PostHog client initialized Yes new PostHogMCP(apiKey, { host }) at module scope with env vars
capture() Yes captureInitialize and captureToolCall called at appropriate dispatch points
identify() N/A Server-only app — MCP sessions tracked via sessionId header
Error tracking Yes Failed tool calls captured with isError: true and error property passed to captureToolCall
Reverse proxy N/A Server-only app — no browser-side ad-blocker concerns

Issues

  • Unsafe env var access: process.env.POSTHOG_PROJECT_API_KEY! uses non-null assertion. If unset, undefined is passed as the API key, which could cause silent failures or runtime errors. Consider adding a startup check: if (!process.env.POSTHOG_PROJECT_API_KEY) throw new Error('...'). [LOW]

Other completed criteria

  • API key correctly loaded from process.env.POSTHOG_PROJECT_API_KEY
  • Host correctly loaded from process.env.POSTHOG_HOST
  • Graceful shutdown with posthog.shutdown() on SIGTERM ensures event flush
  • MCP session ID extracted from Mcp-Session-Id header for event correlation

PostHog insights and events ✅

Filename PostHog events Description
src/index.ts `` Captures every client handshake with clientName, clientVersion, sessionId
src/index.ts `` Captures every tool dispatch with toolName, parameters, response, durationMs, isError
src/index.ts `` (via isError: true) Error details captured alongside failed tool calls

Issues

No issues.

Other completed criteria

  • Events represent real server actions (MCP protocol handshakes and tool invocations)
  • Events enable product insights — can build funnels on tool usage, error rate trends, and duration analysis
  • Events include rich contextual properties (timing, parameters, response data, session correlation)
  • No PII in event properties — only tool names, parameters, and technical metadata
  • Event naming follows standard PostHog MCP convention (* prefix)

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