Skip to content

[CI] (0e81558) custom-dispatcher/hono-server - #4231

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

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

Conversation

@wizard-ci-bot

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

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 0e81558
App: custom-dispatcher/hono-server
App directory: apps/custom-dispatcher/hono-server
Workbench branch: wizard-ci-0e81558-custom-dispatcher-hono-server
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-09-29T08:16:51.663Z
Duration: 192.2s

YARA Scanner

✓ 28 tool calls scanned, 0 violations detected

No violations: ✓ 28 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Sep 29, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR adds PostHog MCP analytics instrumentation to a custom Hono-based MCP JSON-RPC dispatcher server. It installs @posthog/mcp and posthog-node, initializes a PostHogMCP client from environment variables, and instruments the initialize, tools/list, and tools/call MCP protocol methods with comprehensive analytics capture including duration, intent, model metadata, and error tracking.

Files changed Lines added Lines removed
4 +155 -17

Confidence score: 5/5 🧙

No critical or medium issues found. This is an exemplary MCP analytics integration that correctly uses the custom-dispatcher (Path C) pattern with PostHogMCP, preserves all existing server behavior, and captures rich, well-structured analytics events.


File changes

Filename Score Description
src/index.ts 5/5 Core instrumentation: initializes PostHogMCP, adds captureInitialize, captureToolsList, captureToolCall with full context, prepareToolList/prepareToolCall for analytics parameters, graceful shutdown
package.json 5/5 Adds pinned @posthog/mcp@0.21.0, posthog-node@5.54.1, and @types/node dev dependency
.gitignore 5/5 Excludes .env from version control
posthog-mcp-analytics-report.md 5/5 Comprehensive setup report documenting changes, verification, and manual next steps

App sanity check ✅

Criteria Result Description
App builds and runs Yes Report confirms tsc --noEmit passes; TypeScript is well-formed
Preserves existing env vars & configs Yes All existing JSON-RPC protocol behavior preserved; the server still returns 2024-11-05 protocol version and all tool handlers remain intact
No syntax or type errors Yes Valid TypeScript with proper type annotations and optional chaining
Correct imports/exports Yes PostHogMCP from @posthog/mcp and serve/Hono imports are correct
Minimal, focused changes Yes Only PostHog analytics instrumentation added; no unrelated modifications
Pre-existing issues None Base app is clean

Issues

No issues found.

Other completed criteria

  • Environment variables documented in report and .env excluded via .gitignore
  • Build configuration valid — package.json scripts and dependencies are well-formed
  • Dependencies pinned to exact versions for reproducibility

PostHog implementation ✅

Criteria Result Description
PostHog SDKs installed Yes @posthog/mcp@0.21.0 and posthog-node@5.54.1 added to package.json dependencies
PostHog client initialized Yes PostHogMCP initialized with project token and host from env vars, with captureModel: true, enableExceptionAutocapture: true
capture() Yes captureToolCall, captureToolsList, and captureInitialize called at appropriate protocol lifecycle points
identify() N/A Server-only MCP dispatcher app
Error tracking Yes enableExceptionAutocapture: true in config; error path in tools/call passes error: err to captureToolCall
Reverse proxy N/A Server-only app

Issues

No issues found.

Other completed criteria

  • API key loaded from process.env.POSTHOG_PROJECT_TOKEN (not hardcoded)
  • Host loaded from process.env.POSTHOG_HOST (not hardcoded)
  • Graceful shutdown via SIGTERM handler calling posthog?.shutdown()
  • prepareToolList and prepareToolCall correctly used to advertise and strip analytics-only parameters
  • Conditional PostHogMCP initialization — server runs without PostHog if env vars are missing in production
  • Missing env var validation with clear error message in non-production environments

PostHog insights and events ✅

Filename PostHog events Description
src/index.ts `` Captured on initialize handshake when protocol version is 2025-11-25; includes client info, parameters, response, duration
src/index.ts `` Captured on every tools/list request; includes tool names, parameters, response, duration, protocol version, session/client context
src/index.ts `` (success) Captured on successful tools/call; includes tool name, description, sanitized parameters, response, duration, intent, LLM model metadata
src/index.ts (error), Captured on failed tools/call with isError: true and the error object; exception autocapture also enabled

Issues

No issues found.

Other completed criteria

  • Events represent real MCP protocol actions (initialize, tools/list, tools/call)
  • Events enable product insights: can build funnels (list → call), track error rates, measure tool durations, analyze model usage
  • Events include rich properties: toolName, toolDescription, durationMs, parameters, response, intent, intentSource, llmModel, llmModelSource, protocolVersion, sessionId, clientUserAgent, vendorClient
  • No PII in event properties
  • Event names follow canonical PostHog MCP naming convention (, , ``)

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