Prod Telemetry
UsefulSoftwareCo/executor
Query Executor's production telemetry — Axiom traces (executor-cloud dataset), prod Postgres via PlanetScale, PostHog product analytics — through the Executor MCP.
Debug, support, and build PostHog MCP Analytics — product analytics for MCP servers (the @posthog/mcp and posthog.mcp SDKs plus the mcpanalytics product).
$ npx skills add PostHog/posthog-foss --skill debugging-mcp-analytics -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install PostHog/posthog-foss debugging-mcp-analytics --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/PostHog/posthog-foss.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/debugging-mcp-analytics .claude/skills/debugging-mcp-analytics && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "debugging-mcp-analytics" agent skill from https://github.com/PostHog/posthog-foss/tree/master/.agents/skills/debugging-mcp-analytics into .claude/skills/debugging-mcp-analytics/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "debugging-mcp-analytics", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/PostHog/posthog-foss/tree/master/.agents/skills/debugging-mcp-analyticsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add PostHog/posthog-foss --skill debugging-mcp-analytics -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install PostHog/posthog-foss debugging-mcp-analytics --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PostHog/posthog-foss.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/debugging-mcp-analytics .agents/skills/debugging-mcp-analytics && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "debugging-mcp-analytics" agent skill from https://github.com/PostHog/posthog-foss/tree/master/.agents/skills/debugging-mcp-analytics into .agents/skills/debugging-mcp-analytics/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "debugging-mcp-analytics", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add PostHog/posthog-foss --skill debugging-mcp-analytics -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install PostHog/posthog-foss debugging-mcp-analytics --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PostHog/posthog-foss.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/debugging-mcp-analytics .cursor/skills/debugging-mcp-analytics && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "debugging-mcp-analytics" agent skill from https://github.com/PostHog/posthog-foss/tree/master/.agents/skills/debugging-mcp-analytics into .cursor/skills/debugging-mcp-analytics/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "debugging-mcp-analytics", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/PostHog/posthog-foss.git --path .agents/skills/debugging-mcp-analytics--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add PostHog/posthog-foss --skill debugging-mcp-analytics -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install PostHog/posthog-foss debugging-mcp-analytics --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PostHog/posthog-foss.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/debugging-mcp-analytics .gemini/skills/debugging-mcp-analytics && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "debugging-mcp-analytics" agent skill from https://github.com/PostHog/posthog-foss/tree/master/.agents/skills/debugging-mcp-analytics into .gemini/skills/debugging-mcp-analytics/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "debugging-mcp-analytics", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install PostHog/posthog-foss debugging-mcp-analyticsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add PostHog/posthog-foss --skill debugging-mcp-analytics -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/PostHog/posthog-foss.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/debugging-mcp-analytics .github/skills/debugging-mcp-analytics && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "debugging-mcp-analytics" agent skill from https://github.com/PostHog/posthog-foss/tree/master/.agents/skills/debugging-mcp-analytics into .github/skills/debugging-mcp-analytics/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "debugging-mcp-analytics", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add PostHog/posthog-foss --skill debugging-mcp-analytics -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install PostHog/posthog-foss debugging-mcp-analytics --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PostHog/posthog-foss.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/debugging-mcp-analytics .opencode/skills/debugging-mcp-analytics && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "debugging-mcp-analytics" agent skill from https://github.com/PostHog/posthog-foss/tree/master/.agents/skills/debugging-mcp-analytics into .opencode/skills/debugging-mcp-analytics/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "debugging-mcp-analytics", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
debugging-mcp-analyticsDebug, support, and build PostHog MCP Analytics — product analytics for MCP servers (the @posthog/mcp and posthog.mcp SDKs plus the mcpanalytics product).
Debugging MCP Analytics is an agent skill from PostHog/posthog-foss, published by the product's own GitHub organization. Debug, support, and build PostHog MCP Analytics — product analytics for MCP servers (the @posthog/mcp and posthog.mcp SDKs plus the mcpanalytics product). Use when MCP analytics data looks wrong or missing ("events aren't showing", "intent clusters are empty", "sessions are missing", "per-tool numbers look wrong"), when writing queries over $mcp events by hand, or when doing feature work on the SDKs, the dashboard and its query runners, the self-instrumented MCP server, the wizard mcp-analytics install command…
Its SKILL.md is about 7.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `references/event-vocabulary.md`, `references/local-repos.md` and `references/stateless-and-sessions.md`).
It sits in Agent Workflows, covering MCP servers, Debugging and Product analytics. It works with Model Context Protocol and PostHog. The repository describes itself as: PostHog FOSS is a read-only mirror of PostHog, with all proprietary code removed. NOTE: This repo is synced automatically from the main PostHog repo. Please raise any issues and… The licence is MIT.
7 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 2c48221. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
pipFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
github.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Debugging MCP Analytics loads about 7.6k tokens when it runs, and up to ~26k if it reads all its reference files. Until then it costs about 225 tokens; SKILL.md has 2,843 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from PostHog/posthog-foss at commit 2c48221, republished under its MIT licence (© PostHog). 2,843 words, ~7,575 tokens.
.claude/skills/debugging-mcp-analytics/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.Product analytics for MCP servers. A team ships an MCP server; the @posthog/mcp SDK
wraps it in one line; every tool call, agent intent, and failure lands in PostHog as a
$mcp_* event you can query, chart, alert on, and cluster — plus a dedicated dashboard. The
MCP-layer sibling of @posthog/ai.
The differentiator is intent: not "ran query_run 14 times" but "was trying to find a
churn cohort". Explicit non-goal: this does not replace LLM analytics / AI observability
— generation traces, prompt/response, and token cost belong there.
Status: beta, TypeScript and Python SDKs shipped, available to every project. PostHog dogfoods it — its own MCP server instruments itself, and that data drives the dashboard. Public tracking: mega-issue PostHog/posthog#64016, which is the live source for roadmap and customer wishlist.
GitHub is the source of truth for where the code lives. Paths below are in-repo; for the repos outside this monorepo, resolve a local checkout via references/local-repos.md rather than assuming a location.
| Concern | Repo | Where to look |
|---|---|---|
| Product / dashboard | PostHog/posthog (this repo) | products/mcp_analytics/ — Django/DRF + HogQL query runners + Temporal, Kea frontend, the query-mcp-* tool registry, and the analysis skills |
| Self-instrumented server | PostHog/posthog (this repo) | services/mcp/ — PostHog's own MCP server (Hono); the dogfood event producer. Also hosts the generated query-mcp-* handlers |
| Shared query reference | PostHog/posthog (this repo) | models-mcp.md — products/posthog_ai/skills/querying-posthog-data/references/ |
TypeScript SDK @posthog/mcp | PostHog/posthog-js | packages/mcp/ — the library customers install. Vocabulary source of truth: src/extensions/constants.ts. docs/ARCHITECTURE.md now covers conversation anchoring (ADR-0004) but trails the newest era handling — where it and CHANGELOG.md disagree, trust the changelog and the source |
Python SDK posthog.mcp | PostHog/posthog-python | posthog/mcp/ — mirrors posthog.ai. Ships inside posthog (pip install posthog); mcp/fastmcp are lazily-imported peer deps, no [mcp] extra. At TS parity since 7.40.0-7.42.1 — MCP Python SDK v2, conversation anchoring, typed errors, client UA/vendor |
| Docs | PostHog/posthog.com | contents/docs/mcp-analytics/ (incl. surfaces/), plus src/hooks/productData/mcp_analytics.tsx and the mcp_analytics entry in src/data/tools.ts |
| Install codemod | PostHog/context-mill | context/skills/mcp-analytics/{config.yaml,description.md} |
| Wizard CLI | PostHog/wizard | bin.ts, src/commands/mcp-analytics.ts, src/lib/programs/mcp-analytics/ |
| Wizard test harness | PostHog/wizard-workbench | apps/mcp-analytics/ fixtures |
Don't conflate:
PostHog/mcp-analytics is the archived prototype of this SDK — stuck at 0.0.9 with an
old track(server, {...}) API. It published under the same @posthog/mcp name, so grepping
that name can land you there. npm @posthog/mcp now resolves to PostHog/posthog-js.products/mcp_store/ is the MCP server marketplace / team gateway, not this product. (Older
notes also mention a products/mcp/ build-tooling directory; it no longer exists — the server
and its generation tooling live in services/mcp/.)wizard mcp add installs the PostHog MCP server into a coding agent. That is NOT
wizard mcp-analytics, which instruments the user's own server.Line numbers drift and this area moves fast — grep for the symbol, never trust a remembered line number. Confirm a checkout is on a sane branch before quoting its code.
These are the failure modes that produce a plausible-looking answer rather than an error.
EFFECTIVE_TOOL_SQL. The expression
lives once, in products/mcp_analytics/backend/hogql_queries/base.py:
coalesce(nullIf(toString(properties.$mcp_exec_tool_call_name), ''), toString(properties.$mcp_tool_name)).
It exists because a single-exec server can report the tool two different ways, and the two
eras of data coexist. Today services/mcp resolves the inner tool itself and passes it
straight in as the tool name (execToolName() in src/hono/tool-executor.ts, which falls
back to the literal exec when the inner command isn't recognized), so
$mcp_tool_name usually already holds the real tool. $mcp_exec_tool_call_name is
registered in posthog/taxonomy/taxonomy.py and coalesced defensively here, but nothing
on master emits it — treat it as historical rows plus in-flight work, not current
producer behaviour. Either way, aggregate through the coalesce: hand-rolling
properties.$mcp_tool_name alone silently buckets unrecognized exec calls under exec,
and misses any data that does carry the dedicated property.$mcp_is_error / $mcp_error_type / $mcp_error_status, never
$exception. $exception can be disabled, isn't emitted when no error value is passed,
and never matched new-SDK events — so querying it returns nothing rather than failing.products/mcp_analytics/frontend/timeBuckets.ts (resolveWindow,
normalizeBucket, buildBucketKeys, lastBucketIsInProgress). Omit it and a partial
period reads as a real decline.harness is derived, and its logic exists in three places that must move in lockstep:
products/mcp_analytics/backend/mcp_harness.py (source of truth — see its module
docstring), products/mcp_analytics/frontend/dashboard/harnessRegistry.ts, and
models-mcp.md.services/mcp consumes the SDK through an alias in its package.json and has historically
lagged the published version, so version-dependent properties (typed error types, $lib
identity, payload redaction) can be absent from PostHog's own data even when documented as
current. A query filtering on $lib = 'posthog-node-mcp' silently excludes all dogfood
traffic if that pin predates SDK 0.7.0. Note too that services/mcp uses the
custom-dispatcher (PostHogMCP) path rather than instrument(), so behaviour living
only in the instrument() path — stable sessions, $identify deduplication, _meta-based
client identity — has never applied to it at any version.$session_id is only stable if the server opted into conversation
anchoring — enableConversationId, which is off by default. With it off, a stateless
client's sessions fragment (often one per request); with it on, $session_id is derived
from an agent-echoed handle and survives reconnects, restarts, and pods. Check the flag
before diagnosing "fragmented sessions" as an ingestion problem. See
references/stateless-and-sessions.md./query/ endpoint. A backend/templates/*.sql referenced
by older notes no longer exists.All data lives on the shared ClickHouse events table — there is no dedicated table.
Every metric is an aggregation over $mcp_tool_call, usually grouped by $session_id.
Source of truth for the SDK-emitted names is packages/mcp/src/extensions/constants.ts in
PostHog/posthog-js, exported as PostHogMCPAnalyticsEvent / PostHogMCPAnalyticsProperty
(import them for typesafe queries). PostHog-side descriptions — including the server-stamped
and exec-mode properties the SDK does not define — live in posthog/taxonomy/taxonomy.py.
Events (all $-prefixed; non-$ names would be treated as customer events):
$mcp_tool_call (primary), $mcp_tools_list, $mcp_initialize, $mcp_missing_capability,
$mcp_resource_read / $mcp_resources_list, $mcp_prompt_get / $mcp_prompts_list,
$identify, $exception.
$mcp_initializeis not a reliable session anchor — but check whose server you're looking at. The 2026-07-28 revision removes theinitializehandshake, so a customer server on the SDK'sinstrument()path emits nothing for a stateless client. PostHog's own server is the exception:services/mcpfires the same$mcp_initializeevent fromserver/discoveras frominitialize(dispatcher.ts::recordDiscoveryRequestcovers both entry points), so the event is present in dogfood data either way. Treat its absence as meaningful only for customer servers. The real anchor is now the conversation handle when the server enables it — references/stateless-and-sessions.md covers the resolution order and the delivery protocol. Live consequence, for customer servers only:frontend/mcpAnalyticsOnboardingLogic.tsderiveshas_initializefrom this event, so a stateless customer server reads asnot-instrumenteduntil its first tool call. Onboarding still completes —hasToolCallis checked first, in both that selector andstatusFromProbeDefinitions. Projects onservices/mcpare unaffected, since it emits the event fromserver/discover.
Full property tables — split by provenance (SDK-emitted vs stamped by PostHog's own server vs exec-mode only), the identifier distinctions, per-version SDK behaviour, and TypeScript/Python parity — are in references/event-vocabulary.md. Read that before writing queries or changing what gets captured.
When debugging an MCP failure-rate headline, call posthog:metric-list before the dedicated analysis skills, typed tools, or hand-written HogQL and look for mcp_tool_call_fail_pct. Run an approved, non-drifted match with posthog:data-catalog-metric-run as the canonical headline. Use the paths below only for requested tool, harness, or time breakdowns after that run, and label those breakdowns noncanonical. If no governed metric matches, state that the catalog has no match and label the derived rate noncanonical.
Prefer the dedicated analysis skills over hand-written HogQL; they already encode the exec-mode and harness handling that Hard rules 1 and 4 describe:
exploring-mcp-tool-usage — front door / router: takes a broad "how is my MCP doing"
question and dispatches to the right typed tool or focused skill. Start here.exploring-mcp-tool-quality — error rates, latency, reach, failing and slow tools.exploring-mcp-sessions — session list, per-session tool calls, intent.exploring-mcp-intent-clusters — "what are people trying to do" clusters.improving-mcp-tools — eval-scored campaign loop: measure, make one bounded fix, re-measure.Typed tools exist for most questions and are preferable to raw SQL: posthog:query-mcp-tool-stats,
-daily-stats, -failures, -failure-occurrences, -descriptions, -neighbors,
-sample-intents, -top-users, and posthog:query-mcp-harness-breakdown, plus session tools
(posthog:mcp-analytics-sessions-list / -tool-calls / -generate-intent) and the intent-cluster
tools. They are declared in products/mcp_analytics/mcp/tools.yaml.
Harness is the friendly label for the calling client (Claude Code, Cursor, ChatGPT,
Windsurf, and ~30 other buckets). It is resolved at query time only, with no stored column:
mcp_harness.py::HARNESS_TOKEN_SQL picks the strongest available signal in priority order,
over exactly three properties — the ones the SDK schemas can emit
($mcp_vendor_client, with the legacy non-$ mcp_vendor_client coalesced for historical
rows -> Claude Code user-agent surface -> Grok and Kimchi user-agents -> $mcp_client_name -> generic
user-agent token, both from $mcp_client_user_agent), then
harness_label_sql() buckets it (or harness_label_or_token_sql(), which names an
unrecognized client verbatim instead of collapsing it into "Other" — use it for ranked
top-N lists, never where labels feed an array or unbounded GROUP BY).
$mcp_client_name is one mid-priority input, not a synonym for harness — grouping by
it directly gives a different, messier answer: on old SDK versions it rode only on the
session's initialize, and Anthropic's pooled surfaces self-report a generic
Anthropic/ClaudeAI that only the vendor header can disambiguate. The dogfood-only
mcp_session_client_name and $mcp_oauth_client_name are no longer read by harness
resolution — the server folds the session-pinned name into per-event $mcp_client_name,
and neither property ever resolved an event alone.
For hand-written SQL, models-mcp.md
carries the property reference and worked query examples.
$mcp_* events via the SDK.
Breaks: handlers not wrapped (instrument() is idempotent and degrades to a silent
no-op on failure); a STDIO server writing to stdout with console.* (corrupts the
protocol stream — wire a logger); a disabled or misconfigured posthog-node client.
For services/mcp there is a single emission path: src/hono/analytics.ts +
src/hono/tool-executor.ts -> getPostHogClient() (src/lib/posthog/client.ts) ->
PostHogMCP, consumed through the dependency alias @posthog/mcp-analytics (the alias
matters when grepping imports). The legacy MCPcat/AgentCat shim and the transition shim
that dual-emitted non-$ mcp_tool_call / mcp_initialize were both removed and are
regression-tested in services/mcp/tests/hono/. services/mcp/ARCHITECTURE.md still
describes the old multi-emitter design and references a deleted lib/mcpcat.ts — trust
the source, not that document.events. Breaks: ordinary ingestion and quota
problems; $session_id not materialized, which breaks session grouping.backend/logic.py::list_mcp_sessions runs HogQL over a 7-day
default window (DEFAULT_SESSIONS_DATE_FROM, resolved through QueryDateRange with a
one-day overlap buffer each side) and caches for 30s (SESSIONS_CACHE_TTL_SECONDS).
Breaks: anything outside the window simply isn't there; results can be up to 30s stale.AnalyticsQueryRunner subclasses in
backend/hogql_queries/ (base.py, dashboard_series.py, harness_breakdown.py,
tool_quality_tables.py, tool_tables.py), dispatched via the generic /query/ endpoint
and enumerated in backend/facade/queries.py, with schemas in posthog/schema.py.
Gate: hogql_queries/base.py::validate_mcp_analytics_access — the mcp_analytics RBAC
resource. Breaks: RBAC denies, or Hard rules 1-3 ignored.$mcp_intent values -> an LLM
summary of at most two sentences -> Postgres posthog_mcp_session. A second,
project-level path produces the intent digest / themes with structured output, bounded
by MAX_DIGEST_THEMES; resolve_themes() derives every countable field from the corpus
so the model cannot invent numbers. Model constants live in backend/intent_generation.py.
Breaks: no $mcp_intent captured at all (the agent never filled the injected context
argument and no intentFallback was configured), so there is nothing to summarize; LLM
key or quota problems.mcp-analytics-intent-routing) -> embed (cached in
MCPIntentEmbeddingCache) -> agglomerative clustering (cosine, average linkage,
DEFAULT_DISTANCE_THRESHOLD) -> JSONB
MCPIntentClusterSnapshot. Temporal end-to-end, no Celery. On-demand recompute
(trigger_intent_cluster_recompute, serialized with select_for_update() and a
deterministic per-team workflow id) and the cluster_mcp_intents management command both
start the workflow; the daily run is a Temporal Schedule
(posthog/temporal/mcp_analytics/intent_clustering/schedule.py, behind the
mcp-analytics-clustering-schedule flag) that triggers
IntentClusteringCoordinatorWorkflow, which fans out one child workflow per team.
Two caps will surprise you: MAX_SNAPSHOT_CLUSTERS (snapshots keep only the top clusters
by volume, enforced at write and again at read) and MAX_QUERY_ROWS.
Note the corpus does not depend on step 5: fetch_intent_corpus takes each session's
first $mcp_intent straight from ClickHouse and only overrides it with the stored LLM
summary where one exists. So a project can cluster with no generated summaries at all.
Breaks: empty clusters almost always mean no $mcp_intent values in the lookback window
(check the corpus before chasing summary generation); schedule flag off; stale embeddings.
Also check the allowlist — intent_clustering/team_discovery.py currently returns a
hard-coded GUARANTEED_TEAM_IDS = [2], so the daily schedule covers only PostHog's own
project and enabling the flag elsewhere still produces nothing until that changes./api/projects/{id}/mcp_analytics/{sessions,intent_clusters,feedback,missing_capabilities}
(router in backend/presentation/urls.py) plus custom actions
(sessions/{id}/tool_calls, sessions/{id}/generate_intent, sessions/intent_digest,
sessions/activity_overview, intent_clusters/recompute). Parallel surface: step 4's
runners, exposed to agents as the query-mcp-* tools. The intent-cluster read and
recompute endpoints require mcp-analytics-intent-routing; the other endpoints use
mcp-analytics.MCPAnalyticsScene.tsx, with tabs enumerated by
MCPAnalyticsTab in mcpAnalyticsSceneLogic.ts: activity, dashboard, sessions,
tool quality, intent clustering, notifications. The landing tab is volume-gated by
dashboardStage in mcpAnalyticsOnboardingLogic.ts and applies only to the bare
/mcp-analytics redirect — deep links and explicit tab clicks are never overridden.
The intent clustering tab, dashboard KPI, and tool-detail cluster section are all gated by
mcp-analytics-intent-routing; a direct unflagged link renders the standard not-found page.earlyData/): live tool-call feed plus the intent-themes card.
"Theme" (the LLM digest, Activity tab) is not "cluster" (the embedding clustering,
its own tab). Conflating the two is the most common mistake here.MCPAnalyticsToolDetail.tsx, its own
registered scene): shared date filter, failure-occurrence drill-down with copyable error
context, and "create fix task" straight into products/tasks.Metric tiles and @posthog/quill-primitives, plus
notable sessions selected by a NotableRule — so that table can legitimately be
short or empty.frontend/notifications/), thin wiring over the generic hog-function destination and
subscription machinery.Postgres models (backend/models.py): MCPSession (the intent store),
MCPIntentClusterSnapshot, MCPAnalyticsSubmission (feedback and missing-capability
reports), MCPIntentEmbeddingCache.
Seeding local data: ./manage.py seed_mcp_sessions --team-id N
(backend/management/commands/), with --sessions, --min-calls/--max-calls, --days,
--missing-capabilities, --seed, and --clear. Seeded events are tagged $mcp_seeded so
--clear removes only seeded data.
| Change | Repo | Workflow |
|---|---|---|
| SDK behaviour, events, options, instrumentation | PostHog/posthog-js | Work in packages/mcp. Run its unit tests, build, and lint. Add a changeset. Ships to npm; then bump the alias in services/mcp/package.json to pick it up. |
| Dashboard, queries, clustering, API | this repo | A new chart means a query runner in backend/hogql_queries/ behind validate_mcp_analytics_access — never a SQL template. Obey Hard rules 1-3. |
A new query-mcp-* agent tool | this repo (two places) | 1) an entry in products/mcp_analytics/mcp/tools.yaml with schema_ref, scopes, description, feature_flag; 2) the matching <Name>Query schema and <Name>QueryRunner in backend/hogql_queries/; 3) regenerate the tool handlers from services/mcp (see its package.json scripts). The generic createQueryWrapper handles the tool shape — no hand-written TypeScript. |
| PostHog's own dogfood events | this repo | services/mcp/src/hono/analytics.ts + tool-executor.ts; client in src/lib/posthog/client.ts. |
| Docs | PostHog/posthog.com | Keep the event and property tables in contents/docs/mcp-analytics/events.mdx synced with both the TypeScript constants.ts and the Python posthog/mcp/constants.py. |
| The install codemod or the wizard command | PostHog/context-mill, PostHog/wizard | See references/wizard-and-onboarding.md — in particular the rule about which changes need a wizard release and which do not. |
Rule of thumb: a change to what gets captured, or how servers are instrumented belongs
in the SDKs. How data is shown, aggregated, or clustered belongs in this product. PostHog's
own dogfood events belong in services/mcp. A new customer-facing capability usually spans
an SDK plus docs, and the product too if it needs a view.
The wizard install flow, the skill-distribution channels, and the in-app onboarding are all in references/wizard-and-onboarding.md.
Verified against master, @posthog/mcp 0.11.7, posthog 7.44.0, and MCP spec 2026-07-28
on 2026-08-25. Treat versions and open threads as perishable: re-check
packages/mcp/CHANGELOG.md, the pinned alias in services/mcp/package.json, and
mega-issue 64016 rather than trusting this
section.
Both SDKs now speak the stateless spec and the v2 MCP SDKs. services/mcp speaks both
dialects at the protocol layer (src/lib/stateless-protocol.ts — per-request dialect
detection, server/discover, no session minting for modern clients). The TypeScript SDK's
0.10.9-0.11.7 run instruments MCP TypeScript SDK v2 servers (structural detection in
detect.ts, both @modelcontextprotocol peers optional), resolves client identity and
protocol version through a per-request fallback chain, gates Mcp-Session-Id minting on the
revision each request declares, and captures $mcp_client_user_agent / $mcp_vendor_client.
The Python SDK caught up in posthog 7.40.0-7.42.1: MCP Python SDK v2, conversation-anchored
sessions byte-compatible with TS (derive_session_id_from_conversation), typed
$mcp_error_type / $mcp_error_message, and the same UA/vendor capture. The old parity
threads (posthog-python 803 and
830) were closed unmerged and
superseded — don't cite them as the source of what landed.
references/stateless-and-sessions.md is the reference
for all of it.
Also shipped: structured intent themes, first-party notification destinations and recurring
reports, mcp_analytics access control, the shared ProductEmptyState adoption,
failure-occurrence drill-down with "create fix task", the migration of every chart to typed
query runners, the demo seeder, and exec-mode inner-tool breakout (Hard rule 1).
What still lags, all checkable in this repo: the services/mcp alias pin is 0.10.2 against a
0.11.7 SDK (Hard rule 5 — no 0.11.x SDK-side fix or SDK-emitted property reaches dogfood data,
though the server independently stamps $mcp_client_user_agent and the legacy non-$
mcp_vendor_client regardless of the pin; harness resolution reads the SDK-emitted
$mcp_vendor_client first and coalesces the legacy name for those rows);
the exec-property emitter is still absent from
master (Hard rule 1); and the clustering schedule still covers only GUARANTEED_TEAM_IDS = [2].
© PostHog, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 4 other files (references) in .agents/skills/debugging-mcp-analytics of PostHog/posthog-foss.
Open the folder on GitHubat commit 2c48221
Debugging MCP Analytics next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Debugging MCP Analytics this skillPostHog/posthog-foss | 721 | — | ~7.6k | Automated safety check: Pass | MIT | |
| Prod TelemetryUsefulSoftwareCo/executor | 4.1k | — | ~1.9k | Automated safety check: Pass | MIT | |
| Local DevSmilyOrg/photofield | 608 | — | ~2.4k | Automated safety check: Pass | MIT | |
| Embedded DebuggerAdancurusul/embedded-debugger-mcp | 199 | — | ~1.4k | Automated safety check: Pass | MIT | |
| Memorywhalewuisabel-gif/MemWhale | 151 | — | ~765 | Automated safety check: Pass | MIT | |
| Helmor Debug Operatedohooo/helmor | 1.3k | — | ~6.6k | Automated safety check: Pass | Apache-2.0 |
UsefulSoftwareCo/executor
Query Executor's production telemetry — Axiom traces (executor-cloud dataset), prod Postgres via PlanetScale, PostHog product analytics — through the Executor MCP.
SmilyOrg/photofield
Run, test, and debug the photofield server locally. An agent skill from SmilyOrg/photofield.
Adancurusul/embedded-debugger-mcp
Embedded hardware debugging workflow for probe-rs targets using embedded-debugger-mcp.
wuisabel-gif/MemWhale
Query and write durable debugging memory recorded by MemoryWhale.
dohooo/helmor
Operate, reproduce, and debug a running local Helmor desktop development build through the Tauri MCP bridge.
adeze/raindrop-mcp
MCP Protocol Inspection and Debugging with Inspector CLI. An agent skill from adeze/raindrop-mcp.
PostHog/posthog-foss
Author useful, low-noise log alerts on services in a PostHog project.
PostHog/posthog-foss
Operating procedure for the conflict-autoresolver agent: sweep open PostHog/posthog PRs that conflict with master, resolve the trivial conflicts (generated artifacts deterministically, source…
PostHog/posthog-foss
Help users debug PostHog Error Tracking stack-trace symbolication for any supported platform — JavaScript/TypeScript web, React Native (Hermes), Android (Proguard / R8), or iOS / macOS (dSYM).
PostHog/posthog-foss
Investigates distributed application performance using PostHog APM (OpenTelemetry span) data via MCP.
PostHog/posthog-foss
Debug and inspect LLM/AI agent traces using PostHog's MCP tools.
PostHog/posthog-foss
Diagnose why a product metric changed (dropped, spiked, or plateaued) by orchestrating breakdowns, actors, paths, lifecycle, retention, and annotations queries.
Works with
Debug, support, and build PostHog MCP Analytics — product analytics for MCP servers (the @posthog/mcp and posthog.mcp SDKs plus the mcpanalytics product). Debugging MCP Analytics is an agent skill from PostHog/posthog-foss, published by the product's own GitHub organization.mcp SDKs plus the mcpanalytics product).
Debugging MCP Analytics fits situations like: MCP analytics data looks wrong; missing (events arent showing; intent clusters are empty; sessions are missing.
Run `npx skills add PostHog/posthog-foss --skill debugging-mcp-analytics -a claude-code`. Or copy the skill folder (.agents/skills/debugging-mcp-analytics in PostHog/posthog-foss) into .claude/skills/debugging-mcp-analytics in your project. Claude Code loads it when a task matches its description.
Run `npx skills add PostHog/posthog-foss --skill debugging-mcp-analytics -a codex`. Or copy the skill folder (.agents/skills/debugging-mcp-analytics in PostHog/posthog-foss) into .agents/skills/debugging-mcp-analytics in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add PostHog/posthog-foss --skill debugging-mcp-analytics -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/debugging-mcp-analytics, .gemini/skills/debugging-mcp-analytics, .github/skills/debugging-mcp-analytics and .opencode/skills/debugging-mcp-analytics in your project.
Going by SKILL.md and its folder, Debugging MCP Analytics needs the command-line tools its instructions call (pip). Our summary lists: Python 3.
SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Debugging MCP Analytics is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 7.6k tokens (SKILL.md is roughly 30k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 19k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Debugging MCP Analytics: Prod Telemetry (UsefulSoftwareCo/executor, 4.1k stars), Local Dev (SmilyOrg/photofield, 608 stars), Embedded Debugger (Adancurusul/embedded-debugger-mcp, 199 stars) and Memorywhale (wuisabel-gif/MemWhale, 151 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
PostHog (a GitHub organization, an official publisher) maintains it in PostHog/posthog-foss, which has 721 GitHub stars. The repository holds 213 skills in this directory. The repository was last updated on October 7, 2026.
Source: PostHog/posthog-foss on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.