Skip to content

docs(mcp-analytics): add a bring-your-own-SDK install path - #20249

Draft
posthog[bot] wants to merge 2 commits into
masterfrom
posthog-self-driving/docsmcp-analytics-add-an-install-path-13e14e
Draft

posthog[bot] wants to merge 2 commits into
masterfrom
posthog-self-driving/docsmcp-analytics-add-an-install-path-13e14e

Conversation

@posthog

@posthog posthog Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

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 $lib or 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 under contents/docs/mcp-analytics/ and nothing else, so it adds no page and no navigation entry.

Problem

  • A team evaluating PostHog with an MCP server in a third language reads the install guide, sees Node 20.20+/22.22+ or Python 3.10+, and concludes the product is closed to them. The cost is a lost evaluation, not a bug.
  • The one documented escape hatch for a hand-rolled dispatcher, PostHogMCP on the custom servers page, is TypeScript and Python only, so it does not rescue them either.
  • The same wall stands in front of Go, Ruby, Rust, and Elixir servers.

Changes

File Change
custom-servers.mdx New ## Any other language section: 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.mdx A line under Requirements saying neither runtime is a hard requirement, linking the new section.
events.mdx The intro now names this page as the contract for a self-instrumented server too.

The 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_source set 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 $exception fan-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

  • I've read the docs and/or content style guides.
  • Words are spelled using American English
  • Use relative URLs for internal links
  • I've checked the pages added or changed in the Vercel preview build
  • If I moved a page, I added a redirect in 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
  • The gating claim, read from the code. products/mcp_analytics/backend/hogql_queries/base.py and facade/api.py scope every runner with event = '$mcp_tool_call' and properties.$mcp_source = 'posthog_mcp_analytics'. A grep for $lib across products/mcp_analytics/backend returns nothing.
  • The property list, derived rather than guessed. Each entry in the two tables is a property the backend actually reads. The "minimum" set is the one whose absence empties a view: $mcp_server_name because the server list requires notEmpty, $mcp_duration_ms because the percentiles cast it to float, $mcp_is_error because the error rates count IN ('true', '1').
  • The Elixir example parses. Extracted from the MDX and checked with Code.string_to_quoted/1. The API shapes come from reading lib/posthog.ex in posthog-elixir: PostHog.capture/2 pops distinct_id out of the merged property map, and property keys may be atoms.
  • Not run: the example against a live server. The sandbox has Elixir 1.14 and OTP 24; posthog-elixir requires Elixir ~> 1.17, so mix compile refuses and no newer toolchain was installable here.
  • Not run: the dev server. Prose-only change to three existing pages, no navigation change. Prettier was run on the three files. Please check them in the Vercel preview.

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 to PostHogMCP.

Follow-up, deliberately not in this PR: a PostHog.MCP capture helper in PostHog/posthog-elixir. That repository's CONTRIBUTING.md requires 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.

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
@github-actions github-actions Bot added docs Improvements or additions to product documentation, "Docs" content PR only touches files under contents/ labels Sep 16, 2026
@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Deploy preview

Status Details Updated (UTC)
🟢 Ready View preview Sep 16, 2026 11:46PM

Changed pages

Page Source
Instrumenting a custom server contents/docs/mcp-analytics/custom-servers.mdx
Event and property reference contents/docs/mcp-analytics/events.mdx
Installing the MCP Analytics SDK contents/docs/mcp-analytics/installation.mdx

@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

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!

contents/docs/mcp-analytics/custom-servers.mdx — 18 errors, 10 warnings, 1 suggestions
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
@posthog

posthog Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

Companion issue for the second half of this work: PostHog/posthog-elixir#209 proposes a PostHog.MCP capture helper. Filed as an issue rather than a PR because that repository's CONTRIBUTING.md requires a maintainer to agree the shape of a public API addition first, and tells agents in particular to stop and ask. This PR unblocks Elixir (and Go, Rust, and anything else) in the meantime.

@github-actions

Copy link
Copy Markdown
Contributor

Bundle report

Total JS (gzip)

8.79 MiB (no change)

Eager graph (modules shipped in each entrypoint's initial chunks)

Entrypoint Eager size Budget Modules
✅ app 18.57 MiB (no change) report-only 2067
Largest modules in the app closure
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).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

content PR only touches files under contents/ docs Improvements or additions to product documentation, "Docs"

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants