docs(mcp-analytics): add a bring-your-own-SDK install path - #20249
posthog[bot] wants to merge 2 commits into
Conversation
MCP Analytics gates on the event name and on $mcp_source, never on the sending library, so a server in any language can populate the product. The docs only described Node and Python, and the escape hatch for hand-rolled dispatchers (PostHogMCP) exists in those two languages only. Adds an "Any other language" section to the custom servers page with the wire contract, a worked Elixir example, and the work the wrapping SDKs do that a raw capture call does not. Links it from the installation requirements and the event reference. Generated-By: PostHog Desktop Task-Id: ef53c211-3c99-4520-a0f8-052b0a4007de
Deploy preview
Changed pages
|
|
Vale prose linter → found 59 errors, 43 warnings, 2 suggestions in your markdown Full report → Copy the linter results into an LLM to batch-fix issues. Linter being weird? Update the rules!
|
| Line | Severity | Message | Rule |
|---|---|---|---|
| 7:124 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 7:248 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 7:425 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 34:91 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 38:81 | suggestion | Address the reader directly. Use 'you' instead of 'the user'. | PostHogDocs.DirectAddress |
| 75:137 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 91:134 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 97:83 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 99:16 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 100:45 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 101:56 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 102:24 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 103:21 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 105:184 | warning | Use 'ID' instead of 'id'. | Vale.Terms |
| 107:74 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 107:120 | warning | Capitalize 'Error Tracking' for PostHog's product. Use 'error tracking' for the general industry concept. | PostHogBase.ProductNames |
| 122:187 | warning | 'args' is a possible misspelling. | PostHogBase.Spelling |
| 186:158 | warning | 'kwargs' is a possible misspelling. | PostHogBase.Spelling |
| 186:165 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 196:50 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 197:42 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 197:157 | warning | Use 'AI' instead of 'ai'. | Vale.Terms |
| 197:161 | warning | 'Cowork' is a possible misspelling. | PostHogBase.Spelling |
| 203:172 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 225:84 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 246:83 | warning | Use 'ID' instead of 'id'. | Vale.Terms |
| 308:43 | warning | Use 'ID' instead of 'id'. | Vale.Terms |
| 309:5 | warning | Capitalize 'Error Tracking' for PostHog's product. Use 'Error tracking' for the general industry concept. | PostHogBase.ProductNames |
| 309:116 | warning | Capitalize 'Error Tracking' for PostHog's product. Use 'error tracking' for the general industry concept. | PostHogBase.ProductNames |
contents/docs/mcp-analytics/events.mdx — 14 errors, 13 warnings, 1 suggestions
| Line | Severity | Message | Rule |
|---|---|---|---|
| 31:84 | warning | Use 'ID' instead of 'id'. | Vale.Terms |
| 31:178 | warning | Use 'ID' instead of 'id'. | Vale.Terms |
| 31:265 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 31:276 | warning | Use 'ID' instead of 'id'. | Vale.Terms |
| 46:157 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 47:173 | suggestion | Address the reader directly. Use 'you' instead of 'the user'. | PostHogDocs.DirectAddress |
| 48:270 | warning | 'accessors' is a possible misspelling. | PostHogBase.Spelling |
| 48:280 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 59:17 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 61:29 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 61:141 | warning | Use 'AI' instead of 'ai'. | Vale.Terms |
| 61:145 | warning | 'Cowork' is a possible misspelling. | PostHogBase.Spelling |
| 62:33 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 63:27 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 65:157 | warning | Use 'AI' instead of 'ai'. | Vale.Terms |
| 65:191 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 65:388 | warning | Use 'AI' instead of 'ai'. | Vale.Terms |
| 67:191 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 71:209 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 71:236 | warning | Capitalize 'Error Tracking' for PostHog's product. Use 'Error tracking' for the general industry concept. | PostHogBase.ProductNames |
| 82:49 | warning | 'symbolicate' is a possible misspelling. | PostHogBase.Spelling |
| 82:107 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 98:73 | warning | 'groupType' is a possible misspelling. | PostHogBase.Spelling |
| 98:85 | warning | 'groupKey' is a possible misspelling. | PostHogBase.Spelling |
| 108:34 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 109:30 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 110:33 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 112:57 | warning | 'typesafe' is a possible misspelling. | PostHogBase.Spelling |
contents/docs/mcp-analytics/installation.mdx — 27 errors, 20 warnings, 0 suggestions
| Line | Severity | Message | Rule |
|---|---|---|---|
| 8:11 | warning | Use 'X' instead of 'x'. | Vale.Terms |
| 16:69 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 17:54 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 17:202 | warning | 'jlowin's' is a possible misspelling. | PostHogBase.Spelling |
| 38:211 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 42:280 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 42:318 | warning | Capitalize 'Logs' for PostHog's product. Use 'logs' for the general industry concept. | PostHogBase.ProductNames |
| 68:63 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 115:28 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 120:51 | warning | Use the Oxford comma before 'and' or 'or' in a list of three or more items. | PostHogBase.OxfordComma |
| 153:48 | warning | 'OAuth' is a possible misspelling. | PostHogBase.Spelling |
| 168:1 | warning | 'untrusted' is a possible misspelling. | PostHogBase.Spelling |
| 177:32 | warning | Use 'MCP' instead of 'mcp'. | Vale.Terms |
| 187:106 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 202:17 | warning | Use 'MCP' instead of 'mcp'. | Vale.Terms |
| 211:213 | warning | Use 'MCP' instead of 'mcp'. | Vale.Terms |
| 211:242 | warning | 'mutator' is a possible misspelling. | PostHogBase.Spelling |
| 215:130 | warning | 'mutator' is a possible misspelling. | PostHogBase.Spelling |
| 227:51 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 229:161 | warning | Use 'ID' instead of 'id'. | Vale.Terms |
| 229:279 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 237:5 | warning | 'Streamable' is a possible misspelling. | PostHogBase.Spelling |
| 250:5 | warning | 'If you must stream (SSE)' heading should be in sentence case, and product names should be capitalized. | PostHogBase.SentenceCase |
| 272:269 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 282:70 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 282:270 | warning | Use 'X' instead of 'x'. | Vale.Terms |
| 282:316 | warning | 'jlowin's' is a possible misspelling. | PostHogBase.Spelling |
| 286:168 | warning | Use 'X' instead of 'x'. | Vale.Terms |
| 287:15 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 287:47 | warning | Use 'X' instead of 'x'. | Vale.Terms |
| 288:4 | warning | 'jlowin's' is a possible misspelling. | PostHogBase.Spelling |
| 325:105 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 334:77 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 335:59 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 336:48 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 337:53 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 342:59 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 344:59 | warning | 'jlowin's' is a possible misspelling. | PostHogBase.Spelling |
| 352:38 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 362:160 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 373:111 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 387:75 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 395:93 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 397:1 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 399:76 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 400:77 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 421:115 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
…xample Generated-By: PostHog Desktop Task-Id: ef53c211-3c99-4520-a0f8-052b0a4007de
|
Companion issue for the second half of this work: PostHog/posthog-elixir#209 proposes a |
Bundle reportTotal JS (gzip)8.79 MiB (no change) Eager graph (modules shipped in each entrypoint's initial chunks)
Largest modules in the
|
| Module | Size |
|---|---|
./src/data/mcp-tools.json |
1150.6 KiB |
css ./node_modules/.pnpm/css-loader@5.2.7_webpack@5.101.3/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[8].oneOf[1].use[1]!./node_modules/.pnpm/postcss-loader@4.3.0_postcss@8.5.6_webpack@5.101.3/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[8].oneOf[1].use[2]!./src/styles/global.css |
774.8 KiB |
./src/components/Stickers/Stickers.tsx |
696.4 KiB |
./node_modules/.pnpm/@radix-ui+react-icons@1.3.2_react@18.3.1/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js |
481.4 KiB |
./node_modules/.pnpm/@posthog+brand@0.8.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/x-ray.mjs |
480.8 KiB |
./node_modules/.pnpm/rehype-raw@7.0.0/node_modules/rehype-raw/lib/index.js + 29 modules |
395.1 KiB |
./node_modules/.pnpm/@posthog+brand@0.8.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/im-the-driver.mjs |
385.7 KiB |
./src/hooks/useCustomers.tsx + 55 modules |
370.0 KiB |
./node_modules/.pnpm/@posthog+icons@0.36.6_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
354.8 KiB |
./node_modules/.pnpm/react-markdown@8.0.7_@types+react@16.14.66_react@18.3.1/node_modules/react-markdown/lib/react-markdown.js + 88 modules |
351.4 KiB |
./src/components/ProductComparisonTable/index.tsx + 126 modules |
305.8 KiB |
./node_modules/.pnpm/cloudinary-core@2.14.0_lodash@4.17.21/node_modules/cloudinary-core/cloudinary-core.js |
281.9 KiB |
./node_modules/.pnpm/@posthog+brand@0.8.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/doll-house.mjs |
281.7 KiB |
./node_modules/.pnpm/@posthog+brand@0.8.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/director.mjs |
275.6 KiB |
./src/components/SearchUI/index.tsx + 87 modules |
273.7 KiB |
Eager-graph budgets are report-only until a baseline is established. Sizes are gzip of public/**/*.js; eager size is webpack module source bytes for the modules actually shipped in the entrypoint's initial chunks (post-tree-shake).
Changes
Executive summary
The MCP Analytics docs read as if the product needs one of two runtimes. It does not. Every query behind the product filters on the event name and on
$mcp_source, and none of them looks at$libor any other SDK marker. Any server that captures the canonical$mcp_*events lights up the whole product. This PR writes that down. It changes three files undercontents/docs/mcp-analytics/and nothing else, so it adds no page and no navigation entry.Problem
PostHogMCPon the custom servers page, is TypeScript and Python only, so it does not rescue them either.Changes
custom-servers.mdx## Any other languagesection: the wire contract, a worked Elixir example, and what the wrapping SDKs do that a raw capture call does not. A third row in the "When to use which" table.installation.mdxevents.mdxThe new section splits the contract in two, because the distinction is what unblocks a reader: six properties put a server on the dashboards at all, and the rest each turn on a view rather than a column.
$mcp_sourceset to"posthog_mcp_analytics"is the one that decides visibility. It also states plainly what the reader takes on, since a raw capture call does no redaction, no truncation, no$exceptionfan-out, and no session derivation.Note
This overlaps in subject with #20022, which adds experimental Ruby sections to the same three files. The two are complementary: that PR documents a real Ruby SDK, this one documents the path for languages that will not get one soon. Both append to the end of
custom-servers.mdx, so whichever lands second needs a trivial conflict resolution there.Checklist
vercel.json(no pages moved)Agent context
Autonomy: Fully autonomous. Written by Claude Opus 5 in a PostHog Desktop task run.
What was verified, and what was not
products/mcp_analytics/backend/hogql_queries/base.pyandfacade/api.pyscope every runner withevent = '$mcp_tool_call'andproperties.$mcp_source = 'posthog_mcp_analytics'. A grep for$libacrossproducts/mcp_analytics/backendreturns nothing.$mcp_server_namebecause the server list requiresnotEmpty,$mcp_duration_msbecause the percentiles cast it to float,$mcp_is_errorbecause the error rates countIN ('true', '1').Code.string_to_quoted/1. The API shapes come from readinglib/posthog.exinposthog-elixir:PostHog.capture/2popsdistinct_idout of the merged property map, and property keys may be atoms.posthog-elixirrequires Elixir ~> 1.17, somix compilerefuses and no newer toolchain was installable here.Considered and rejected: a new page under
contents/docs/mcp-analytics/. MCP Analytics documents each language as a section of an existing page, and a new page would need a navigation entry for content that belongs next toPostHogMCP.Follow-up, deliberately not in this PR: a
PostHog.MCPcapture helper inPostHog/posthog-elixir. That repository'sCONTRIBUTING.mdrequires a maintainer to agree the shape of a public API addition on an issue before an agent implements it, so an issue was opened there instead of a PR.Created with PostHog Desktop from this inbox report.