Repository navigation
feat(mcp): set $mcp_interface on mcp analytics events - #1032
Conversation
Generated-By: PostHog Desktop Task-Id: 651bf7d9-01f4-4d75-8583-868e29fdd314
|
[Medium risk] Adds a property to MCP server analytics events. The PR appears safe to merge. Reviews (1) · Last reviewed commit: "feat(mcp): add interface property to ser..." · Reviewed by Greptile |
posthog-python Compliance ReportDate: 2026-10-07T12:36:45.119958+00:00 ✅ All Tests Passed!121/121 tests passed Capture_V1 Tests✅ 95/95 tests passed View Details
Capture_Ai Tests✅ 5/5 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
Feature_Flags_Local_Evaluation Tests✅ 4/4 tests passed View Details
|
There was a problem hiding this comment.
Not approved — this change needs a human reviewer.
Re-adding the stamphog label gives the same result unless the changed files change.
Stamphog can't auto-review this pull request because two gates refused it. The deny-list gate matched public_api, since the change adds a new INTERFACE attribute in posthog/mcp/constants.py and a matching line in references/public_api_snapshot.txt. The tier gate classified it as T2-never (a cross-cutting feature across 5 files), which is a category that is never handled automatically.
Size was not the problem, so splitting the PR won't change the outcome. The author should ask a human reviewer, ideally someone who owns the public API surface of the MCP module, to review it.
- 👍 on the PR from greptile-apps[bot].
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✗ | matches: public_api |
| size | ✓ | 8L, 2F substantive, 16L/5F incl. docs/generated/snapshots — within ceiling |
| tier | ✗ | classified as T2-never: T2-never (16L, 5F, cross-cutting, feat) |
| stamphog 2.4.1 | .stamphog/policy.yml @ unknown · reviewed head 5ad2cb9 |
feat(mcp): add interface property to server events Generated-By: PostHog Desktop Task-Id: 651bf7d9-01f4-4d75-8583-868e29fdd314 (cherry picked from commit a3bd254)
* feat(mcp): set $mcp_interface on mcp analytics events (#1032) feat(mcp): add interface property to server events Generated-By: PostHog Desktop Task-Id: 651bf7d9-01f4-4d75-8583-868e29fdd314 (cherry picked from commit a3bd254) * chore: Release v7.67.1 [skip ci] (cherry picked from commit 4ae3d26) * Update generated references (cherry picked from commit 492d71b) * feat(integrations): align request middleware configuration (#1040) * Align ASGI and Flask integration defaults * feat(integrations): align request middleware configuration (cherry picked from commit 2f0d67d) * chore: Release v7.68.0 [skip ci] (cherry picked from commit ad553de) * Update generated references (cherry picked from commit 90f8d69) * chore(deps): bump the uv group across 2 directories with 3 updates (#1042) Bumps the uv group with 1 update in the /examples/example-ai-llamaindex directory: [banks](https://github.com/masci/banks). Bumps the uv group with 2 updates in the /examples/example-ai-pydantic-ai directory: [pydantic-ai](https://github.com/pydantic/pydantic-ai) and [pydantic-ai-slim](https://github.com/pydantic/pydantic-ai). Updates `banks` from 2.4.5 to 2.5.1 - [Release notes](https://github.com/masci/banks/releases) - [Commits](masci/banks@v2.4.5...v2.5.1) Updates `pydantic-ai` from 1.102.0 to 1.107.7 - [Release notes](https://github.com/pydantic/pydantic-ai/releases) - [Changelog](https://github.com/pydantic/pydantic-ai/blob/main/docs/changelog.md) - [Commits](pydantic/pydantic-ai@v1.102.0...v1.107.7) Updates `pydantic-ai-slim` from 1.102.0 to 1.107.7 - [Release notes](https://github.com/pydantic/pydantic-ai/releases) - [Changelog](https://github.com/pydantic/pydantic-ai/blob/main/docs/changelog.md) - [Commits](pydantic/pydantic-ai@v1.102.0...v1.107.7) --- updated-dependencies: - dependency-name: banks dependency-version: 2.5.1 dependency-type: indirect dependency-group: uv - dependency-name: pydantic-ai dependency-version: 1.107.7 dependency-type: direct:production dependency-group: uv - dependency-name: pydantic-ai-slim dependency-version: 1.107.7 dependency-type: indirect dependency-group: uv ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit ee686ff) * test(django): read the middleware context test's event after defaults fill On v1, context properties are filled inside _enqueue, before before_send. The test patched _enqueue itself, so it saw the event before the fill and lost $request_path and role. It now records the event in before_send. The assertions are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix: redirect origin and logging fixes from review; scope AI routing docs - Compare redirect origins as requests sends them, so a Unicode host matches its IDNA form. - Log a refused or exhausted capture redirect at debug; failed-batch reporting owns warnings. - The migration guide says the OpenTelemetry integration still exports to /i/v0/ai/otel. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Georgis Andonis <[email protected]> Co-authored-by: releaser-posthog-python[bot] <262414804+releaser-posthog-python[bot]@users.noreply.github.com> Co-authored-by: Hugues Pouillot <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <[email protected]>
💡 Motivation and Context
Why: WebMCP events identify their interface, but MCP server events do not. This gap prevents one consistent interface breakdown.
This change sets
$mcp_interfacetomcpon MCP server events and their$exceptionsiblings. It also adds a patch changeset.The shared MCP Analytics specification permits this property but does not define it yet.
💚 How did you test it?
posthogwith warnings treated as errors.📝 Checklist
If releasing new changes
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Codex in PostHog Desktop implemented and tested this change. The value
mcppairs with the existingwebmcpvalue.Created with PostHog Desktop