Repository navigation
docs(mcp-analytics): add an install path for languages without an SDK - #20895
Conversation
Adds /docs/mcp-analytics/installation/other-languages: the $mcp_tool_call contract a server in any language can send through its PostHog SDK or the capture API, with the context argument for intent, session ID rules, failure fields, a redaction checklist for payloads, and a SQL check. Derived from the sdk-specs mcp-analytics spec and the properties the mcp_analytics backend filters on ($mcp_source, $mcp_server_name). Links it from the sidebar, the installation index (as the coding-agent fallback when the wizard doesn't apply), and the event reference intro. Tested: ran the page's verification query on project 2 (126,015 calls in the last hour, all missing_/bad_ counts 0) and confirmed JSONType returns String for a "false" string and Bool for false. prettier --check passes.
Deploy preview
Changed pages
|
|
Vale prose linter → found 0 errors, 14 warnings, 1 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 |
|---|---|---|---|
| 46:458 | warning | 'params' is a possible misspelling. | PostHogBase.Spelling |
| 46:486 | warning | Use 'SDK' instead of 'sdk'. | Vale.Terms |
| 49:262 | suggestion | Address the reader directly. Use 'you' instead of 'the user'. | PostHogDocs.DirectAddress |
| 50:186 | warning | 'accessors' is a possible misspelling. | PostHogBase.Spelling |
| 67:33 | warning | 'sessionless' is a possible misspelling. | PostHogBase.Spelling |
| 75:141 | warning | Use 'AI' instead of 'ai'. | Vale.Terms |
| 75:145 | warning | 'Cowork' is a possible misspelling. | PostHogBase.Spelling |
| 79:103 | warning | Use 'AI' instead of 'ai'. | Vale.Terms |
| 79:273 | warning | Use 'AI' instead of 'ai'. | Vale.Terms |
| 95:236 | warning | Capitalize 'Error Tracking' for PostHog's product. Use 'Error tracking' for the general industry concept. | PostHogBase.ProductNames |
| 108:87 | warning | 'symbolicate' is a possible misspelling. | PostHogBase.Spelling |
| 126:73 | warning | 'groupType' is a possible misspelling. | PostHogBase.Spelling |
| 126:86 | warning | 'groupKey' is a possible misspelling. | PostHogBase.Spelling |
| 140:57 | warning | 'typesafe' is a possible misspelling. | PostHogBase.Spelling |
contents/docs/mcp-analytics/installation/other-languages.mdx — 0 errors, 1 warnings, 0 suggestions
| Line | Severity | Message | Rule |
|---|---|---|---|
| 139:184 | warning | Use 'AI' instead of 'ai'. | Vale.Terms |
…tract
Pre-PR review (opus + sonnet) found that $mcp_intent and $mcp_error_message
went out unredacted on the required path, since the only redaction rules sat
in the optional payload step. Adds a required "Redact free text" step and
points the payload step at it. Also from the review:
- capture only final outcomes of registered tools (no unknown tools,
input_required rounds, or task handles)
- session table covers SSE and WebSocket and the 2026-07-28 stateless case
- $exception keeps the call's distinct_id and $process_person_profile
- $mcp_error_type precedence, $mcp_error_status, blank/"{}" intent omitted
- optional $mcp_initialize step: the default dashboard template's "MCP
clients" and "MCP users and sessions" insights count only that event
- check query also flags a missing $mcp_tool_name
Tested: re-ran the revised check query on project 2 (124,683 calls in the
last hour, all missing_/bad_ counts 0). prettier --check passes.
Bundle reportTotal JS (gzip)10.44 MiB (+3.6 KiB / +0.0%) Largest changed named chunks
Eager graph (modules shipped in each entrypoint's initial chunks)
Largest modules in the
|
| Module | Size |
|---|---|
./src/data/mcp-tools.json |
1451.1 KiB |
css ./node_modules/.pnpm/[email protected][email protected]/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[8].oneOf[1].use[1]!./node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[8].oneOf[1].use[2]!./src/styles/global.css |
817.2 KiB |
./src/components/Stickers/Stickers.tsx |
696.4 KiB |
./node_modules/.pnpm/@[email protected][email protected]/node_modules/@posthog/brand/dist/generated/hoggies/svg/x-ray.mjs |
481.2 KiB |
./node_modules/.pnpm/@[email protected][email protected]/node_modules/@posthog/brand/dist/generated/hoggies/svg/trenchcoat.mjs |
450.8 KiB |
./node_modules/.pnpm/[email protected]/node_modules/rehype-raw/lib/index.js + 29 modules |
395.1 KiB |
./node_modules/.pnpm/@[email protected][email protected]/node_modules/@posthog/brand/dist/generated/hoggies/svg/im-the-driver.mjs |
385.8 KiB |
./src/hooks/useCustomers.tsx + 61 modules |
381.8 KiB |
./node_modules/.pnpm/@[email protected][email protected]/node_modules/@posthog/brand/dist/generated/hoggies/svg/tourist.mjs |
364.6 KiB |
./node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@posthog/icons/dist/posthog-icons.es.js |
354.8 KiB |
./node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/react-markdown/lib/react-markdown.js + 88 modules |
351.4 KiB |
./src/components/ProductComparisonTable/index.tsx + 130 modules |
314.2 KiB |
./node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs + 127 modules |
287.8 KiB |
./node_modules/.pnpm/@[email protected][email protected]/node_modules/@posthog/brand/dist/generated/hoggies/svg/doll-house.mjs |
284.1 KiB |
./node_modules/.pnpm/[email protected][email protected]/node_modules/cloudinary-core/cloudinary-core.js |
281.9 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).
The card grid on /docs/mcp-analytics/installation truncated "Other languages" to "Other languag..." in a 1558px window (seen on the deploy preview). The sidebar entry keeps the full name.
|
This PR hasn't seen activity in two weeks! Should it be merged, closed, or further worked on? If you want to keep it open, please remove the |
…language # Conflicts: # src/navs/index.js
posthog-rs 0.29.0 ships experimental MCP Analytics behind the mcp feature, so a Rust server should use it instead of sending events by hand. The Rust install page is in #21600; link it from here once that merges.
There was a problem hiding this comment.
PostHog Review · Standard · reviewed 077109d: 2 Should fix.
See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.
PostHog Review found two gaps. An optional context argument still fails a validator whose schema sets additionalProperties: false, and the PHP SDK sends its queue inside capture() when the queue is full (QueueConsumer::enqueue, default lib_curl consumer), so capture is not always asynchronous.
The Rust SDK page lands in #21600; merge that first so the link resolves.
This PR may affect SEO/AEO@natalia-amorim, please review the items below before this PR merges. If Natalia is out, ask Ian or Andy to review instead. 🔍 Worth a look (1)
This comment updates on each push. The check reads the diff only, so it can miss problems or flag safe changes. If this is a false alarm, reply here so the check can improve. |
…eir page PHP's QueueConsumer flushes inside enqueue() at batch_size (100), not when the queue is full (max_queue_size drops). Found by independent verification.

Changes
MCP Analytics has SDKs for TypeScript, Python, Go, and Ruby. A team with an MCP server in another language (Java, Kotlin, C#, PHP, Elixir, Swift) reads the installation page and concludes that the product does not support them. That is not true. The dashboards read
$mcp_tool_callevents where$mcp_sourceis"posthog_mcp_analytics". They do not check which library sent the event.This PR adds a page that tells a person or a coding agent how to send those events from any language:
installation/other-languages.mdxcontextargument for intent, the session ID rules, the required and recommended properties of$mcp_tool_call, failure fields, a redaction checklist for payloads, flush, and a SQL query that checks the events.installation/index.mdxevents.mdxsrc/navs/index.jsThe content comes from the MCP analytics spec in sdk-specs and from the properties that the
mcp_analyticsbackend filters on. The page asks for a subset of the spec: what an SDK does automatically (conversation IDs, full redaction, the virtual tools) is listed at the end as "What the SDKs do that this page doesn't".This replaces the approach in #20249. That PR edits
custom-servers.mdxandinstallation.mdx, which no longer exist on master after the installation pages moved toinstallation/<language>.mdx.Checklist
vercel.json(no pages moved)Verification
missing_andbad_count was 0.JSONTypereturnsStringfor"false"andBoolforfalse, so the query flags a boolean or a number sent as a string.prettier --checkpasses on the changed files..mdversion returns 404 on the preview. The.mdversion of the existing Go page also returns 404 on the preview and 200 on posthog.com, so.mdpages exist only in production.Review
Two reviewers (Claude Opus and Claude Sonnet) checked the page against the spec and the backend. Changes from that review:
$mcp_intentand$mcp_error_messagewere sent without redaction when the reader skipped the optional payload step.$mcp_tool_callonly for the final outcome of a tool that exists. Do not send it for an unknown tool, aninput_requiredround, or a task handle.2026-07-28revision.$exceptionuses the samedistinct_idand$process_person_profileas the call event.$mcp_initializestep. The "MCP clients" and "MCP users and sessions" insights in the dashboard template count only that event.$mcp_tool_name.Not changed: the session hash. The page tells the reader to use any stable hash, and says that sessions split when an SDK and custom code serve the same session.
Update: I merged
masterinto this branch. The only conflict was the sidebar, wheremasteradded WebMCP. Both entries stay, and "Other languages" is last.posthog-rs0.29.0 now has experimental MCP Analytics, so the page no longer gives Rust as a language without an SDK. When #21600 merges, this page can link the Rust installation page.