Skip to content

feat(dashboards): add MCP tools for dashboard widgets (10/11)#60497

Merged
MattPua merged 9 commits into
masterfrom
05-28-feat_dashboards_add_mcp_tools_for_dashboard_widgets
Jun 3, 2026
Merged

feat(dashboards): add MCP tools for dashboard widgets (10/11)#60497
MattPua merged 9 commits into
masterfrom
05-28-feat_dashboards_add_mcp_tools_for_dashboard_widgets

Conversation

@MattPua
Copy link
Copy Markdown
Member

@MattPua MattPua commented May 28, 2026

Problem

Agents and MCP clients need programmatic access to dashboard widgets — catalog discovery, create/update, batch add, and batch run — using the same API surface the UI uses after the widget stack lands.

This PR is 10/11 in the dashboard widgets Graphite stack.

Depends on: PR 9 (#60496 — session replay dashboard widget)

Changes

  • products/dashboards/mcp/tools.yaml — widget catalog, add, update, batch add, and run tools wired to the dashboards product API
  • Regenerated MCP schemas, handlers, integration tests, and tool schema snapshots
  • Tool descriptions and request shapes updated for generic multi-type widget config (JSON payloads, not ET-only serializers)
  • Core MCP definition updates where shared with dashboards product

How did you test this code?

  • Agent: MCP unit/integration tests (services/mcp/tests/tools/dashboards.integration.test.ts, tool schema snapshots)

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Docs update

Add the skip-inkeep-docs label — agent playbook lands in #60516.

🤖 Agent context

  • MCP isolated so API/UI can ship and soak before exposing agent tools
  • Regenerated files updated via existing MCP codegen pipeline; polished after upstream single-patch save and generic config serializer changes
  • Cursor agent assisted on stack restacks and tool description alignment

@MattPua MattPua mentioned this pull request May 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

MCP UI Apps size report

App JS CSS
debug 478.6 KB 144.8 KB
action 353.1 KB 144.8 KB
action-list 360.9 KB 144.8 KB
cohort 352.1 KB 144.8 KB
cohort-list 359.9 KB 144.8 KB
error-details 373.5 KB 144.8 KB
error-issue 352.8 KB 144.8 KB
error-issue-list 360.8 KB 144.8 KB
experiment 357.3 KB 144.8 KB
experiment-list 361.7 KB 144.8 KB
experiment-results 359.4 KB 144.8 KB
feature-flag 438.0 KB 144.8 KB
feature-flag-list 442.5 KB 144.8 KB
feature-flag-testing 430.8 KB 144.8 KB
insight-actors 355.9 KB 144.8 KB
llm-costs 355.6 KB 144.8 KB
session-recording 353.9 KB 144.8 KB
session-summary 359.9 KB 144.8 KB
survey 353.7 KB 144.8 KB
survey-global-stats 358.5 KB 144.8 KB
survey-list 361.6 KB 144.8 KB
survey-stats 358.5 KB 144.8 KB
trace-span 352.5 KB 144.8 KB
trace-span-list 360.8 KB 144.8 KB
workflow 352.5 KB 144.8 KB
workflow-list 360.2 KB 144.8 KB
query-results 375.9 KB 144.8 KB
visual-review-snapshots 357.1 KB 144.8 KB

@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented May 28, 2026

Query snapshots: Backend query snapshots updated

Changes: 2 snapshots (1 modified, 1 added, 0 deleted)

What this means:

  • Query snapshots have been automatically updated to match current output
  • These changes reflect modifications to database queries or schema

Next steps:

  • Review the query changes to ensure they're intentional
  • If unexpected, investigate what caused the query to change

Review snapshot changes →

@MattPua MattPua force-pushed the 05-28-feat_dashboards_add_mcp_tools_for_dashboard_widgets branch from 3c208b6 to 7a76c6c Compare May 28, 2026 17:23
@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented May 28, 2026

Query snapshots: Backend query snapshots updated

Changes: 2 snapshots (1 modified, 1 added, 0 deleted)

What this means:

  • Query snapshots have been automatically updated to match current output
  • These changes reflect modifications to database queries or schema

Next steps:

  • Review the query changes to ensure they're intentional
  • If unexpected, investigate what caused the query to change

Review snapshot changes →

@MattPua MattPua force-pushed the 05-28-feat_dashboards_add_session_replay_dashboard_widget_and_batch_add_api branch from 694e167 to cb22c2b Compare May 28, 2026 18:51
@MattPua MattPua force-pushed the 05-28-feat_dashboards_add_mcp_tools_for_dashboard_widgets branch from d531957 to 67323bd Compare May 28, 2026 18:51
@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented May 28, 2026

Query snapshots: Backend query snapshots updated

Changes: 2 snapshots (1 modified, 1 added, 0 deleted)

What this means:

  • Query snapshots have been automatically updated to match current output
  • These changes reflect modifications to database queries or schema

Next steps:

  • Review the query changes to ensure they're intentional
  • If unexpected, investigate what caused the query to change

Review snapshot changes →

@MattPua MattPua force-pushed the 05-28-feat_dashboards_add_mcp_tools_for_dashboard_widgets branch from 9cd9da0 to 410ccdc Compare May 28, 2026 19:32
@MattPua MattPua force-pushed the 05-28-feat_dashboards_add_session_replay_dashboard_widget_and_batch_add_api branch from 4e2a8c2 to 322cca9 Compare May 28, 2026 19:32
@MattPua MattPua mentioned this pull request May 28, 2026
@MattPua MattPua force-pushed the 05-28-feat_dashboards_add_mcp_tools_for_dashboard_widgets branch from 410ccdc to cf1fe09 Compare May 28, 2026 19:35
@MattPua MattPua force-pushed the 05-28-feat_dashboards_add_session_replay_dashboard_widget_and_batch_add_api branch from 322cca9 to 1fcb621 Compare May 28, 2026 19:35
@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented May 28, 2026

⏭️ Skipped snapshot commit because branch advanced to cf1fe09 while workflow was testing 410ccdc.

The new commit will trigger its own snapshot update workflow.

If you expected this workflow to succeed: This can happen due to concurrent commits. To get a fresh workflow run, either:

  • Merge master into your branch, or
  • Push an empty commit: git commit --allow-empty -m 'trigger CI' && git push

@MattPua MattPua force-pushed the 05-28-feat_dashboards_add_mcp_tools_for_dashboard_widgets branch from cf1fe09 to bb15662 Compare May 28, 2026 19:39
@MattPua MattPua force-pushed the 05-28-feat_dashboards_add_session_replay_dashboard_widget_and_batch_add_api branch from 1fcb621 to 7edd67d Compare May 28, 2026 19:39
@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented May 28, 2026

⏭️ Skipped snapshot commit because branch advanced to bb15662 while workflow was testing cf1fe09.

The new commit will trigger its own snapshot update workflow.

If you expected this workflow to succeed: This can happen due to concurrent commits. To get a fresh workflow run, either:

  • Merge master into your branch, or
  • Push an empty commit: git commit --allow-empty -m 'trigger CI' && git push

@MattPua MattPua changed the title feat(dashboards): add MCP tools for dashboard widgets feat(dashboards): add MCP tools for dashboard widgets (9/10) May 28, 2026
@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented May 28, 2026

⏭️ Skipped snapshot commit because branch advanced to 56d18fa while workflow was testing bb15662.

The new commit will trigger its own snapshot update workflow.

If you expected this workflow to succeed: This can happen due to concurrent commits. To get a fresh workflow run, either:

  • Merge master into your branch, or
  • Push an empty commit: git commit --allow-empty -m 'trigger CI' && git push

@MattPua MattPua force-pushed the 05-28-feat_dashboards_add_mcp_tools_for_dashboard_widgets branch from 56d18fa to d374b34 Compare May 28, 2026 19:43
@MattPua MattPua force-pushed the 05-28-feat_dashboards_add_mcp_tools_for_dashboard_widgets branch from d88ec05 to 46da118 Compare June 1, 2026 17:39
@MattPua MattPua force-pushed the 05-28-feat_dashboards_add_session_replay_dashboard_widget_and_batch_add_api branch 2 times, most recently from f9e9c45 to 620fb89 Compare June 1, 2026 19:42
@MattPua MattPua marked this pull request as ready for review June 1, 2026 20:25
@assign-reviewers-posthog assign-reviewers-posthog Bot requested review from a team and hpouillot June 1, 2026 20:25
@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented Jun 1, 2026

Query snapshots: Backend query snapshots updated

Changes: 8 snapshots (7 modified, 1 added, 0 deleted)

What this means:

  • Query snapshots have been automatically updated to match current output
  • These changes reflect modifications to database queries or schema

Next steps:

  • Review the query changes to ensure they're intentional
  • If unexpected, investigate what caused the query to change

Review snapshot changes →

@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented Jun 2, 2026

Query snapshots: Backend query snapshots updated

Changes: 1 snapshots (1 modified, 0 added, 0 deleted)

What this means:

  • Query snapshots have been automatically updated to match current output
  • These changes reflect modifications to database queries or schema

Next steps:

  • Review the query changes to ensure they're intentional
  • If unexpected, investigate what caused the query to change

Review snapshot changes →

Copy link
Copy Markdown
Contributor

@vdekrijger vdekrijger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Generally with these MCP updates, it might be nice to set up the local posthog MCP and ask the LLM agent of your choice to generate a testing prompt with checkpoints and "success measurements" 😃.

In my experience it helped find some painpoints that are easier to mitigate before merging and that are tricky to cover in (integration) tests.

@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented Jun 3, 2026

Query snapshots: Backend query snapshots updated

Changes: 1 snapshots (1 modified, 0 added, 0 deleted)

What this means:

  • Query snapshots have been automatically updated to match current output
  • These changes reflect modifications to database queries or schema

Next steps:

  • Review the query changes to ensure they're intentional
  • If unexpected, investigate what caused the query to change

Review snapshot changes →

@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented Jun 3, 2026

Query snapshots: Backend query snapshots updated

Changes: 1 snapshots (1 modified, 0 added, 0 deleted)

What this means:

  • Query snapshots have been automatically updated to match current output
  • These changes reflect modifications to database queries or schema

Next steps:

  • Review the query changes to ensure they're intentional
  • If unexpected, investigate what caused the query to change

Review snapshot changes →

@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented Jun 3, 2026

Query snapshots: Backend query snapshots updated

Changes: 1 snapshots (1 modified, 0 added, 0 deleted)

What this means:

  • Query snapshots have been automatically updated to match current output
  • These changes reflect modifications to database queries or schema

Next steps:

  • Review the query changes to ensure they're intentional
  • If unexpected, investigate what caused the query to change

Review snapshot changes →

@tests-posthog
Copy link
Copy Markdown
Contributor

tests-posthog Bot commented Jun 3, 2026

⏭️ Skipped snapshot commit because branch advanced to 02b36ff while workflow was testing dafe105.

The new commit will trigger its own snapshot update workflow.

If you expected this workflow to succeed: This can happen due to concurrent commits. To get a fresh workflow run, either:

  • Merge master into your branch, or
  • Push an empty commit: git commit --allow-empty -m 'trigger CI' && git push

expose widget catalog, batch add, run, and tile copy via MCP without
the unrelated tool-schema snapshot directory refactor
MattPua and others added 5 commits June 3, 2026 14:22
Server checks used team id as distinct_id while the flag rolls out on
user cohorts. Evaluate with user distinct_id and project/org groups.
Batch-add and run widget MCP tools require the dashboard-widgets feature
flag on the test project. Mirror the logs-alerts integration setup.

Co-authored-by: Cursor <cursoragent@cursor.com>
MCP integration tests run against Django with POSTHOG_FEATURE_FLAGS_FORCE_ENABLED
for logs-alerting only. dashboard_widgets_enabled() bypassed that path, so
creating the flag from the test process never affected the server process.

Co-authored-by: Cursor <cursoragent@cursor.com>
@socket-security
Copy link
Copy Markdown

socket-security Bot commented Jun 3, 2026

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

tests-posthog Bot and others added 3 commits June 3, 2026 19:25
withPostHogUrl returns project-scoped absolute links; use toContain
like the other dashboard integration assertions

Co-authored-by: Cursor <cursoragent@cursor.com>
CI force-enables the flag via POSTHOG_FEATURE_FLAGS_FORCE_ENABLED; the
MCP feature-flag PATCH in beforeAll 500s locally and is redundant

Co-authored-by: Cursor <cursoragent@cursor.com>
@deployment-status-posthog
Copy link
Copy Markdown

deployment-status-posthog Bot commented Jun 3, 2026

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-06-03 21:11 UTC Run
prod-us ✅ Deployed 2026-06-03 23:09 UTC Run
prod-eu ✅ Deployed 2026-06-03 21:58 UTC Run

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants