Skip to content

[CI] (624abe2) custom-dispatcher/hono-server - #4447

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

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

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 624abe2
App: custom-dispatcher/hono-server
App directory: apps/custom-dispatcher/hono-server
Workbench branch: wizard-ci-624abe2-custom-dispatcher-hono-server
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-10-08T09:01:45.186Z
Duration: 125.0s

YARA Scanner

✓ 28 tool calls scanned, 0 violations detected

No violations: ✓ 28 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog MCP analytics into a Hono-based custom MCP dispatcher server using the @posthog/mcp SDK. The integration instruments tools/list and tools/call JSON-RPC methods with comprehensive analytics including timing, protocol metadata, model tracking, and error handling, plus a graceful shutdown hook.

Files changed Lines added Lines removed
4 +115 -8

Confidence score: 5/5 🧙

No critical or medium issues found. The integration is thorough, idiomatic, and correctly uses the @posthog/mcp custom-dispatcher API surface.


File changes

Filename Score Description
src/index.ts 5/5 Core MCP analytics instrumentation: initializes PostHogMCP, instruments tools/list with captureToolsList, instruments tools/call (success + error) with prepareToolCall/prepareToolResult/captureToolCall, adds SIGTERM shutdown hook
package.json 5/5 Adds @posthog/mcp (pinned 0.22.2) and posthog-node (^5.55.0) dependencies
.gitignore 5/5 Excludes .env from version control
posthog-mcp-analytics-report.md 5/5 Documents changes, files modified, and manual next steps

App sanity check ✅

Criteria Result Description
App builds and runs Yes Report confirms tsc --noEmit passes; code is syntactically valid TypeScript
Preserves existing env vars & configs Yes Existing tool logic (runTool, TOOLS, JSON-RPC handlers) preserved; analytics wraps around existing functionality
No syntax or type errors Yes Valid TypeScript; proper type assertions on MCP request params
Correct imports/exports Yes PostHogMCP from @posthog/mcp is the correct import for custom dispatcher pattern
Minimal, focused changes Yes Only adds PostHog instrumentation; no unrelated refactors
Pre-existing issues None Base app is clean

Other completed criteria

  • Environment variables documented in the report file (POSTHOG_PROJECT_TOKEN, POSTHOG_HOST)
  • Build configuration valid — package.json scripts unchanged, dependencies properly added
  • .gitignore correctly excludes .env with the real API key from version control

PostHog implementation ✅

Criteria Result Description
PostHog SDKs installed Yes @posthog/mcp (0.22.2) and posthog-node (^5.55.0) added to dependencies
PostHog client initialized Yes new PostHogMCP(token, { host, captureModel: true }) — correct custom-dispatcher initialization with model capture enabled
capture() Yes captureToolsList() for tool listing, captureToolCall() for both success and error tool invocations
identify() N/A Server-only MCP dispatcher — no browser sessions
Error tracking Yes Error path captures isError: true with error: err object passed to captureToolCall
Reverse proxy N/A Server-only app using posthog-node — reverse proxy only benefits browser SDKs

Other completed criteria

  • API key loaded from process.env.POSTHOG_PROJECT_TOKEN — not hardcoded
  • Host loaded from process.env.POSTHOG_HOST — correctly configured
  • Graceful shutdown via process.on('SIGTERM', async () => { await posthog.shutdown() }) ensures queued events flush before exit
  • prepareToolList() used to advertise analytics-aware tool schemas
  • prepareToolCall() / prepareToolResult() correctly separate argument cleaning from capture
  • Request metadata (protocol version, user-agent, vendor client) extracted from headers and included in all captures

PostHog insights and events ✅

Filename PostHog events Description
src/index.ts `` Captured on tools/list with tool names, parameters, response, duration, and protocol metadata
src/index.ts `` (success) Captured on successful tools/call with tool name/description, cleaned args, result, duration, model metadata, session/conversation IDs
src/index.ts `` (error) Captured on failed tools/call with isError: true, error object, and all the same metadata as success path

Other completed criteria

  • Events represent real MCP protocol actions (tool listing, tool invocation)
  • Events enable product insights: can build funnels on tool usage, track error rates, measure latency, correlate by model
  • Events are richly enriched with timing (durationMs), protocol version, client user-agent, vendor client, server name/version, intent, model metadata, session and conversation IDs
  • No PII in event properties — only protocol-level metadata and tool parameters
  • Event naming follows @posthog/mcp SDK 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