feat(replay vision): add MCP get tools#60127
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
🎭 Playwright didn't run on this PR — your changes touch code that could affect E2E behavior, but Playwright is opt-in via label now to keep CI cost down. Add the Most PRs don't need this. Real regressions still get caught on master and fix-forward. |
MCP UI Apps size report
|
|
Size Change: 0 B Total Size: 80.2 MB ℹ️ View Unchanged
|
6bccc8b to
5150414
Compare
There was a problem hiding this comment.
This PR modifies OAuth scope visibility in posthog/scopes.py (removing replay_scanner from OAUTH_HIDDEN_SCOPE_OBJECTS), which is an auth/authorization contract change that triggered the deny-list gate. It has zero reviews and the scope change has security implications for what OAuth clients can discover and request. A human reviewer needs to sign off on this.
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
services/mcp/src/tools/generated/replay_vision.ts:113-116
The `session_id` check is superfluous: the Zod schema merges `VisionScannersObserveCreateBody` whose `session_id` field is required (not `.optional()`), so `params.session_id` is guaranteed to be a string by the time the handler executes. The conditional never evaluates to `false` and misleads readers into thinking the field might be absent.
```suggestion
const body: Record<string, unknown> = {
session_id: params.session_id,
}
```
Reviews (1): Last reviewed commit: "chore: update OpenAPI generated types" | Re-trigger Greptile |
| const body: Record<string, unknown> = {} | ||
| if (params.session_id !== undefined) { | ||
| body['session_id'] = params.session_id | ||
| } |
There was a problem hiding this comment.
The
session_id check is superfluous: the Zod schema merges VisionScannersObserveCreateBody whose session_id field is required (not .optional()), so params.session_id is guaranteed to be a string by the time the handler executes. The conditional never evaluates to false and misleads readers into thinking the field might be absent.
| const body: Record<string, unknown> = {} | |
| if (params.session_id !== undefined) { | |
| body['session_id'] = params.session_id | |
| } | |
| const body: Record<string, unknown> = { | |
| session_id: params.session_id, | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: services/mcp/src/tools/generated/replay_vision.ts
Line: 113-116
Comment:
The `session_id` check is superfluous: the Zod schema merges `VisionScannersObserveCreateBody` whose `session_id` field is required (not `.optional()`), so `params.session_id` is guaranteed to be a string by the time the handler executes. The conditional never evaluates to `false` and misleads readers into thinking the field might be absent.
```suggestion
const body: Record<string, unknown> = {
session_id: params.session_id,
}
```
How can I resolve this? If you propose a fix, please make it concise.
PR overviewAll previously flagged issues have been addressed. No open security concerns remain on this pull request. Security reviewNo open security issues remain on this pull request. Fixed/addressed: 1 · PR risk: 0/10 |
5150414 to
611da60
Compare
TueHaulund
left a comment
There was a problem hiding this comment.
LGTM - maybe check the "AI consent gate" issue raised by one of the bots though
fd98823 to
2a5b37e
Compare

Problem
Changes
Add round of MCP tools for simple get/list tools for Vision/Scanners
How did you test this code?
Claude Desktop
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Publish to changelog?
Docs update
🤖 Agent context