Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(mcp): add in-app MCP hint toasts and empty-state cards with opt-out setting (#59126)

Rafael Audibert7ff084a34cd7
diff --git a/.agents/skills/django-migrations/SKILL.md b/.agents/skills/django-migrations/SKILL.md
index c9b5bdc72eab..a53b95aaacb3 100644
--- a/.agents/skills/django-migrations/SKILL.md
+++ b/.agents/skills/django-migrations/SKILL.md
@@ -24,7 +24,12 @@ If the task is a ClickHouse migration, use `clickhouse-migrations` instead.
## Cross-language `NOT NULL` hazard
-Django's `default=list`/`default=dict`/`default=<callable>` is applied in Python only — Postgres sees the column as `NOT NULL` with no column `DEFAULT`. If the table is also written by a non-Django writer (plugin-server `nodejs/`, `rust/`, Temporal workers, ad-hoc scripts), raw-SQL inserts that omit the new column will fail the `NOT NULL` constraint.
+`posthog_user`, `posthog_team`, and other core tables in the main Postgres database are written by Django **and** by `nodejs/` (plugin-server tests via `insertRow`), `rust/` services, and Temporal workers. Those non-Django writers issue raw `INSERT`s that only list the columns they care about, so any new `NOT NULL` column without a Postgres-level `DEFAULT` will break them with `null value in column "<col>" violates not-null constraint`.
+
+Django's `default=` alone does **not** create a Postgres-level default — by design, Django treats it as a Python-only attribute applied at `Model.__init__`:
+
+- **Callable defaults** (`default=list`, `default=dict`, `default=uuid.uuid4`) are never emitted into SQL at all.
+- **Scalar defaults** (`default=False`, `default=0`, `default=""`) are emitted as `ADD COLUMN ... DEFAULT X NOT NULL` and then immediately dropped by a follow-up `ALTER COLUMN ... DROP DEFAULT` — verify with `./manage.py sqlmigrate`.
Before merging, grep for external writers of the table:
@@ -32,7 +37,18 @@ Before merging, grep for external writers of the table:
rg -n "INSERT INTO <table>|insertRow\(.*'<table>'" nodejs rust products services
```
-If any match, either update those writers to set the column, or set a Postgres-level default in the same migration:
+If any match, add **both** `default=` and `db_default=` to the model field. `db_default=` lands a real Postgres `DEFAULT`; `default=` keeps the Python-side value for ORM creates:
+
+```python
+class User(models.Model):
+ hide_mcp_hints = models.BooleanField(default=False, db_default=False, null=False)
+```
+
+`makemigrations` will emit a plain `AddField(..., db_default=False, default=False, ...)`, and `sqlmigrate` shows just `ADD COLUMN ... DEFAULT false NOT NULL` — no `DROP DEFAULT` follow-up.
+
+`db_default=` is also load-bearing for the nodejs / rust test suites. `posthog/management/commands/setup_test_environment.py` calls `disable_migrations()` and builds the test schema directly from model definitions, skipping the migration entirely. Plain `default=` is invisible to that path; `db_default=` is what Django bakes into the generated `CREATE TABLE`. Without it, the `postgres-parity` and Jest jobs in `.github/workflows/ci-nodejs.yml` will fail on raw `INSERT`s even though `./manage.py migrate` looks correct in isolation.
+
+For modifying the default on an existing column (no `ADD COLUMN`), use a plain `RunSQL` instead:
```python
migrations.RunSQL(
@@ -40,3 +56,5 @@ migrations.RunSQL(
reverse_sql="ALTER TABLE <table> ALTER COLUMN <col> DROP DEFAULT;",
)
```
+
+Always verify with `./manage.py sqlmigrate <app> <number>` that no stray `DROP DEFAULT` slipped through, and confirm `./manage.py makemigrations --dry-run` reports no state drift.
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 86cfc47896fe..fa9288bba418 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -764,6 +764,46 @@ snapshots:
hash: v1.k794b7964.f0d1a421636fd514a006c43ba1d8b21322af048e84ca99a874cf90671e147bb4.7zakEU0v42lQJnldEmtQkZ-qqYEsFcNe8DEnyFiweac
components-markdown-editor-rich--with-markdown--light:
hash: v1.k794b7964.a73d574094e4664a4cfe8a28bbb74d6bf7d6b7cbe0b5f05aeb3a11fc42a8109e.fHAFZolNByYE1LYlKSbW0YVDUxDdmt31lCq06SkXjYA
+ components-mcp-hint-toast--annotations-create--dark:
+ hash: v1.k794b7964.e8923b86b03653fdd9dd1e001005b306988c37d8c4c5586f308e55e9ac0328bd.iVTGO2Lj2EPrEvqK1-AL07Z5Ad9uFtKuKLfE7lhYSH8
+ components-mcp-hint-toast--annotations-create--light:
+ hash: v1.k794b7964.1e4136d99c4ce39a8fd3e015b4a0158fd08cf78192d414db2810692f254b921a.a-8M_Eh9hsmax5NB7pzGqPBDgN5R5pprokV4Cpb3420
+ components-mcp-hint-toast--dashboards-create--dark:
+ hash: v1.k794b7964.5c76e67dd52c29e4aab44804af991cb56fa62b52d6f7ccbca400ebeb68bb3559.AQDTwhI54JFBo1vfGYlq4hB-WW9Cnyz0lxitzvgyfwU
+ components-mcp-hint-toast--dashboards-create--light:
+ hash: v1.k794b7964.8b81e21a229e04aabc535f1a472f20313d73479ff6c8caca7a425b1558a57ce9.Ojv2DKaC5hSV1CEkJTfRHbafXgICJrJnhDMN_n01RK0
+ components-mcp-hint-toast--experiments-create--dark:
+ hash: v1.k794b7964.98f11b76ee386d0b410e539165e3ad8829ec3d219200d18b27c54d654af4b26c.PzNNTzffL7fdmoz_KEfMWQKCV5lPqjBLdtx5g8NRuD4
+ components-mcp-hint-toast--experiments-create--light:
+ hash: v1.k794b7964.a5d118a3460acb1b797fd9bfde641ebd9c7005cc5ab5737a7d418d6e9548137f.pE0DYITm_o3B0Pl8P1pJRU-vl1rUOOodC9Di7FiFLjY
+ components-mcp-hint-toast--feature-flags-create--dark:
+ hash: v1.k794b7964.1c3698ce687f72d569f86d58b5dddf6d34144a348b65aa8b94e8d21acfdf93b2.fkvxwpKvMy6nsAonmJ8NI0t-A-98LtsTw62jm_4Bnt0
+ components-mcp-hint-toast--feature-flags-create--light:
+ hash: v1.k794b7964.8c58c34432209f5ee2a55ed3997d55348c73c799a62de416607b37dc8664228c.s7wM0MbZHvjyqTmlb61AzZD_h58Gcg_fBPN-S_W_fxI
+ components-mcp-hint-toast--sql-execute--dark:
+ hash: v1.k794b7964.9abc853af0736adc72919e4dd7e77f26323b31bb46c76ac409a3af661533e0e4.rdIk5psJPWxrVlch4TQns3n2EibbetxnAhs1AT4Gbmw
+ components-mcp-hint-toast--sql-execute--light:
+ hash: v1.k794b7964.6784bf784ab4d595b262e4a49d1e7aab97b65225746765ea1904c69e36f6e6d7.QRX0Ocd6tQF6HgHZP-Ksvhf6GxfrQ36g2Nr66Q5NwHY
+ components-mcp-use-case-card--dashboards-create--dark:
+ hash: v1.k794b7964.04af6fe4522114ae4379f75652bb570502bbcf209c46d867c58d4721dcbd8fe1.uQg2NWTmlhzWD6u_zntj4laVkntPlyqBD56cX-qp0QE
+ components-mcp-use-case-card--dashboards-create--light:
+ hash: v1.k794b7964.98904b53a44dea751589172851e9e3322078fa28a3679acc460a9cb20d6b3114.xjXmNvH0Zl6FdygK7e_owJo3hyPMUJESFOtihyeNLlA
+ components-mcp-use-case-card--experiments-create--dark:
+ hash: v1.k794b7964.4ede81e14ae124abd4d3391aa6567ac1626855c0cf3c1a11fa85e55fcc90f079.CjXzpRpx5ieOn0l8Dxibw3ydpBxs5esHJy9okJ5Cv4A
+ components-mcp-use-case-card--experiments-create--light:
+ hash: v1.k794b7964.1c515e7615430073079e8594504fabd65d531779be92e34c955339ebe4715b50.oMqna3JbwTFaVR0HDASPp1eSQw7STYuK0ps7nCHfJPQ
+ components-mcp-use-case-card--feature-flags-create--dark:
+ hash: v1.k794b7964.64093d9f50efdbe3ecbb1c67e8ec3bf6db297721557a1dd54ea786f095a45c24.w-VCPrf_vdRt3TxCnnp7NCsv0nrxuHBHwCDEKPFlq4s
+ components-mcp-use-case-card--feature-flags-create--light:
+ hash: v1.k794b7964.fe502cf912ab060d610d5d9d0311bd68104258ebaafcc204db39f10d13766c8e.W6nEdOUfZlfwKhigQm5e2KOk2b5dHVO3vU8w8jWZ8vI
+ components-mcp-use-case-card--insights-create--dark:
+ hash: v1.k794b7964.d1434c786607215c801473467a357a9618fda47427430e6cdfc44ecffdd04caf.DQhNZT4lvzh2XZfXT6wpQ-nFpa6RdY8U-RVI5IGnZ_E
+ components-mcp-use-case-card--insights-create--light:
+ hash: v1.k794b7964.040adaeb7d81194d0d7c6066d065a761c6697d98b774082f3fbf56adaa7c4c05.bwY3U88xvY2IE07rM1dPjBvztzS9NlCCIYsvFM7r2jk
+ components-mcp-use-case-card--surveys-create--dark:
+ hash: v1.k794b7964.606cdb1a08cd4fbc1c850096762d999c55ecd616aad0ff169eb413581b2b67ec.HjfMQSGB1aJiR0xOi2kEj7-cF9BDksxvhnawmayJsQ8
+ components-mcp-use-case-card--surveys-create--light:
+ hash: v1.k794b7964.846d0ba248549a9039f905d6ccdbc66d23669f66d49018db039be53e2603414a.XCmKKI8ul7EsB2gB6GIpeaelV-il2E4Z9mQunZeo3gQ
components-networkrequest-navigationitem--all-slow--dark:
hash: v1.k794b7964.dfb07d610a242b405a6d316fecc1bdc0a835e5b7ddbf9d726aa3d885d2014263.-TxK4llCU_MYExSlllCk4xm9lBU4lNVsUMdbeASW9hA
components-networkrequest-navigationitem--all-slow--light:
@@ -3941,7 +3981,7 @@ snapshots:
scenes-app-dashboards-add-insight-to-dashboard-modal--empty--dark:
hash: v1.k794b7964.aa907ef6ddbe506e4f06718a3b5d6ca0404c3813ca43a37fe231ed5f61cc0be6.RjW449wpFHeHHrcX9oYJdsbClM0jQe_u60RctdrEngs
scenes-app-dashboards-add-insight-to-dashboard-modal--empty--light:
- hash: v1.k794b7964.3403ebd7da54070f50eb9c956dcca9e95313cbbb0c127ac8dc7b446b86e54761.k6w2NTLihNLmY6GYIs0sEkHSQyMinz9azYe9NiNyIHk
+ hash: v1.k794b7964.43bf0a36745e99ae818f7e2c0f95aab3a781a0234e753298ec84f4c59d6d7b1c.p13KuOgGQA1FsokVeY9_WAamMMxcy2_imxKGgpi9_n8
scenes-app-dashboards-add-insight-to-dashboard-modal--with-more-insight-types--dark:
hash: v1.k794b7964.3ef8fdec77a31e9262b99e502fed61e86fba657ace14bbbdd58ea2bc773de700.WrA7wFosW1QOQrrt7c0dA-q0UjOLpB1Icidd-rOOQJY
scenes-app-dashboards-add-insight-to-dashboard-modal--with-more-insight-types--light:
@@ -5315,9 +5355,9 @@ snapshots:
scenes-app-revenue-analytics-onboarding--onboarding-with-viewset-feature-flag--light:
hash: v1.k794b7964.47bc7aaea343941c10f5c9fcc3c149f4d5860fc2bbb3f767840933e52e8f366f.BY14V-fscnhYoCzW0DK7Neuq1MWDPMCO-VuGFwGvbRA
scenes-app-saved-insights--empty-state--dark:
- hash: v1.k794b7964.2720dca1c3ea78610ec21009d817285dc6c87ef671cd60d7cb3e62395fb22709.DSV72IWt-o1gYlFekEuWjYeBLPDonrtxl56Xy3G2mnI
+ hash: v1.k794b7964.02e612d470d4520056275e3817d6eb0384ee1930f60185215cc9876d6ad0b43c.IPW7njxdxVBMhc9kzmU6oPNrVT4hUn0mIlOyijjwnec
scenes-app-saved-insights--empty-state--light:
- hash: v1.k794b7964.9037fc9bd33af439d581fb8aadee12a443b385626163d6bf9c2b3833675b6b5b.Tvi9ZdrAtcu9KE-lCCvstnazcPpTtK79Y9qGMpQQqvs
+ hash: v1.k794b7964.ed687bc09d9c68dc37e24ede4905fed79477d53103271a7ec3fc6316a57b6e8e.__HcA8_01GjN7iiOR4h4Wrkj16boWUNryxYihHjA6iQ
scenes-app-saved-insights--list-view--dark:
hash: v1.k794b7964.fe9ac0046cfcdf0e50fba6cc0d2575a0447bfd069acdd401b77919595b89ac3b.A_N1f-qNl-GHNLgK9YUarO8HHnUVaphuCJZjqGovebs
scenes-app-saved-insights--list-view--light:
@@ -5503,9 +5543,9 @@ snapshots:
scenes-app-settings-user--settings-user-profile--light:
hash: v1.k794b7964.882936d2e8743f9a1b0dc9d24ff0cea37d4dfb1dab985ac0c89f59388b04813c.zkRsloEOWPiqdw-0kEkhXNXWqst2iBzFz4rl3-7RG5s
scenes-app-sidepanels--side-panel-access-control--dark:
- hash: v1.k794b7964.fde2110df6d61f716d645f00db3e61fab2afa990217e43d5d4e2f93b893b2c87.m2QPf8sq6l1ygjrbOVCgIIUJ_a4IPzsC2qr9xftoSFI
+ hash: v1.k794b7964.96a98335ae32b8f6f68285b320326a21e3a89f338461597bc5e8d26b98e232e3.iG8-nEzaS8lBK7tpEdOkBF1O9GzHJnWkDzGYLV6r6Go
scenes-app-sidepanels--side-panel-access-control--light:
- hash: v1.k794b7964.9e8e6ff0e97dd4d4d63f4dbad07291a33c98ed239a9fe4b7feada0b63dac50a5.wzXX3cMc2HGa9cc8xFMREiyp9zItN-bBx_GKm3315IM
+ hash: v1.k794b7964.d5655a0442cc4a9a42c2bbefc721747553423e349074c48a11f8dcf70568c2a3.H-l4VRYAb0fxNQjYpVenFuCmm42_mxA89xKl9f1qnH4
scenes-app-sidepanels--side-panel-activity--dark:
hash: v1.k794b7964.d6a0c12a419ad2e18ca3a87b9d6d88aba4fca193b5736a875b91948226ad7c64.COTA7OqniWK5OwBt7im51DsaC3mDFtTiul7hGhwWU_Y
scenes-app-sidepanels--side-panel-activity--light:
@@ -5519,21 +5559,21 @@ snapshots:
scenes-app-sidepanels--side-panel-exports--light:
hash: v1.k794b7964.c9bbcb89d27fc0274dfb32aa7b4b592451bbce89604b3ea6838bc8ffd2d1e55a.hwFqNOtsfT_rsA0VJZtApfrC6gw31QZasi0ZucClSHI
scenes-app-sidepanels--side-panel-info--dark:
- hash: v1.k794b7964.fde2110df6d61f716d645f00db3e61fab2afa990217e43d5d4e2f93b893b2c87.vcy709v-Te5zbXCNyHXYHHCVzVySy-W84stAYpHVl9g
+ hash: v1.k794b7964.96a98335ae32b8f6f68285b320326a21e3a89f338461597bc5e8d26b98e232e3.gpithVKsM5IgImdq2wv4ee3YbIoY6V0pnqLfEKNwtKo
scenes-app-sidepanels--side-panel-info--light:
- hash: v1.k794b7964.a8eca9046abaf4f4326f9fe5549b53606049680b4c36c62a9e1b52a560f07307.L_brl4T-I3sYVr6Z1TfETaxs4Yeu7NJsTLe7WFIyW-I
+ hash: v1.k794b7964.d5655a0442cc4a9a42c2bbefc721747553423e349074c48a11f8dcf70568c2a3.F5Xmrqvq98aJQp84jLk3mbzyhTKYaE2-1dHNeOpD9IY
scenes-app-sidepanels--side-panel-max--dark:
- hash: v1.k794b7964.fde2110df6d61f716d645f00db3e61fab2afa990217e43d5d4e2f93b893b2c87.A2eZlpQrDuzR2xthx8GGRqdKUiGPLVPj42bx8vcrotQ
+ hash: v1.k794b7964.96a98335ae32b8f6f68285b320326a21e3a89f338461597bc5e8d26b98e232e3.2P3Soig01ssPAgUeOnHTwKnPmkXEFLJT1XwlkJTjsMI
scenes-app-sidepanels--side-panel-max--light:
- hash: v1.k794b7964.3f257438f2d81edcb7a05179c7d2de70c549ea213d895a2a231319c813563f74.4Hf-qiBGE0wVOmV4aXD0xLvfNmFCkM7pSCMXTAPcD7U
+ hash: v1.k794b7964.d5655a0442cc4a9a42c2bbefc721747553423e349074c48a11f8dcf70568c2a3.L7rSvBCDrtIxLkVE1NbyRsAuennxvQjUbTD6lYNop4Y
scenes-app-sidepanels--side-panel-notebooks--dark:
hash: v1.k794b7964.52706b247c2968cf54e48d58d4d65e34f19e7a4bed2a1719ba8970d4f3c7c1aa.GWO5g8DSrLhGKVymVfPWCTVOCW29JHWYAi0OZlnFiSk
scenes-app-sidepanels--side-panel-notebooks--light:
hash: v1.k794b7964.6b03bcd66331259f527b65568868dc845d4658c0bcc031ed45bb55b7b7847789.F9vew1h38SQ141i5xQLWKZWiVpb-LLNyDrOI1wG-fQI
scenes-app-sidepanels--side-panel-settings--dark:
- hash: v1.k794b7964.fde2110df6d61f716d645f00db3e61fab2afa990217e43d5d4e2f93b893b2c87.cX3GpE8yIRAwtofc1eHJoIQXe_-PF-kHeMB3eL2YO2Q
+ hash: v1.k794b7964.f57d2042efda668c50b26969e4335216d27558245d531d2522e7faff48de0eaf.xMwFsyxwL-JWgUlX29lGtOlm65ekb9diClFuhZ1hdbE
scenes-app-sidepanels--side-panel-settings--light:
- hash: v1.k794b7964.8a4a1d48d8026f09784cfe912bbada26978eb55b2405c1f0689debe519d54a07.mf430BTzJcsYEnwSM_9kAVlyhtepUS1LsgpkLOTGM8I
+ hash: v1.k794b7964.00460504259896436356e9092f79a8e2e09f9302dd4873df96ae319da7477220.yac-Ww554D0Hnjc6LiislOlnV_3-q6H6WQ4Tin1fsT8
scenes-app-sidepanels--side-panel-support--dark:
hash: v1.k794b7964.25d3bc059468d880d315a0a19b446435fef1fcdf80075784d26be323295a7839.XVlGukNTQVTyeonIxb3lERnTcOpzwj9MFk8pLjLwzvQ
scenes-app-sidepanels--side-panel-support--light:
diff --git a/frontend/src/generated/core/api.schemas.ts b/frontend/src/generated/core/api.schemas.ts
index 4d909de744d7..dd61180625c9 100644
--- a/frontend/src/generated/core/api.schemas.ts
+++ b/frontend/src/generated/core/api.schemas.ts
@@ -3099,6 +3099,8 @@ export interface UserApi {
* @nullable
*/
passkeys_enabled_for_2fa?: boolean | null
+ /** When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions. */
+ hide_mcp_hints?: boolean
/** @nullable */
readonly onboarding_skipped_at: string | null
readonly onboarding_skipped_reason: OnboardingSkippedReasonEnumApi | null
@@ -3197,6 +3199,8 @@ export interface PatchedUserApi {
* @nullable
*/
passkeys_enabled_for_2fa?: boolean | null
+ /** When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions. */
+ hide_mcp_hints?: boolean
/** @nullable */
readonly onboarding_skipped_at?: string | null
readonly onboarding_skipped_reason?: OnboardingSkippedReasonEnumApi | null
diff --git a/frontend/src/generated/core/api.zod.ts b/frontend/src/generated/core/api.zod.ts
index 9bfb847109ba..80598829e4b0 100644
--- a/frontend/src/generated/core/api.zod.ts
+++ b/frontend/src/generated/core/api.zod.ts
@@ -2954,6 +2954,12 @@ export const UsersUpdateBody = /* @__PURE__ */ zod.object({
.describe(
'Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.'
),
+ hide_mcp_hints: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'
+ ),
})
/**
@@ -3033,6 +3039,12 @@ export const UsersPartialUpdateBody = /* @__PURE__ */ zod.object({
.describe(
'Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.'
),
+ hide_mcp_hints: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'
+ ),
})
export const usersHedgehogConfigPartialUpdateBodyFirstNameMax = 150
@@ -3109,6 +3121,12 @@ export const UsersHedgehogConfigPartialUpdateBody = /* @__PURE__ */ zod.object({
.describe(
'Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.'
),
+ hide_mcp_hints: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'
+ ),
})
/**
@@ -3246,6 +3264,12 @@ export const UsersScenePersonalisationCreateBody = /* @__PURE__ */ zod.object({
.describe(
'Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.'
),
+ hide_mcp_hints: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'
+ ),
})
/**
@@ -3325,6 +3349,12 @@ export const UsersTwoFactorBackupCodesCreateBody = /* @__PURE__ */ zod.object({
.describe(
'Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.'
),
+ hide_mcp_hints: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'
+ ),
})
/**
@@ -3404,6 +3434,12 @@ export const UsersTwoFactorDisableCreateBody = /* @__PURE__ */ zod.object({
.describe(
'Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.'
),
+ hide_mcp_hints: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'
+ ),
})
export const usersTwoFactorValidateCreateBodyFirstNameMax = 150
@@ -3480,6 +3516,12 @@ export const UsersTwoFactorValidateCreateBody = /* @__PURE__ */ zod.object({
.describe(
'Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.'
),
+ hide_mcp_hints: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'
+ ),
})
export const usersValidate2faCreateBodyFirstNameMax = 150
@@ -3556,6 +3598,12 @@ export const UsersValidate2faCreateBody = /* @__PURE__ */ zod.object({
.describe(
'Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.'
),
+ hide_mcp_hints: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'
+ ),
})
export const usersCancelEmailChangeRequestPartialUpdateBodyFirstNameMax = 150
@@ -3632,6 +3680,12 @@ export const UsersCancelEmailChangeRequestPartialUpdateBody = /* @__PURE__ */ zo
.describe(
'Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.'
),
+ hide_mcp_hints: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'
+ ),
})
export const usersRequestEmailVerificationCreateBodyFirstNameMax = 150
@@ -3708,6 +3762,12 @@ export const UsersRequestEmailVerificationCreateBody = /* @__PURE__ */ zod.objec
.describe(
'Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.'
),
+ hide_mcp_hints: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'
+ ),
})
export const usersVerifyEmailCreateBodyFirstNameMax = 150
@@ -3784,4 +3844,10 @@ export const UsersVerifyEmailCreateBody = /* @__PURE__ */ zod.object({
.describe(
'Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.'
),
+ hide_mcp_hints: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'
+ ),
})
diff --git a/frontend/src/layout/navigation-3000/Navigation.tsx b/frontend/src/layout/navigation-3000/Navigation.tsx
index 60e59fcb304c..678357276607 100644
--- a/frontend/src/layout/navigation-3000/Navigation.tsx
+++ b/frontend/src/layout/navigation-3000/Navigation.tsx
@@ -3,6 +3,7 @@ import './Navigation.scss'
import { useActions, useMountedLogic, useValues } from 'kea'
import { ReactNode, useCallback, useEffect, useRef } from 'react'
+import { mcpHintLogic } from 'lib/components/MCPHint/mcpHintLogic'
import { ScrollableShadows } from 'lib/components/ScrollableShadows/ScrollableShadows'
import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { cn } from 'lib/utils/css-classes'
@@ -35,15 +36,8 @@ export function Navigation({
sceneConfig: SceneConfig | null
}): JSX.Element {
useMountedLogic(maxGlobalLogic)
- const userInterviewsEnabled = useFeatureFlag('USER_INTERVIEWS')
- // Register `create_user_interview_topic` globally so Max can create user interview
- // topics from any page (including the homepage), not only from the user-interviews
- // scene. The scene wires its own richer `useMaxTool` for the "New topic" button.
- useMaxTool({
- identifier: 'create_user_interview_topic',
- active: userInterviewsEnabled,
- context: {},
- })
+ useMountedLogic(mcpHintLogic)
+
const { theme } = useValues(themeLogic)
const { mobileLayout } = useValues(navigationLogic)
const { mode } = useValues(navigation3000Logic)
@@ -57,7 +51,7 @@ export function Navigation({
const { sidePanelOpen } = useValues(sidePanelStateLogic)
const { sidePanelWidth } = useValues(panelLayoutLogic)
const { firstTabIsActive } = useValues(sceneLogic)
- const noPaddingScene = sceneConfig?.layout === 'app-raw-no-header' || sceneConfig?.layout === 'app-raw'
+
// SceneMenuBar (when enabled) replaces ProjectNotice's role of conveying project-level
// context above scene content, so we hide the notice for users on the new menu bar.
const sceneMenuBarEnabled = useFeatureFlag('SCENE_MENU_BAR')
@@ -98,6 +92,18 @@ export function Navigation({
}
}, [mainRef, setMainContentRef, setMainContentRect])
+ // Register `create_user_interview_topic` globally so Max can create user interview
+ // topics from any page (including the homepage), not only from the user-interviews
+ // scene. The scene wires its own richer `useMaxTool` for the "New topic" button.
+ const userInterviewsEnabled = useFeatureFlag('USER_INTERVIEWS')
+ useMaxTool({
+ identifier: 'create_user_interview_topic',
+ active: userInterviewsEnabled,
+ context: {},
+ })
+
+ const noPaddingScene = sceneConfig?.layout === 'app-raw-no-header' || sceneConfig?.layout === 'app-raw'
+
if (mode !== 'full') {
return (
// eslint-disable-next-line react/forbid-dom-props
diff --git a/frontend/src/lib/components/Alerts/alertFormLogic.ts b/frontend/src/lib/components/Alerts/alertFormLogic.ts
index fd9ab792191a..019db1eb7739 100644
--- a/frontend/src/lib/components/Alerts/alertFormLogic.ts
+++ b/frontend/src/lib/components/Alerts/alertFormLogic.ts
@@ -4,6 +4,7 @@ import { loaders } from 'kea-loaders'
import posthog from 'posthog-js'
import api, { ApiError } from 'lib/api'
+import { tryShowMCPHint } from 'lib/components/MCPHint/mcpHintLogic'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
import { trendsDataLogic } from 'scenes/trends/trendsDataLogic'
@@ -322,6 +323,9 @@ export const alertFormLogic = kea<alertFormLogicType>([
}
lemonToast.success(alert.id === undefined ? 'Alert created.' : 'Alert saved.')
+ if (alert.id === undefined) {
+ tryShowMCPHint('alerts.create')
+ }
return updatedAlert
},
diff --git a/frontend/src/lib/components/Alerts/views/Alerts.tsx b/frontend/src/lib/components/Alerts/views/Alerts.tsx
index 53a638a7f031..3172dc5ddf6a 100644
--- a/frontend/src/lib/components/Alerts/views/Alerts.tsx
+++ b/frontend/src/lib/components/Alerts/views/Alerts.tsx
@@ -147,6 +147,7 @@ export function Alerts({ alertId }: AlertsProps): JSX.Element {
'Actions' in the sidebar and click 'Alerts'
</span>
}
+ mcpSurfaceKey="alerts.create"
/>
)}
diff --git a/frontend/src/lib/components/CommandBlock/CommandBlock.scss b/frontend/src/lib/components/CommandBlock/CommandBlock.scss
new file mode 100644
index 000000000000..6f1761b5f717
--- /dev/null
+++ b/frontend/src/lib/components/CommandBlock/CommandBlock.scss
@@ -0,0 +1,51 @@
+// Copy-interaction styles for CommandBlock.
+// The optional rainbow text decoration is opted into via the global
+// `.rainbow-text` utility (defined in styles/base.scss) — keep this file
+// focused on what's specific to the copy button itself.
+
+.CommandBlock__flash {
+ position: absolute;
+ inset: 0;
+ color: #36c46f;
+ pointer-events: none;
+ animation: CommandBlock-flash 1500ms ease-out forwards;
+}
+
+.CommandBlock__bounce {
+ animation: CommandBlock-bounce 400ms ease-out;
+}
+
+/* stylelint-disable-next-line keyframes-name-pattern */
+@keyframes CommandBlock-flash {
+ 0%,
+ 50% {
+ opacity: 1;
+ }
+
+ 100% {
+ opacity: 0;
+ }
+}
+
+/* stylelint-disable-next-line keyframes-name-pattern */
+@keyframes CommandBlock-bounce {
+ 0% {
+ transform: scale(1);
+ }
+
+ 15% {
+ transform: scale(0.96);
+ }
+
+ 40% {
+ transform: scale(1.03);
+ }
+
+ 70% {
+ transform: scale(0.99);
+ }
+
+ 100% {
+ transform: scale(1);
+ }
+}
diff --git a/frontend/src/lib/components/CommandBlock/CommandBlock.tsx b/frontend/src/lib/components/CommandBlock/CommandBlock.tsx
new file mode 100644
index 000000000000..231e9a3f773b
--- /dev/null
+++ b/frontend/src/lib/components/CommandBlock/CommandBlock.tsx
@@ -0,0 +1,94 @@
+import './CommandBlock.scss'
+
+import { useState } from 'react'
+
+import { IconCopy, IconTerminal } from '@posthog/icons'
+
+import { inStorybook, inStorybookTestRunner } from 'lib/utils'
+import { copyToClipboard } from 'lib/utils/copyToClipboard'
+import { cn } from 'lib/utils/css-classes'
+
+type Size = 'sm' | 'md'
+type Decoration = 'plain' | 'rainbow'
+
+const SIZE_STYLES: Record<Size, { padding: string; font: string; icon: string }> = {
+ sm: { padding: 'px-2.5 py-1.5', font: 'text-xs', icon: 'size-3.5' },
+ md: { padding: 'px-4 py-3', font: 'text-sm', icon: 'size-4' },
+}
+
+interface CommandBlockProps {
+ command: string
+ /** Label passed to the copy-to-clipboard toast (e.g. "MCP install command"). */
+ copyLabel: string
+ ariaLabel: string
+ className?: string
+ size?: Size
+ /** Visual treatment of the command text:
+ * - `plain` (default): the default code color, no animation.
+ * - `rainbow`: animated brand gradient — reserved for AI/MCP-flavored commands.
+ */
+ decoration?: Decoration
+ /** Fired after each copy click, with a monotonically increasing key. Lets callers
+ * trigger their own keyed remount animations (e.g. the wizard hedgehog cast). */
+ onCopy?: (copyKey: number) => void
+}
+
+export function CommandBlock({
+ command,
+ copyLabel,
+ ariaLabel,
+ className,
+ size = 'md',
+ decoration = 'plain',
+ onCopy,
+}: CommandBlockProps): JSX.Element {
+ const [copyKey, setCopyKey] = useState(0)
+ const sizeStyle = SIZE_STYLES[size]
+ const isStorybook = inStorybook() || inStorybookTestRunner()
+
+ const handleCopy = (): void => {
+ void copyToClipboard(command, copyLabel)
+ const next = copyKey + 1
+ setCopyKey(next)
+ onCopy?.(next)
+ }
+
+ return (
+ <button
+ onClick={handleCopy}
+ key={`cmd-${copyKey}`}
+ className={cn(
+ 'group inline-flex items-center gap-2 font-mono rounded-lg cursor-pointer transition-colors w-fit',
+ sizeStyle.font,
+ sizeStyle.padding,
+ copyKey > 0 && 'CommandBlock__bounce',
+ className
+ )}
+ type="button"
+ aria-label={ariaLabel}
+ >
+ <IconTerminal className={cn(sizeStyle.icon, 'text-muted')} />
+ <span className="relative">
+ <code
+ className={cn('!bg-transparent !p-0 !border-0 select-all', {
+ 'text-default': decoration === 'plain',
+ 'rainbow-text': decoration === 'rainbow',
+ 'rainbow-text-animating': decoration === 'rainbow' && !isStorybook,
+ })}
+ >
+ {command}
+ </code>
+ {copyKey > 0 && (
+ <code
+ key={copyKey}
+ className="CommandBlock__flash !bg-transparent !p-0 !border-0"
+ aria-hidden="true"
+ >
+ {command}
+ </code>
+ )}
+ </span>
+ <IconCopy className={cn(sizeStyle.icon, 'text-muted group-hover:text-primary')} />
+ </button>
+ )
+}
diff --git a/frontend/src/lib/components/MCPHint/AgentBadgeRotator.tsx b/frontend/src/lib/components/MCPHint/AgentBadgeRotator.tsx
new file mode 100644
index 000000000000..a13f67ebbd2e
--- /dev/null
+++ b/frontend/src/lib/components/MCPHint/AgentBadgeRotator.tsx
@@ -0,0 +1,37 @@
+import { useState } from 'react'
+
+import { useInterval } from 'lib/hooks/useInterval'
+import { inStorybook, inStorybookTestRunner } from 'lib/utils'
+import { cn } from 'lib/utils/css-classes'
+
+// Show PostHog Code more often to increase engagement
+const AGENTS = ['PostHog Code', 'Claude', 'Cursor', 'PostHog Code', 'Codex', 'Gemini'] as const
+
+const ROTATE_INTERVAL_MS = 2000
+
+export function AgentBadgeRotator({ className }: { className?: string }): JSX.Element {
+ // Pin to "PostHog Code" inside Storybook so visual snapshots don't flake on rotation.
+ const isStorybook = inStorybook() || inStorybookTestRunner()
+ const [index, setIndex] = useState(() => (isStorybook ? 0 : Math.floor(Math.random() * AGENTS.length)))
+
+ useInterval(() => {
+ if (isStorybook) {
+ return
+ }
+
+ setIndex((current) => (current + 1) % AGENTS.length)
+ }, ROTATE_INTERVAL_MS)
+
+ return (
+ <span className={cn('inline-flex relative', className)} aria-live="polite">
+ <span
+ key={AGENTS[index]}
+ className={cn('font-semibold rainbow-text', {
+ 'rainbow-text-animating': !isStorybook,
+ })}
+ >
+ {AGENTS[index]}
+ </span>
+ </span>
+ )
+}
diff --git a/frontend/src/lib/components/MCPHint/MCPHintToast.stories.tsx b/frontend/src/lib/components/MCPHint/MCPHintToast.stories.tsx
new file mode 100644
index 000000000000..5b56b156f7f2
--- /dev/null
+++ b/frontend/src/lib/components/MCPHint/MCPHintToast.stories.tsx
@@ -0,0 +1,43 @@
+import { Meta, StoryObj } from '@storybook/react'
+
+import { MCPHintToast } from './MCPHintToast'
+
+const meta: Meta<typeof MCPHintToast> = {
+ title: 'Components/MCP Hint Toast',
+ component: MCPHintToast,
+ parameters: {
+ // The component is normally rendered inside a react-toastify toast.
+ // The decorator below approximates that container so the story is visually meaningful.
+ layout: 'centered',
+ },
+ decorators: [
+ (Story) => (
+ <div className="max-w-md min-w-140 bg-surface-primary border border-primary rounded-lg shadow-lg p-3">
+ <Story />
+ </div>
+ ),
+ ],
+}
+export default meta
+
+type Story = StoryObj<typeof MCPHintToast>
+
+export const FeatureFlagsCreate: Story = {
+ args: { surfaceKey: 'feature_flags.create' },
+}
+
+export const DashboardsCreate: Story = {
+ args: { surfaceKey: 'dashboards.create' },
+}
+
+export const ExperimentsCreate: Story = {
+ args: { surfaceKey: 'experiments.create' },
+}
+
+export const SqlExecute: Story = {
+ args: { surfaceKey: 'sql.execute' },
+}
+
+export const AnnotationsCreate: Story = {
+ args: { surfaceKey: 'annotations.create' },
+}
diff --git a/frontend/src/lib/components/MCPHint/MCPHintToast.tsx b/frontend/src/lib/components/MCPHint/MCPHintToast.tsx
new file mode 100644
index 000000000000..8171ff8678d7
--- /dev/null
+++ b/frontend/src/lib/components/MCPHint/MCPHintToast.tsx
@@ -0,0 +1,70 @@
+import { useActions } from 'kea'
+import { useState } from 'react'
+
+import { IconSparkles } from '@posthog/icons'
+import { Tooltip } from '@posthog/lemon-ui'
+
+import { cn } from 'lib/utils/css-classes'
+
+import { AgentBadgeRotator } from './AgentBadgeRotator'
+import { mcpHintLogic } from './mcpHintLogic'
+import { MCPInstallCommand } from './MCPInstallCommand'
+import { SURFACE_PROMPTS, type SurfaceKey } from './prompts'
+
+const linkClass =
+ 'text-xs text-muted hover:text-default underline underline-offset-2 cursor-pointer bg-transparent border-0 !p-0 !m-0'
+
+export function MCPHintToast({ surfaceKey }: { surfaceKey: SurfaceKey }): JSX.Element {
+ const { dismissSurface, dismissAll } = useActions(mcpHintLogic)
+ const [showHideOptions, setShowHideOptions] = useState(false)
+
+ const prompt = SURFACE_PROMPTS[surfaceKey].toast
+
+ return (
+ <div className="flex flex-col gap-1 py-1 pr-1 text-default min-w-0 items-start">
+ <div className="flex items-center gap-1.5 text-sm">
+ <IconSparkles className="size-4 shrink-0" />
+ <span>
+ Next time, ask <AgentBadgeRotator /> to do it for you:
+ </span>
+ </div>
+ <div className="text-xs italic text-muted leading-snug">{prompt}</div>
+ <MCPInstallCommand size="sm" className="mt-1" />
+ <div className="flex items-baseline flex-wrap">
+ <button
+ type="button"
+ className={linkClass}
+ onClick={() => setShowHideOptions((v) => !v)}
+ data-attr="mcp-hint-hide"
+ >
+ Hide{showHideOptions ? <>&nbsp;&gt;&nbsp;</> : <>&nbsp;MCP hints</>}
+ </button>
+ {showHideOptions && (
+ <div className="flex items-baseline gap-0.5 ml-1.5">
+ <Tooltip title="Stop suggesting MCP for this kind of action. You'll still see hints for other actions, at most once a week.">
+ <button
+ type="button"
+ className={linkClass}
+ onClick={() => dismissSurface(surfaceKey)}
+ data-attr="mcp-hint-hide-surface"
+ >
+ this hint
+ </button>
+ </Tooltip>
+ <span className="text-xs text-muted">/</span>
+ <Tooltip title="Turn off MCP hints everywhere. If you keep them on, you'll only see one at most per week.">
+ <button
+ type="button"
+ className={cn(linkClass, '!text-danger hover:!opacity-80')}
+ onClick={() => dismissAll()}
+ data-attr="mcp-hint-hide-all"
+ >
+ all MCP hints
+ </button>
+ </Tooltip>
+ </div>
+ )}
+ </div>
+ </div>
+ )
+}
diff --git a/frontend/src/lib/components/MCPHint/MCPInstallCommand.tsx b/frontend/src/lib/components/MCPHint/MCPInstallCommand.tsx
new file mode 100644
index 000000000000..c68283ffffbb
--- /dev/null
+++ b/frontend/src/lib/components/MCPHint/MCPInstallCommand.tsx
@@ -0,0 +1,28 @@
+import { useValues } from 'kea'
+
+import { CommandBlock } from 'lib/components/CommandBlock/CommandBlock'
+import { cn } from 'lib/utils/css-classes'
+import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
+
+import { MCP_INSTALL_COMMAND } from './constants'
+
+type Size = 'sm' | 'md'
+
+export function MCPInstallCommand({ size = 'sm', className }: { size?: Size; className?: string }): JSX.Element | null {
+ const { isCloudOrDev } = useValues(preflightLogic)
+
+ if (!isCloudOrDev) {
+ return null
+ }
+
+ return (
+ <CommandBlock
+ command={MCP_INSTALL_COMMAND}
+ copyLabel="MCP install command"
+ ariaLabel="Copy MCP install command"
+ size={size}
+ decoration="rainbow"
+ className={cn('bg-surface-secondary border border-primary !m-0 hover:border-accent', className)}
+ />
+ )
+}
diff --git a/frontend/src/lib/components/MCPHint/MCPUseCaseCard.stories.tsx b/frontend/src/lib/components/MCPHint/MCPUseCaseCard.stories.tsx
new file mode 100644
index 000000000000..6d8178ea863e
--- /dev/null
+++ b/frontend/src/lib/components/MCPHint/MCPUseCaseCard.stories.tsx
@@ -0,0 +1,37 @@
+import { Meta, StoryObj } from '@storybook/react'
+
+import { FEATURE_FLAGS } from 'lib/constants'
+
+import { MCPUseCaseCard } from './MCPUseCaseCard'
+
+const meta: Meta<typeof MCPUseCaseCard> = {
+ title: 'Components/MCP Use Case Card',
+ component: MCPUseCaseCard,
+ parameters: {
+ layout: 'centered',
+ featureFlags: [FEATURE_FLAGS.MCP_HINTS],
+ },
+}
+export default meta
+
+type Story = StoryObj<typeof MCPUseCaseCard>
+
+export const FeatureFlagsCreate: Story = {
+ args: { surfaceKey: 'feature_flags.create', forceDisplay: true },
+}
+
+export const DashboardsCreate: Story = {
+ args: { surfaceKey: 'dashboards.create', forceDisplay: true },
+}
+
+export const ExperimentsCreate: Story = {
+ args: { surfaceKey: 'experiments.create', forceDisplay: true },
+}
+
+export const SurveysCreate: Story = {
+ args: { surfaceKey: 'surveys.create', forceDisplay: true },
+}
+
+export const InsightsCreate: Story = {
+ args: { surfaceKey: 'insights.create', forceDisplay: true },
+}
diff --git a/frontend/src/lib/components/MCPHint/MCPUseCaseCard.tsx b/frontend/src/lib/components/MCPHint/MCPUseCaseCard.tsx
new file mode 100644
index 000000000000..245e016cd4b0
--- /dev/null
+++ b/frontend/src/lib/components/MCPHint/MCPUseCaseCard.tsx
@@ -0,0 +1,84 @@
+import { useValues } from 'kea'
+import { useState } from 'react'
+
+import { IconSparkles } from '@posthog/icons'
+
+import { inStorybook, inStorybookTestRunner } from 'lib/utils'
+import { cn } from 'lib/utils/css-classes'
+
+import { AgentBadgeRotator } from './AgentBadgeRotator'
+import { mcpHintLogic } from './mcpHintLogic'
+import { MCPInstallCommand } from './MCPInstallCommand'
+import { SURFACE_PROMPTS, type SurfaceKey } from './prompts'
+
+const FIRST_SEEN_KEY_PREFIX = 'mcp-use-case-card-first-seen:'
+
+function getExpiryState(surfaceKey: SurfaceKey, expiresAfterMs: number): { expired: boolean; firstSeenAt: number } {
+ const key = FIRST_SEEN_KEY_PREFIX + surfaceKey
+ const stored = localStorage.getItem(key)
+ if (stored) {
+ const firstSeenAt = parseInt(stored, 10)
+ return { expired: Date.now() - firstSeenAt > expiresAfterMs, firstSeenAt }
+ }
+ const now = Date.now()
+ localStorage.setItem(key, String(now))
+ return { expired: false, firstSeenAt: now }
+}
+
+export function MCPUseCaseCard({
+ surfaceKey,
+ className,
+ /**
+ * If set, the card hides itself after this many ms have passed since the first time it appeared
+ * for this user (per-surface, persisted in localStorage). Use in contexts that aren't a one-shot
+ * empty state (e.g. the SQL editor, which a user revisits often).
+ */
+ expiresAfterMs,
+ // Force display, only useful in storybook to simplify flags
+ forceDisplay = false,
+}: {
+ surfaceKey: SurfaceKey
+ className?: string
+ expiresAfterMs?: number
+ forceDisplay?: boolean
+}): JSX.Element | null {
+ const { effectiveOptOut, featureEnabled } = useValues(mcpHintLogic)
+ const [expired] = useState(() => (expiresAfterMs ? getExpiryState(surfaceKey, expiresAfterMs).expired : false))
+
+ if (forceDisplay == false && (!featureEnabled || effectiveOptOut || expired)) {
+ return null
+ }
+
+ const { examples } = SURFACE_PROMPTS[surfaceKey]
+
+ const isStorybook = inStorybook() || inStorybookTestRunner()
+
+ return (
+ <div
+ className={cn(
+ 'mt-6 rounded-lg border border-dashed border-primary bg-bg-light p-4 flex flex-col gap-3',
+ className
+ )}
+ >
+ <div className="flex items-center gap-2">
+ <IconSparkles className="size-4 shrink-0" />
+ <h4
+ className={cn('m-0 text-sm font-semibold rainbow-text', { 'rainbow-text-animating': !isStorybook })}
+ >
+ Or do it from your agent
+ </h4>
+ </div>
+ <div className="text-sm text-default">
+ Ask <AgentBadgeRotator />:
+ </div>
+ <ul className="m-0 pl-5 list-disc text-xs text-muted leading-relaxed">
+ {examples.map((example) => (
+ <li key={example}>{example}</li>
+ ))}
+ </ul>
+ <div className="pt-1">
+ <MCPInstallCommand size="sm" />
+ </div>
+ </div>
+ )
+}
diff --git a/frontend/src/lib/components/MCPHint/constants.ts b/frontend/src/lib/components/MCPHint/constants.ts
new file mode 100644
index 000000000000..91eaa2ff5bb6
--- /dev/null
+++ b/frontend/src/lib/components/MCPHint/constants.ts
@@ -0,0 +1 @@
+export const MCP_INSTALL_COMMAND = 'npx @posthog/wizard mcp add'
diff --git a/frontend/src/lib/components/MCPHint/mcpHintLogic.tsx b/frontend/src/lib/components/MCPHint/mcpHintLogic.tsx
new file mode 100644
index 000000000000..00b75d8d4d3a
--- /dev/null
+++ b/frontend/src/lib/components/MCPHint/mcpHintLogic.tsx
@@ -0,0 +1,119 @@
+import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { toast } from 'react-toastify'
+
+import { FEATURE_FLAGS } from 'lib/constants'
+import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
+import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
+import { userLogic } from 'scenes/userLogic'
+
+import { UserType } from '~/types'
+
+import type { mcpHintLogicType } from './mcpHintLogicType'
+import { MCPHintToast } from './MCPHintToast'
+import type { SurfaceKey } from './prompts'
+
+// A full week between hints, regardless of surface — these are promotional,
+// so we err heavily on the side of not overloading people.
+const COOLDOWN_MS = 7 * 24 * 60 * 60 * 1000
+
+export function tryShowMCPHint(surfaceKey: SurfaceKey): void {
+ try {
+ const mounted = mcpHintLogic.findMounted()
+ if (!mounted?.values.featureEnabled) {
+ return
+ }
+
+ mounted.actions.tryShowHint(surfaceKey)
+ } catch (error) {
+ console.warn('[mcpHint] dispatch failed; host listener will continue', { surfaceKey, error })
+ }
+}
+
+export const mcpHintLogic = kea<mcpHintLogicType>([
+ path(['lib', 'components', 'MCPHint', 'mcpHintLogic']),
+ connect(() => ({
+ values: [userLogic, ['user'], featureFlagLogic, ['featureFlags']],
+ actions: [userLogic, ['updateUser'], eventUsageLogic, ['reportMCPHintShown', 'reportMCPHintDismissed']],
+ })),
+ actions({
+ tryShowHint: (surfaceKey: SurfaceKey) => ({ surfaceKey }),
+ recordShown: (now: number) => ({ now }),
+ dismissSurface: (surfaceKey: SurfaceKey) => ({ surfaceKey }),
+ dismissAll: true,
+ reenable: true,
+ }),
+ reducers({
+ lastShownAt: [
+ null as number | null,
+ { persist: true },
+ {
+ recordShown: (_, { now }) => now,
+ reenable: () => null,
+ },
+ ],
+ dismissedSurfaces: [
+ {} as Record<string, true>,
+ { persist: true },
+ {
+ dismissSurface: (state, { surfaceKey }) => ({ ...state, [surfaceKey]: true }),
+ reenable: () => ({}),
+ },
+ ],
+ localGlobalOptOut: [
+ false,
+ { persist: true },
+ {
+ dismissAll: () => true,
+ reenable: () => false,
+ },
+ ],
+ }),
+ selectors({
+ featureEnabled: [
+ (s) => [s.featureFlags],
+ (featureFlags: Record<string, boolean | string>): boolean =>
+ featureFlags[FEATURE_FLAGS.MCP_HINTS] === 'test',
+ ],
+ effectiveOptOut: [
+ (s) => [s.localGlobalOptOut, s.user],
+ (localOptOut: boolean, user: UserType | null): boolean => Boolean(localOptOut || user?.hide_mcp_hints),
+ ],
+ }),
+ listeners(({ values, actions }) => ({
+ tryShowHint: ({ surfaceKey }) => {
+ const now = Date.now()
+ const sinceLast = values.lastShownAt ? now - values.lastShownAt : Infinity
+ const cooldownActive = values.lastShownAt !== null && sinceLast < COOLDOWN_MS
+
+ if (values.effectiveOptOut || Boolean(values.dismissedSurfaces[surfaceKey]) || cooldownActive) {
+ return
+ }
+
+ try {
+ toast.info(<MCPHintToast surfaceKey={surfaceKey} />, {
+ toastId: `mcp-hint-${surfaceKey}-${now}`,
+ autoClose: false,
+ closeOnClick: false,
+ draggable: false,
+ hideProgressBar: true,
+ icon: false,
+ })
+ actions.recordShown(now)
+ actions.reportMCPHintShown(surfaceKey)
+ } catch (error) {
+ console.warn('[mcpHint] toast render failed', { surfaceKey, error })
+ }
+ },
+ dismissSurface: ({ surfaceKey }) => {
+ actions.reportMCPHintDismissed('surface', surfaceKey)
+ },
+ dismissAll: () => {
+ toast.dismiss()
+ actions.updateUser({ hide_mcp_hints: true })
+ actions.reportMCPHintDismissed('all')
+ },
+ reenable: () => {
+ actions.updateUser({ hide_mcp_hints: false })
+ },
+ })),
+])
diff --git a/frontend/src/lib/components/MCPHint/prompts.ts b/frontend/src/lib/components/MCPHint/prompts.ts
new file mode 100644
index 000000000000..942758b64dce
--- /dev/null
+++ b/frontend/src/lib/components/MCPHint/prompts.ts
@@ -0,0 +1,147 @@
+export const SURFACE_KEYS = [
+ 'feature_flags.create',
+ 'feature_flags.update',
+ 'experiments.create',
+ 'experiments.launch',
+ 'dashboards.create',
+ 'insights.create',
+ 'surveys.create',
+ 'alerts.create',
+ 'cohorts.create',
+ 'actions.create',
+ 'annotations.create',
+ 'error_tracking.assign',
+ 'early_access_features.create',
+ 'sql.execute',
+ 'workflows.create',
+] as const
+
+export type SurfaceKey = (typeof SURFACE_KEYS)[number]
+
+export type SurfacePrompts = {
+ toast: string
+ examples: string[]
+}
+
+export const SURFACE_PROMPTS: Record<SurfaceKey, SurfacePrompts> = {
+ 'feature_flags.create': {
+ toast: '"Create a feature flag called new-checkout rolled out to 20% of users"',
+ examples: [
+ '"Create a feature flag for the new pricing page"',
+ '"Roll out checkout-v2 to 25% of EU users"',
+ '"Schedule pricing-flag to enable Friday at noon"',
+ ],
+ },
+ 'feature_flags.update': {
+ toast: '"Bump rollout for new-checkout to 50%"',
+ examples: [
+ '"Bump rollout for new-checkout to 50%"',
+ '"Disable beta-banner flag"',
+ '"Add eu-only condition to pricing-flag"',
+ ],
+ },
+ 'experiments.create': {
+ toast: '"Create an A/B experiment for the new pricing page"',
+ examples: [
+ '"Create an A/B experiment for the new pricing page"',
+ '"Launch a multivariate test on the signup CTA"',
+ '"Set up an experiment to measure checkout conversion"',
+ ],
+ },
+ 'experiments.launch': {
+ toast: '"Launch experiment pricing-test"',
+ examples: [
+ '"Launch experiment pricing-test"',
+ '"Archive the old signup-cta experiment"',
+ '"Check the results of checkout-flow-v2"',
+ ],
+ },
+ 'dashboards.create': {
+ toast: '"Build a retention dashboard for signups last 30 days"',
+ examples: [
+ '"Build a retention dashboard for signups last 30 days"',
+ '"Make me a dashboard tracking checkout funnel drop-off"',
+ '"Add a revenue tile to the executive dashboard"',
+ ],
+ },
+ 'insights.create': {
+ toast: '"Run a trends query for signup_completed last 30 days"',
+ examples: [
+ '"Show me sign-up trends for the last 30 days"',
+ '"Build a funnel for the onboarding flow"',
+ '"Compute retention by week for paid users"',
+ ],
+ },
+ 'surveys.create': {
+ toast: '"Create an NPS survey targeted at paid users"',
+ examples: [
+ '"Create an NPS survey targeted at paid users"',
+ '"Ask churned users why they left"',
+ '"Launch a feedback survey on the new dashboard"',
+ ],
+ },
+ 'alerts.create': {
+ toast: '"Alert me if signups drop more than 20% week over week"',
+ examples: [
+ '"Alert me if signups drop more than 20% week over week"',
+ '"Notify the team when checkout errors spike"',
+ '"Set up a daily revenue threshold alert"',
+ ],
+ },
+ 'cohorts.create': {
+ toast: '"Build a cohort of users who signed up last week and never returned"',
+ examples: [
+ '"Build a cohort of users who signed up last week and never returned"',
+ '"Make a cohort of EU paid customers"',
+ '"Add these users to the beta-testers cohort"',
+ ],
+ },
+ 'actions.create': {
+ toast: '"Create an action for clicks on the upgrade button"',
+ examples: [
+ '"Create an action for clicks on the upgrade button"',
+ '"Define a pageview action for the pricing page"',
+ '"Make an action that fires when users complete onboarding"',
+ ],
+ },
+ 'annotations.create': {
+ toast: '"Annotate today as the launch of v2 checkout"',
+ examples: [
+ '"Annotate today as the launch of v2 checkout"',
+ '"Mark the deploy on the conversion dashboard"',
+ '"Add a release note to last Tuesday"',
+ ],
+ },
+ 'error_tracking.assign': {
+ toast: '"Assign all TypeError issues to the frontend team"',
+ examples: [
+ '"Assign all TypeError issues to the frontend team"',
+ '"Show me the top 10 unresolved errors this week"',
+ '"Set up an assignment rule for billing-related errors"',
+ ],
+ },
+ 'early_access_features.create': {
+ toast: '"Create an early-access feature for the new editor"',
+ examples: [
+ '"Create an early-access feature for the new editor"',
+ '"Promote ai-suggestions to general availability"',
+ '"Show me everyone signed up for the v2 beta"',
+ ],
+ },
+ 'sql.execute': {
+ toast: '"Run this SQL: select count() from events where event = $pageview"',
+ examples: [
+ '"How many users viewed the pricing page yesterday?"',
+ '"What\'s our DAU trend for the last 90 days?"',
+ '"Find the top 20 most active teams this week"',
+ ],
+ },
+ 'workflows.create': {
+ toast: '"Build a workflow that emails new signups a welcome message after 1 day"',
+ examples: [
+ '"Build a workflow that emails new signups a welcome message after 1 day"',
+ '"Send a Slack alert when a paid user hits the error_rate threshold"',
+ '"Trigger a reminder push 7 days after onboarding starts but never completes"',
+ ],
+ },
+}
diff --git a/frontend/src/lib/components/ProductIntroduction/ProductIntroduction.tsx b/frontend/src/lib/components/ProductIntroduction/ProductIntroduction.tsx
index 9569f175efd8..a0a6799d7086 100644
--- a/frontend/src/lib/components/ProductIntroduction/ProductIntroduction.tsx
+++ b/frontend/src/lib/components/ProductIntroduction/ProductIntroduction.tsx
@@ -9,6 +9,8 @@ import { userLogic } from 'scenes/userLogic'
import { ProductKey } from '~/queries/schema/schema-general'
import { BuilderHog3, DetectiveHog } from '../hedgehogs'
+import { MCPUseCaseCard } from '../MCPHint/MCPUseCaseCard'
+import type { SurfaceKey } from '../MCPHint/prompts'
/**
* A component to introduce new users to a product, and to show something
@@ -52,6 +54,11 @@ export type ProductIntroductionProps = {
* for wide empty states (e.g. template grids). Passed through `cn` with tailwind-merge so `max-w-*` replaces default.
*/
contentClassName?: string
+ /**
+ * When set, renders an MCP use-case card below the actions, promoting the same product via PostHog MCP from
+ * the user's IDE. Auto-hides if the user has opted out of MCP hints.
+ */
+ mcpSurfaceKey?: SurfaceKey
}
export const ProductIntroduction = ({
@@ -70,6 +77,7 @@ export const ProductIntroduction = ({
hogLayout = 'default',
useMainContentContainerQueries = false,
contentClassName,
+ mcpSurfaceKey,
}: ProductIntroductionProps): JSX.Element | null => {
const { updateHasSeenProductIntroFor } = useActions(userLogic)
const { user } = useValues(userLogic)
@@ -207,6 +215,7 @@ export const ProductIntroduction = ({
</LemonButton>
)}
</div>
+ {mcpSurfaceKey && <MCPUseCaseCard surfaceKey={mcpSurfaceKey} className="max-w-140" />}
</div>
</div>
</div>
diff --git a/frontend/src/lib/components/Search/searchLogic.tsx b/frontend/src/lib/components/Search/searchLogic.tsx
index 92ac6c74b743..86be83eeddfa 100644
--- a/frontend/src/lib/components/Search/searchLogic.tsx
+++ b/frontend/src/lib/components/Search/searchLogic.tsx
@@ -10,6 +10,7 @@ import { toSentenceCase } from 'lib/utils'
import { GroupQueryResult, mapGroupQueryResponse } from 'lib/utils/groups'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
import { organizationIntegrationsLogic } from 'scenes/settings/organization/organizationIntegrationsLogic'
+import { matchesFlagDefinition } from 'scenes/settings/settingsLogic'
import { urls } from 'scenes/urls'
import { userLogic } from 'scenes/userLogic'
@@ -21,7 +22,7 @@ import { recentItemsModel } from '~/models/recentItemsModel'
import { getTreeItemsMetadata, getTreeItemsNew, getTreeItemsProducts } from '~/products'
import { FileSystemEntry, GroupsQueryResponse } from '~/queries/schema/schema-general'
import { SETTINGS_MAP } from '~/scenes/settings/SettingsMap'
-import { SettingSectionId } from '~/scenes/settings/types'
+import { Setting, SettingSectionId } from '~/scenes/settings/types'
import { ActivityTab, FileSystemIconColor, GroupTypeIndex, PersonType, SearchResponse } from '~/types'
import type { searchLogicType } from './searchLogicType'
@@ -646,14 +647,10 @@ export const searchLogic = kea<searchLogicType>([
settingsItems: [
(s) => [s.featureFlags, s.organizationIntegrations],
(featureFlags, organizationIntegrations): SearchItem[] => {
- const items: SearchItem[] = []
+ const checkFlag = (flagKey: Pick<Setting, 'flag'>['flag']): boolean =>
+ matchesFlagDefinition(flagKey, featureFlags)
- const checkFlag = (flag: string): boolean => {
- const isNegated = flag.startsWith('!')
- const flagName = isNegated ? flag.slice(1) : flag
- const flagValue = (featureFlags as Record<string, boolean>)[flagName]
- return isNegated ? !flagValue : !!flagValue
- }
+ const items: SearchItem[] = []
// Skip project-level sections as they are duplicates of environment sections
const seenSectionIds = new Set<string>()
@@ -687,15 +684,8 @@ export const searchLogic = kea<searchLogicType>([
// Filter by feature flag if required
if (section.flag) {
- if (Array.isArray(section.flag)) {
- // All flags in the array must pass
- if (!section.flag.every(checkFlag)) {
- continue
- }
- } else {
- if (!checkFlag(section.flag)) {
- continue
- }
+ if (!checkFlag(section.flag as Pick<Setting, 'flag'>['flag'])) {
+ continue
}
}
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index 0e331f60767d..8aaf3e0d3b57 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -373,6 +373,7 @@ export const FEATURE_FLAGS = {
MAX_AI_INSIGHT_SEARCH: 'max-ai-insight-search', // owner: #team-posthog-ai
MAX_BILLING_CONTEXT: 'max-billing-context', // owner: @pawel-cebula #team-billing
MAX_DEEP_RESEARCH: 'max-deep-research', // owner: @kappa90 #team-posthog-ai
+ MCP_HINTS: 'mcp-hints', // owner: @rafaeelaudibert #team-growth, gates in-app MCP hint toasts and empty-state cards
MCP_SERVERS: 'mcp-servers', // owner: #team-posthog-ai
MESSAGING_SES: 'messaging-ses', // owner #team-workflows
METRICS: 'metrics', // owner: #team-apm (@jonmcwest, @frankh)
diff --git a/frontend/src/lib/utils/eventUsageLogic.ts b/frontend/src/lib/utils/eventUsageLogic.ts
index 902933cee3eb..ec56a0f8d258 100644
--- a/frontend/src/lib/utils/eventUsageLogic.ts
+++ b/frontend/src/lib/utils/eventUsageLogic.ts
@@ -1089,6 +1089,12 @@ export const eventUsageLogic = kea<eventUsageLogicType>([
itemCount,
isAIFirst,
}),
+ // MCP hints
+ reportMCPHintShown: (surfaceKey: string) => ({ surfaceKey }),
+ reportMCPHintDismissed: (dismissType: 'surface' | 'all', surfaceKey?: string) => ({
+ dismissType,
+ surfaceKey,
+ }),
}),
listeners(({ values }) => ({
reportBillingCTAShown: () => {
@@ -2488,5 +2494,16 @@ export const eventUsageLogic = kea<eventUsageLogicType>([
is_ai_first: isAIFirst,
})
},
+ reportMCPHintShown: ({ surfaceKey }) => {
+ posthog.capture('mcp hint shown', {
+ surface_key: surfaceKey,
+ })
+ },
+ reportMCPHintDismissed: ({ dismissType, surfaceKey }) => {
+ posthog.capture('mcp hint dismissed', {
+ dismiss_type: dismissType,
+ surface_key: surfaceKey,
+ })
+ },
})),
])
diff --git a/frontend/src/scenes/annotations/Annotations.tsx b/frontend/src/scenes/annotations/Annotations.tsx
index 6d19e1fbe6e5..5283eec2a7e6 100644
--- a/frontend/src/scenes/annotations/Annotations.tsx
+++ b/frontend/src/scenes/annotations/Annotations.tsx
@@ -190,6 +190,7 @@ export function Annotations(): JSX.Element {
action={() => openModalToCreateAnnotation()}
isEmpty={shouldShowEmptyState}
customHog={MicrophoneHog}
+ mcpSurfaceKey="annotations.create"
/>
</div>
{!shouldShowEmptyState && (
diff --git a/frontend/src/scenes/annotations/annotationModalLogic.ts b/frontend/src/scenes/annotations/annotationModalLogic.ts
index 05c92119d9d6..d0ab271844e5 100644
--- a/frontend/src/scenes/annotations/annotationModalLogic.ts
+++ b/frontend/src/scenes/annotations/annotationModalLogic.ts
@@ -5,6 +5,7 @@ import { urlToAction } from 'kea-router'
import '@posthog/lemon-ui'
import api from 'lib/api'
+import { tryShowMCPHint } from 'lib/components/MCPHint/mcpHintLogic'
import { Dayjs, dayjs } from 'lib/dayjs'
import { teamLogic } from 'scenes/teamLogic'
import { urls } from 'scenes/urls'
@@ -177,6 +178,7 @@ export const annotationModalLogic = kea<annotationModalLogicType>([
dashboard_id: dashboardId,
})
actions.appendAnnotations([createdAnnotation])
+ tryShowMCPHint('annotations.create')
}
actions.closeModal()
},
diff --git a/frontend/src/scenes/cohorts/Cohorts.tsx b/frontend/src/scenes/cohorts/Cohorts.tsx
index 9c9e1088ad32..4d09721cd93e 100644
--- a/frontend/src/scenes/cohorts/Cohorts.tsx
+++ b/frontend/src/scenes/cohorts/Cohorts.tsx
@@ -284,6 +284,7 @@ export function Cohorts(): JSX.Element {
docsURL="https://posthog.com/docs/data/cohorts"
action={() => router.actions.push(urls.cohort('new'))}
customHog={ListHog}
+ mcpSurfaceKey="cohorts.create"
/>
<div>{filtersSection}</div>
diff --git a/frontend/src/scenes/cohorts/cohortEditLogic.ts b/frontend/src/scenes/cohorts/cohortEditLogic.ts
index 43402052c758..a7474c18ec7d 100644
--- a/frontend/src/scenes/cohorts/cohortEditLogic.ts
+++ b/frontend/src/scenes/cohorts/cohortEditLogic.ts
@@ -6,6 +6,7 @@ import posthog from 'posthog-js'
import { v4 as uuidv4 } from 'uuid'
import api from 'lib/api'
+import { tryShowMCPHint } from 'lib/components/MCPHint/mcpHintLogic'
import { SetupTaskId, globalSetupLogic } from 'lib/components/ProductSetup'
import { ENTITY_MATCH_TYPE } from 'lib/constants'
import { scrollToFormError } from 'lib/forms/scrollToFormError'
@@ -474,6 +475,9 @@ export const cohortEditLogic = kea<cohortEditLogicType>([
toastId: `cohort-saved-${key}`,
})
actions.checkIfFinishedCalculating(cohort)
+ if (existingCohort.id === 'new') {
+ tryShowMCPHint('cohorts.create')
+ }
if (cohort.id !== 'new') {
actions.refreshPersonsData()
}
diff --git a/frontend/src/scenes/dashboard/dashboards/Dashboards.tsx b/frontend/src/scenes/dashboard/dashboards/Dashboards.tsx
index ccb2e305250c..4a29b61a20bf 100644
--- a/frontend/src/scenes/dashboard/dashboards/Dashboards.tsx
+++ b/frontend/src/scenes/dashboard/dashboards/Dashboards.tsx
@@ -120,6 +120,7 @@ export function Dashboards(): JSX.Element {
useMainContentContainerQueries={true}
contentClassName="max-w-[1000px]"
actionElementOverride={<FeaturedTemplatesChooser />}
+ mcpSurfaceKey="dashboards.create"
/>
)}
</div>
diff --git a/frontend/src/scenes/dashboard/dashboards/templates/FeaturedTemplatesChooser.tsx b/frontend/src/scenes/dashboard/dashboards/templates/FeaturedTemplatesChooser.tsx
index 0e3b146eec34..1420c2c798f4 100644
--- a/frontend/src/scenes/dashboard/dashboards/templates/FeaturedTemplatesChooser.tsx
+++ b/frontend/src/scenes/dashboard/dashboards/templates/FeaturedTemplatesChooser.tsx
@@ -4,20 +4,10 @@ import { useMemo } from 'react'
import { IconPlus } from '@posthog/icons'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
-import { getAccessControlDisabledReason } from 'lib/utils/accessControlUtils'
import { cn } from 'lib/utils/css-classes'
-import { DashboardsListEmptyAiStarterPrompts } from 'scenes/dashboard/dashboardsListEmptyAiStarterPrompts'
import { newDashboardLogic } from 'scenes/dashboard/newDashboardLogic'
-import { maxGlobalLogic } from 'scenes/max/maxGlobalLogic'
-import { sidePanelStateLogic } from '~/layout/navigation-3000/sidepanel/sidePanelStateLogic'
-import {
- AccessControlLevel,
- AccessControlResourceType,
- DashboardTemplateType,
- SidePanelTab,
- TemplateAvailabilityContext,
-} from '~/types'
+import { DashboardTemplateType, TemplateAvailabilityContext } from '~/types'
import BlankDashboardHog from 'public/blank-dashboard-hog.png'
@@ -49,9 +39,6 @@ export function FeaturedTemplatesChooser({
setIsLoading,
showVariableSelectModal,
} = useActions(newDashboardLogic)
- const { openSidePanel } = useActions(sidePanelStateLogic)
- const { dataProcessingAccepted, dataProcessingApprovalDisabledReason } = useValues(maxGlobalLogic)
-
const filteredTemplates = useMemo(() => {
return allTemplates.filter((template) => {
if (availabilityContexts) {
@@ -83,24 +70,6 @@ export function FeaturedTemplatesChooser({
runBlankDashboardFlow({ isLoading, setIsLoading, addDashboard })
}
- const accessDisabledReason = getAccessControlDisabledReason(
- AccessControlResourceType.Dashboard,
- AccessControlLevel.Editor
- )
- const aiBlockedReason =
- !dataProcessingAccepted &&
- (dataProcessingApprovalDisabledReason ?? 'Approve AI data processing to use PostHog AI')
- const chipDisabledReason = accessDisabledReason ?? (aiBlockedReason || undefined)
-
- const onOpenAiWithPrompt = (prompt: string): void => {
- const trimmed = prompt.trim()
- if (trimmed) {
- openSidePanel(SidePanelTab.Max, `!${trimmed}`)
- } else {
- openSidePanel(SidePanelTab.Max)
- }
- }
-
return (
<div className={cn('flex flex-col gap-4 w-full', className)}>
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 w-full">
@@ -133,12 +102,6 @@ export function FeaturedTemplatesChooser({
))
)}
</div>
- {showBlankDashboardAction && !allTemplatesLoading ? (
- <DashboardsListEmptyAiStarterPrompts
- chipDisabledReason={chipDisabledReason}
- onOpenAiWithPrompt={onOpenAiWithPrompt}
- />
- ) : null}
{showBlankDashboardAction && hasFeaturedTiles ? (
<LemonButton
type="secondary"
diff --git a/frontend/src/scenes/dashboard/dashboardsListEmptyAiStarterPrompts.tsx b/frontend/src/scenes/dashboard/dashboardsListEmptyAiStarterPrompts.tsx
deleted file mode 100644
index 49e4eaabc333..000000000000
--- a/frontend/src/scenes/dashboard/dashboardsListEmptyAiStarterPrompts.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import { DashboardAiPromptChip, DashboardAiPromptChips } from './dashboardAiPromptChips'
-
-/** Prompts when the project has no dashboards yet: AI helps plan a first board (not “this dashboard”). */
-export const DASHBOARDS_LIST_EMPTY_AI_PROMPT_CHIPS: readonly DashboardAiPromptChip[] = [
- {
- id: 'first_board_pages_and_sources',
- label: 'See which pages get the most traffic and where people come from',
- prompt: "I don't have a dashboard yet. Help me plan a first one around traffic: which pages or routes are getting the most views, and where visitors are coming from (referrer, UTM, or channel when available). Assume I have pageviews or $pageview. Suggest insight types and a sensible order to build them.",
- },
- {
- id: 'first_board_usage_trend',
- label: 'See whether usage is going up, flat, or down over time',
- prompt: "I don't have a dashboard yet. Help me plan a first board that answers whether more people are showing up over time: what to plot (DAU, weekly active users, or a key event), good default time ranges, and one breakdown that usually helps. Suggest a dashboard name and a short list of insights in order.",
- },
- {
- id: 'first_board_new_posthog_one_journey',
- label: 'Plan a dashboard around one user journey you care about',
- prompt: "I don't have a dashboard yet. Help me plan a first dashboard centered on one journey that matters (for example visit to signup, or signup to first meaningful action). Suggest several complementary insights: at minimum a funnel across the steps, plus a few supporting charts (for example volume or conversion over time, a useful breakdown, or drop-off focus on the worst step). Walk me through events or pageviews to use, a dashboard name, and the insights in a sensible build order.",
- },
-]
-
-export type DashboardsListEmptyAiStarterPromptsProps = {
- chipDisabledReason?: string | null
- onOpenAiWithPrompt: (prompt: string) => void
- className?: string
-}
-
-export function DashboardsListEmptyAiStarterPrompts({
- chipDisabledReason,
- onOpenAiWithPrompt,
- className,
-}: DashboardsListEmptyAiStarterPromptsProps): JSX.Element {
- return (
- <DashboardAiPromptChips
- chips={DASHBOARDS_LIST_EMPTY_AI_PROMPT_CHIPS}
- chipDisabledReason={chipDisabledReason}
- onOpenAiWithPrompt={onOpenAiWithPrompt}
- dataAttrPrefix="dashboards-list-empty-ai-prompt"
- className={className}
- description="No dashboard yet? Pick a topic and PostHog AI can help you plan what to build first."
- />
- )
-}
diff --git a/frontend/src/scenes/dashboard/newDashboardLogic.ts b/frontend/src/scenes/dashboard/newDashboardLogic.ts
index 0bb8716e7ce1..bd69a86bed68 100644
--- a/frontend/src/scenes/dashboard/newDashboardLogic.ts
+++ b/frontend/src/scenes/dashboard/newDashboardLogic.ts
@@ -3,6 +3,7 @@ import { forms } from 'kea-forms'
import { actionToUrl, router, urlToAction } from 'kea-router'
import api from 'lib/api'
+import { tryShowMCPHint } from 'lib/components/MCPHint/mcpHintLogic'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
@@ -208,6 +209,7 @@ export const newDashboardLogic = kea<newDashboardLogicType>([
const queryBasedDashboard = getQueryBasedDashboard(result)
queryBasedDashboard && dashboardsModel.actions.addDashboardSuccess(queryBasedDashboard)
actions.submitNewDashboardSuccessWithResult(result)
+ tryShowMCPHint('dashboards.create')
if (show && values.redirectAfterCreation) {
breakpoint()
router.actions.push(urls.dashboard(result.id))
diff --git a/frontend/src/scenes/data-warehouse/editor/OutputPane.tsx b/frontend/src/scenes/data-warehouse/editor/OutputPane.tsx
index 8e4f5f4c1b77..7c82de55fd71 100644
--- a/frontend/src/scenes/data-warehouse/editor/OutputPane.tsx
+++ b/frontend/src/scenes/data-warehouse/editor/OutputPane.tsx
@@ -23,6 +23,7 @@ import { LemonButton, LemonDivider, LemonMenu, LemonModal, LemonTable, Tooltip }
import { ExportButton } from 'lib/components/ExportButton/ExportButton'
import { JSONViewer } from 'lib/components/JSONViewer'
+import { MCPUseCaseCard } from 'lib/components/MCPHint/MCPUseCaseCard'
import { Resizer } from 'lib/components/Resizer/Resizer'
import { type ResizerLogicProps, resizerLogic } from 'lib/components/Resizer/resizerLogic'
import { TZLabel } from 'lib/components/TZLabel'
@@ -72,6 +73,8 @@ interface RowDetailsModalProps {
columnKeys: string[]
}
+const ONE_DAY_IN_MILLISECONDS = 24 * 60 * 60 * 1000
+
const CLICKHOUSE_TYPES = [
'UUID',
'String',
@@ -1035,13 +1038,18 @@ const Content = ({
if (!response && !responseLoading && !insightLoading) {
return (
<div
- className="flex flex-1 justify-center items-center border-t"
+ className="flex flex-1 flex-col justify-center items-center border-t gap-4 p-4"
data-attr="sql-editor-output-pane-empty-state"
>
- <span className="text-secondary mt-3">
+ <span className="text-secondary">
Query results will be visualized here. Press <KeyboardShortcut command enter /> to run the
query.
</span>
+ <MCPUseCaseCard
+ surfaceKey="sql.execute"
+ expiresAfterMs={ONE_DAY_IN_MILLISECONDS}
+ className="max-w-140"
+ />
</div>
)
}
@@ -1083,13 +1091,18 @@ const Content = ({
: 'Query results will be visualized here.'
return (
<div
- className="flex flex-1 justify-center items-center border-t px-4 text-center"
+ className="flex flex-1 flex-col justify-center items-center border-t px-4 py-6 gap-4 text-center"
data-attr="sql-editor-output-pane-empty-state"
>
- <span className="text-secondary mt-3">
+ <span className="text-secondary max-w-xl">
{msg} Press <KeyboardShortcut command enter /> to run the query at your cursor. Separate multiple
statements with <code>;</code> to run them independently.
</span>
+ <MCPUseCaseCard
+ surfaceKey="sql.execute"
+ expiresAfterMs={ONE_DAY_IN_MILLISECONDS}
+ className="max-w-140"
+ />
</div>
)
}
diff --git a/frontend/src/scenes/data-warehouse/editor/sqlEditorLogic.tsx b/frontend/src/scenes/data-warehouse/editor/sqlEditorLogic.tsx
index 126ccf980e54..96b7ea313444 100644
--- a/frontend/src/scenes/data-warehouse/editor/sqlEditorLogic.tsx
+++ b/frontend/src/scenes/data-warehouse/editor/sqlEditorLogic.tsx
@@ -22,6 +22,7 @@ import posthog from 'posthog-js'
import { LemonCheckbox, LemonDialog, LemonInput, LemonSelect, lemonToast, Tooltip } from '@posthog/lemon-ui'
import api, { ApiError } from 'lib/api'
+import { tryShowMCPHint } from 'lib/components/MCPHint/mcpHintLogic'
import { SetupTaskId, globalSetupLogic } from 'lib/components/ProductSetup'
import { FEATURE_FLAGS } from 'lib/constants'
import { LemonField } from 'lib/lemon-ui/LemonField'
@@ -1232,6 +1233,7 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
// Mark the first query task as complete when the query is run
globalSetupLogic.findMounted()?.actions.markTaskAsCompleted(SetupTaskId.RunFirstQuery)
+ tryShowMCPHint('sql.execute')
},
saveAsView: async ({ fromDraft, materializeAfterSave = false }) => {
const multiDagEnabled = !!values.featureFlags[FEATURE_FLAGS.DATA_MODELING_MULTI_DAG]
diff --git a/frontend/src/scenes/experiments/ExperimentForm/createExperimentLogic.ts b/frontend/src/scenes/experiments/ExperimentForm/createExperimentLogic.ts
index e7159a0fa7d2..cb542fddc0a4 100644
--- a/frontend/src/scenes/experiments/ExperimentForm/createExperimentLogic.ts
+++ b/frontend/src/scenes/experiments/ExperimentForm/createExperimentLogic.ts
@@ -2,6 +2,7 @@ import { actions, connect, events, kea, key, listeners, path, props, reducers, s
import { router } from 'kea-router'
import api from 'lib/api'
+import { tryShowMCPHint } from 'lib/components/MCPHint/mcpHintLogic'
import { SetupTaskId, globalSetupLogic } from 'lib/components/ProductSetup'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
@@ -382,6 +383,7 @@ export const createExperimentLogic = kea<createExperimentLogicType>([
actions.createExperimentSuccess()
globalSetupLogic.findMounted()?.actions.markTaskAsCompleted(SetupTaskId.CreateExperiment)
lemonToast.success('Experiment created successfully!')
+ tryShowMCPHint('experiments.create')
// Don't reset - we just set the fresh data above
actions.saveExperimentSuccess()
diff --git a/frontend/src/scenes/experiments/Experiments.tsx b/frontend/src/scenes/experiments/Experiments.tsx
index 140af4ebe388..5433cc1db1ce 100644
--- a/frontend/src/scenes/experiments/Experiments.tsx
+++ b/frontend/src/scenes/experiments/Experiments.tsx
@@ -499,6 +499,7 @@ const ExperimentsTable = ({
isEmpty={shouldShowEmptyState}
customHog={ExperimentsHog}
className="my-0"
+ mcpSurfaceKey="experiments.create"
/>
</AccessControlAction>
)}
diff --git a/frontend/src/scenes/experiments/experimentLogic.tsx b/frontend/src/scenes/experiments/experimentLogic.tsx
index 35534960531e..1e29ae455d3d 100644
--- a/frontend/src/scenes/experiments/experimentLogic.tsx
+++ b/frontend/src/scenes/experiments/experimentLogic.tsx
@@ -4,6 +4,7 @@ import { loaders } from 'kea-loaders'
import { router } from 'kea-router'
import api from 'lib/api'
+import { tryShowMCPHint } from 'lib/components/MCPHint/mcpHintLogic'
import { SetupTaskId, globalSetupLogic } from 'lib/components/ProductSetup'
import { dayjs } from 'lib/dayjs'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
@@ -1418,6 +1419,7 @@ export const experimentLogic = kea<experimentLogicType>([
actions.refreshExperimentResults(false, 'manual')
actions.setUnmodifiedExperiment(structuredClone(experimentWithMetricOrdering))
globalSetupLogic.findMounted()?.actions.markTaskAsCompleted(SetupTaskId.LaunchExperiment)
+ tryShowMCPHint('experiments.launch')
} catch (error: any) {
lemonToast.error(error.detail || 'Failed to launch experiment')
} finally {
diff --git a/frontend/src/scenes/feature-flags/FeatureFlags.tsx b/frontend/src/scenes/feature-flags/FeatureFlags.tsx
index 155bbcc805fb..cdf58cf15e80 100644
--- a/frontend/src/scenes/feature-flags/FeatureFlags.tsx
+++ b/frontend/src/scenes/feature-flags/FeatureFlags.tsx
@@ -532,6 +532,7 @@ export function OverviewTab({
isEmpty={shouldShowEmptyState}
customHog={FeatureFlagHog}
className={cn('my-0')}
+ mcpSurfaceKey="feature_flags.create"
/>
{!isProductIntroVisible && <ApprovalsPromoBanner />}
<PendingApprovalsBanner />
diff --git a/frontend/src/scenes/feature-flags/featureFlagLogic.ts b/frontend/src/scenes/feature-flags/featureFlagLogic.ts
index b56e8a176d06..2f8e766d87cb 100644
--- a/frontend/src/scenes/feature-flags/featureFlagLogic.ts
+++ b/frontend/src/scenes/feature-flags/featureFlagLogic.ts
@@ -21,6 +21,7 @@ import { createElement } from 'react'
import api, { PaginatedResponse } from 'lib/api'
import { handleApprovalRequired } from 'lib/approvals/utils'
+import { tryShowMCPHint } from 'lib/components/MCPHint/mcpHintLogic'
import { SetupTaskId, globalSetupLogic } from 'lib/components/ProductSetup'
import { FEATURE_FLAGS } from 'lib/constants'
import { Dayjs, dayjs } from 'lib/dayjs'
@@ -1825,6 +1826,7 @@ export const featureFlagLogic = kea<featureFlagLogicType>([
},
saveFeatureFlagSuccess: ({ featureFlag }) => {
lemonToast.success('Feature flag saved')
+ tryShowMCPHint(props.id === 'new' ? 'feature_flags.create' : 'feature_flags.update')
actions.setFeatureFlag(featureFlag)
actions.updateFlag(featureFlag)
featureFlag.id && router.actions.replace(urls.featureFlag(featureFlag.id))
diff --git a/frontend/src/scenes/insights/EmptyStates/EmptyStates.tsx b/frontend/src/scenes/insights/EmptyStates/EmptyStates.tsx
index 7f5c2303b420..27e1e284fb86 100644
--- a/frontend/src/scenes/insights/EmptyStates/EmptyStates.tsx
+++ b/frontend/src/scenes/insights/EmptyStates/EmptyStates.tsx
@@ -10,6 +10,7 @@ import { LemonButton } from '@posthog/lemon-ui'
import { AccessControlAction } from 'lib/components/AccessControlAction'
import { BuilderHog3 } from 'lib/components/hedgehogs'
+import { MCPUseCaseCard } from 'lib/components/MCPHint/MCPUseCaseCard'
import { supportLogic } from 'lib/components/Support/supportLogic'
import { dayjs } from 'lib/dayjs'
import { holidaysMatcher, isChristmas } from 'lib/holidays'
@@ -837,6 +838,11 @@ export function SavedInsightsEmptyState({
</Link>
)}
</div>
+ {!usingFilters && (
+ <div className="mt-4">
+ <MCPUseCaseCard surfaceKey="insights.create" className="max-w-140" />
+ </div>
+ )}
</div>
)
}
diff --git a/frontend/src/scenes/insights/insightLogic.tsx b/frontend/src/scenes/insights/insightLogic.tsx
index f70d07e13267..ca6544a4dd0b 100644
--- a/frontend/src/scenes/insights/insightLogic.tsx
+++ b/frontend/src/scenes/insights/insightLogic.tsx
@@ -13,6 +13,7 @@ import {
isDisplayLabelsEnabledInInsightQuery,
} from 'lib/components/Cards/InsightCard/displayLabelsToggle'
import { canToggleLegendInInsightQuery, getLegendToggleText } from 'lib/components/Cards/InsightCard/legendToggle'
+import { tryShowMCPHint } from 'lib/components/MCPHint/mcpHintLogic'
import { SetupTaskId, globalSetupLogic } from 'lib/components/ProductSetup'
import { FEATURE_FLAGS } from 'lib/constants'
import { LemonField } from 'lib/lemon-ui/LemonField'
@@ -608,6 +609,7 @@ export const insightLogic: LogicWrapper<insightLogicType> = kea<insightLogicType
action: () => router.actions.push(urls.savedInsights()),
},
})
+ tryShowMCPHint('insights.create')
dashboardsModel.findMounted()?.actions.updateDashboardInsight(savedInsight)
diff --git a/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/WizardCommandBlock.scss b/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/WizardCommandBlock.scss
new file mode 100644
index 000000000000..dd098e09ad3e
--- /dev/null
+++ b/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/WizardCommandBlock.scss
@@ -0,0 +1,29 @@
+// Hedgehog "casting a spell" wobble — played by remounting the <img> element
+// with a fresh key, so the animation runs from the start on every copy click.
+
+.WizardCommandBlock__hogCast {
+ animation: WizardCommandBlock-hogCast 500ms ease-out;
+}
+
+/* stylelint-disable-next-line keyframes-name-pattern */
+@keyframes WizardCommandBlock-hogCast {
+ 0% {
+ transform: rotate(0deg);
+ }
+
+ 20% {
+ transform: rotate(-8deg);
+ }
+
+ 50% {
+ transform: rotate(5deg);
+ }
+
+ 80% {
+ transform: rotate(-2deg);
+ }
+
+ 100% {
+ transform: rotate(0deg);
+ }
+}
diff --git a/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/WizardCommandBlock.tsx b/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/WizardCommandBlock.tsx
index d992a8810162..610e28dfe67c 100644
--- a/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/WizardCommandBlock.tsx
+++ b/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/WizardCommandBlock.tsx
@@ -1,8 +1,9 @@
-import { useState } from 'react'
+import './WizardCommandBlock.scss'
-import { IconCopy, IconTerminal } from '@posthog/icons'
+import { useState } from 'react'
-import { copyToClipboard } from 'lib/utils/copyToClipboard'
+import { CommandBlock } from 'lib/components/CommandBlock/CommandBlock'
+import { cn } from 'lib/utils/css-classes'
import { useWizardCommand } from '../sdk-install-instructions/components/SetupWizardBanner'
@@ -26,33 +27,11 @@ const WIZARD_FRAMEWORKS = [
'Python',
]
-const WIZARD_GRADIENT_STYLE: React.CSSProperties = {
- color: 'transparent',
- WebkitBackgroundClip: 'text',
- backgroundClip: 'text',
- backgroundImage:
- 'linear-gradient(90deg, #0143cb 0%, #2b6ff4 24%, #d23401 47%, #ff651f 66%, #fba000 83%, #0143cb 100%)',
- backgroundSize: '200% 100%',
- animation: 'wizard-gradient-scroll 3s linear infinite',
-}
-
-const WIZARD_FLASH_STYLE: React.CSSProperties = {
- ...WIZARD_GRADIENT_STYLE,
- color: '#36C46F',
- backgroundImage: 'none',
- WebkitBackgroundClip: 'unset',
- backgroundClip: 'unset',
- animation: 'wizard-copied-flash 1500ms ease-out forwards',
- position: 'absolute',
- inset: 0,
- pointerEvents: 'none',
-}
-
const WIZARD_HOG_URL = 'https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png'
export function WizardCommandBlock(): JSX.Element {
const { wizardCommand, isCloudOrDev } = useWizardCommand()
- const [copyKey, setCopyKey] = useState(0)
+ const [castKey, setCastKey] = useState(0)
// The `npx @posthog/wizard` CLI only targets cloud (US/EU) and dev instances —
// self-hosted deployments have no preconfigured endpoint, so we hide the block
@@ -61,72 +40,28 @@ export function WizardCommandBlock(): JSX.Element {
return <></>
}
- const handleCopy = (): void => {
- void copyToClipboard(wizardCommand, 'Wizard command')
- setCopyKey((k) => k + 1)
- }
-
return (
<div className="flex flex-col gap-3">
- {/* Inject keyframe animations */}
- <style>{`
- @keyframes wizard-gradient-scroll {
- 0% { background-position-x: 0%; }
- 100% { background-position-x: 200%; }
- }
- @keyframes wizard-copied-flash {
- 0%, 50% { opacity: 1; }
- 100% { opacity: 0; }
- }
- @keyframes wizard-copy-bounce {
- 0% { transform: scale(1); }
- 15% { transform: scale(0.96); }
- 40% { transform: scale(1.03); }
- 70% { transform: scale(0.99); }
- 100% { transform: scale(1); }
- }
- @keyframes wizard-hog-cast {
- 0% { transform: rotate(0deg); }
- 20% { transform: rotate(-8deg); }
- 50% { transform: rotate(5deg); }
- 80% { transform: rotate(-2deg); }
- 100% { transform: rotate(0deg); }
- }
- `}</style>
-
<div className="flex gap-6">
<img
- key={`hog-${copyKey}`}
+ key={`hog-${castKey}`}
src={WIZARD_HOG_URL}
alt="PostHog wizard hedgehog"
- className="w-28 h-28 hidden sm:block shrink-0 self-center"
- style={copyKey > 0 ? { animation: 'wizard-hog-cast 500ms ease-out' } : undefined}
+ className={cn(
+ 'w-28 h-28 hidden sm:block shrink-0 self-center',
+ castKey > 0 && 'WizardCommandBlock__hogCast'
+ )}
/>
<div className="flex-1 flex flex-col gap-3">
- <button
- onClick={handleCopy}
- key={`btn-${copyKey}`}
- className="group inline-flex items-center gap-2 bg-bg-light border border-border font-mono text-sm px-4 py-3 rounded-lg cursor-pointer hover:border-primary transition-colors w-fit"
- style={copyKey > 0 ? { animation: 'wizard-copy-bounce 400ms ease-out' } : undefined}
- >
- <IconTerminal className="size-4 text-muted" />
- <span className="relative">
- <code style={WIZARD_GRADIENT_STYLE} className="!bg-transparent !p-0 !border-0 select-all">
- {wizardCommand}
- </code>
- {copyKey > 0 && (
- <code
- key={copyKey}
- style={WIZARD_FLASH_STYLE}
- className="!bg-transparent !p-0 !border-0"
- aria-hidden="true"
- >
- {wizardCommand}
- </code>
- )}
- </span>
- <IconCopy className="size-4 text-muted group-hover:text-primary" />
- </button>
+ <CommandBlock
+ command={wizardCommand}
+ copyLabel="Wizard command"
+ ariaLabel="Copy wizard command"
+ size="md"
+ decoration="rainbow"
+ className="bg-bg-light border border-border hover:border-primary"
+ onCopy={(key) => setCastKey(key)}
+ />
<p className="text-xs text-muted mb-0">
Auto-detects your framework, installs the SDK, and sets up event capture.
diff --git a/frontend/src/scenes/settings/SettingsMap.tsx b/frontend/src/scenes/settings/SettingsMap.tsx
index 3b107bf7103b..4580d50fae18 100644
--- a/frontend/src/scenes/settings/SettingsMap.tsx
+++ b/frontend/src/scenes/settings/SettingsMap.tsx
@@ -145,6 +145,7 @@ import { AllowImpersonation } from './user/AllowImpersonation'
import { ChangePassword, ChangePasswordTitle } from './user/ChangePassword'
import { ConnectedApps } from './user/ConnectedApps'
import { HedgehogModeSettings } from './user/HedgehogModeSettings'
+import { MCPHintsSetting } from './user/MCPHintsSetting'
import { OptOutCapture } from './user/OptOutCapture'
import { PasskeySettings } from './user/PasskeySettings'
import { PersonalAPIKeys } from './user/PersonalAPIKeys'
@@ -1754,6 +1755,15 @@ export const SETTINGS_MAP: SettingSection[] = [
component: <SidebarAutoSuggestSetting />,
keywords: ['sidebar', 'suggest', 'products', 'apps', 'auto'],
},
+ {
+ id: 'mcp-hints',
+ title: 'MCP hints',
+ description:
+ 'After you take an action in PostHog (creating a feature flag, building a dashboard, etc.), show a small hint that the same action can be done from your IDE via the PostHog MCP. Rate-limited to once a week.',
+ component: <MCPHintsSetting />,
+ flag: [['MCP_HINTS', 'test']],
+ keywords: ['mcp', 'claude', 'cursor', 'codex', 'ide', 'hints', 'wizard'],
+ },
{
id: 'hedgehog-mode',
title: 'Hedgehog mode',
diff --git a/frontend/src/scenes/settings/settingsLogic.ts b/frontend/src/scenes/settings/settingsLogic.ts
index fee528b66f9b..72f4bfe9c68a 100644
--- a/frontend/src/scenes/settings/settingsLogic.ts
+++ b/frontend/src/scenes/settings/settingsLogic.ts
@@ -6,7 +6,7 @@ import { actionToUrl, router, urlToAction } from 'kea-router'
import api from 'lib/api'
import { FEATURE_FLAGS } from 'lib/constants'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
+import { featureFlagLogic, FeatureFlagsSet } from 'lib/logic/featureFlagLogic'
import { createFuse } from 'lib/utils/fuseSearch'
import { billingLogic } from 'scenes/billing/billingLogic'
import { organizationLogic } from 'scenes/organizationLogic'
@@ -77,6 +77,43 @@ const getSectionStringValue = (section: SettingSection): string => {
return section.id
}
+export const matchesFlagDefinition = (
+ flagKey: Pick<Setting, 'flag'>['flag'],
+ featureFlags: FeatureFlagsSet
+): boolean => {
+ // No flag condition
+ if (!flagKey) {
+ return true
+ }
+
+ const flagsArray = Array.isArray(flagKey) ? flagKey : [flagKey]
+ for (const flagCondition of flagsArray) {
+ // Tuple flag condition ([flag, value])
+ if (Array.isArray(flagCondition)) {
+ const [flag, value] = flagCondition
+ const isConditionMet = featureFlags[FEATURE_FLAGS[flag]] === value
+ if (!isConditionMet) {
+ return false
+ }
+ // Negated flag condition (`!${FeatureFlagKey}`)
+ } else if (flagCondition.startsWith('!')) {
+ const flag = flagCondition.slice(1) as keyof typeof FEATURE_FLAGS
+ const isConditionMet = !featureFlags[FEATURE_FLAGS[flag]]
+ if (!isConditionMet) {
+ return false
+ }
+ // Normal flag condition (FeatureFlagKey)
+ } else {
+ const flag = flagCondition as keyof typeof FEATURE_FLAGS
+ const isConditionMet = !!featureFlags[FEATURE_FLAGS[flag]]
+ if (!isConditionMet) {
+ return false
+ }
+ }
+ }
+ return true
+}
+
export const settingsLogic = kea<settingsLogicType>([
props({} as SettingsLogicProps),
key((props) => props.logicKey ?? 'global'),
@@ -447,26 +484,8 @@ export const settingsLogic = kea<settingsLogicType>([
doesMatchFlags: [
(s) => [s.featureFlags],
(featureFlags) => {
- return (x: Pick<Setting, 'flag'>) => {
- if (!x.flag) {
- // No flag condition
- return true
- }
- const flagsArray = Array.isArray(x.flag) ? x.flag : [x.flag]
- for (const flagCondition of flagsArray) {
- const flag = (
- flagCondition.startsWith('!') ? flagCondition.slice(1) : flagCondition
- ) as keyof typeof FEATURE_FLAGS
- let isConditionMet = featureFlags[FEATURE_FLAGS[flag]]
- if (flagCondition.startsWith('!')) {
- isConditionMet = !isConditionMet // Negated flag condition (!-prefixed)
- }
- if (!isConditionMet) {
- return false
- }
- }
- return true
- }
+ return (flagDefinition: Pick<Setting, 'flag'>) =>
+ matchesFlagDefinition(flagDefinition.flag, featureFlags)
},
],
diff --git a/frontend/src/scenes/settings/types.ts b/frontend/src/scenes/settings/types.ts
index 0da77f469b02..0bace1c0b880 100644
--- a/frontend/src/scenes/settings/types.ts
+++ b/frontend/src/scenes/settings/types.ts
@@ -226,6 +226,7 @@ export type SettingId =
| 'approval-policies'
| 'change-requests'
| 'banner'
+ | 'mcp-hints'
type FeatureFlagKey = keyof typeof FEATURE_FLAGS
@@ -241,8 +242,13 @@ export type Setting = {
* Feature flag to gate the setting being shown.
* If prefixed with !, the condition is inverted - the setting will only be shown if the is flag false.
* When an array is provided, the setting will be shown if ALL of the conditions are met.
+ * When a tuple is provided, the setting will be shown if the feature flag is enabled and the value matches the given value.
*/
- flag?: FeatureFlagKey | `!${FeatureFlagKey}` | (FeatureFlagKey | `!${FeatureFlagKey}`)[]
+ flag?:
+ | FeatureFlagKey
+ | `!${FeatureFlagKey}`
+ | (FeatureFlagKey | `!${FeatureFlagKey}`)[]
+ | [[FeatureFlagKey, string | boolean]]
/**
* defaults to true if not provided
diff --git a/frontend/src/scenes/settings/user/MCPHintsSetting.tsx b/frontend/src/scenes/settings/user/MCPHintsSetting.tsx
new file mode 100644
index 000000000000..d4d9a478c770
--- /dev/null
+++ b/frontend/src/scenes/settings/user/MCPHintsSetting.tsx
@@ -0,0 +1,22 @@
+import { useActions, useValues } from 'kea'
+
+import { LemonSwitch } from '@posthog/lemon-ui'
+
+import { userLogic } from 'scenes/userLogic'
+
+export function MCPHintsSetting(): JSX.Element {
+ const { user, userLoading } = useValues(userLogic)
+ const { updateUser } = useActions(userLogic)
+
+ return (
+ <LemonSwitch
+ onChange={(checked) => {
+ updateUser({ hide_mcp_hints: !checked })
+ }}
+ checked={!(user?.hide_mcp_hints ?? false)}
+ loading={userLoading}
+ label="Show MCP hints after I take actions"
+ bordered
+ />
+ )
+}
diff --git a/frontend/src/scenes/surveys/components/empty-state/SurveysEmptyState.tsx b/frontend/src/scenes/surveys/components/empty-state/SurveysEmptyState.tsx
index 01420578d292..5c57b95f1a3e 100644
--- a/frontend/src/scenes/surveys/components/empty-state/SurveysEmptyState.tsx
+++ b/frontend/src/scenes/surveys/components/empty-state/SurveysEmptyState.tsx
@@ -6,6 +6,7 @@ import { IconArrowRight, IconSparkles } from '@posthog/icons'
import { LemonButton, LemonTextArea } from '@posthog/lemon-ui'
import { MicrophoneHog } from 'lib/components/hedgehogs'
+import { MCPUseCaseCard } from 'lib/components/MCPHint/MCPUseCaseCard'
import { FEATURE_FLAGS } from 'lib/constants'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
@@ -92,6 +93,8 @@ function SurveysEmptyStateContent(): JSX.Element {
</p>
</div>
+ <MCPUseCaseCard surfaceKey="surveys.create" className="!mt-0 w-full" />
+
{featuredTemplate && (
<div>
<FeaturedTemplateCard
@@ -175,6 +178,8 @@ function SurveysEmptyStateAIContent(): JSX.Element {
</p>
</div>
+ <MCPUseCaseCard surfaceKey="surveys.create" className="!mt-0 w-full mb-6" />
+
<div className="rounded-xl border-2 border-[var(--color-ai)] mb-8">
<label
htmlFor="survey-ai-prompt"
diff --git a/frontend/src/scenes/surveys/surveyLogic.tsx b/frontend/src/scenes/surveys/surveyLogic.tsx
index 6cc5a3aa9cda..e6f9221f2e3c 100644
--- a/frontend/src/scenes/surveys/surveyLogic.tsx
+++ b/frontend/src/scenes/surveys/surveyLogic.tsx
@@ -7,6 +7,7 @@ import posthog from 'posthog-js'
import { lemonToast } from '@posthog/lemon-ui'
import api from 'lib/api'
+import { tryShowMCPHint } from 'lib/components/MCPHint/mcpHintLogic'
import { SetupTaskId, globalSetupLogic } from 'lib/components/ProductSetup'
import { FEATURE_FLAGS } from 'lib/constants'
import { dayjs } from 'lib/dayjs'
@@ -1153,6 +1154,7 @@ export const surveyLogic = kea<surveyLogicType>([
router.actions.replace(urls.survey(survey.id))
actions.reportSurveyCreated(survey)
globalSetupLogic.findMounted()?.actions.markTaskAsCompleted(SetupTaskId.CreateSurvey)
+ tryShowMCPHint('surveys.create')
},
updateSurveySuccess: ({ survey }) => {
lemonToast.success(<>Survey {survey.name} updated</>)
diff --git a/frontend/src/styles/base.scss b/frontend/src/styles/base.scss
index fbbb9dd87883..dcb8fb35b1bf 100644
--- a/frontend/src/styles/base.scss
+++ b/frontend/src/styles/base.scss
@@ -2076,3 +2076,62 @@
box-shadow: 0 0 24px 8px var(--color-accent);
}
}
+
+// Rainbow brand gradient — animated horizontal scroll of PostHog brand colors.
+// Apply via `background-image: var(--rainbow-gradient)` or via the helper
+// classes below. The text variants use `background-clip: text` so the gradient
+// fills the glyphs; `*-fading` additionally plays a one-shot fade-in on mount,
+// useful for elements that swap content via a key change.
+:root {
+ --rainbow-gradient: linear-gradient(
+ 90deg,
+ #0143cb 0%,
+ #2b6ff4 24%,
+ #d23401 47%,
+ #ff651f 66%,
+ #fba000 83%,
+ #0143cb 100%
+ );
+}
+
+.rainbow-text,
+.rainbow-text-fading {
+ color: transparent;
+ background-image: var(--rainbow-gradient);
+ background-clip: text;
+ background-size: 200% 100%;
+}
+
+.rainbow-text.rainbow-text-animating {
+ animation: rainbow-scroll 3s linear infinite;
+}
+
+.rainbow-text-fading.rainbow-text-animating {
+ animation:
+ rainbow-scroll 3s linear infinite,
+ rainbow-fade-in 300ms ease-out;
+}
+
+/* stylelint-disable-next-line keyframes-name-pattern */
+@keyframes rainbow-scroll {
+ 0% {
+ background-position-x: 0%;
+ }
+
+ 100% {
+ background-position-x: 200%;
+ }
+}
+
+/* stylelint-disable-next-line keyframes-name-pattern */
+@keyframes rainbow-fade-in {
+ from {
+ opacity: 0;
+ transform: translateY(2px);
+ }
+
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+}
diff --git a/frontend/src/types.ts b/frontend/src/types.ts
index 287b33febe1c..22f397c29cef 100644
--- a/frontend/src/types.ts
+++ b/frontend/src/types.ts
@@ -351,6 +351,7 @@ export interface UserType extends UserBaseType {
has_sso_enforcement: boolean
shortcut_position: UserShortcutPosition
has_seen_product_intro_for?: Record<string, boolean>
+ hide_mcp_hints?: boolean
scene_personalisation?: SceneDashboardChoice[]
theme_mode?: UserTheme | null
hedgehog_config?: HedgehogConfig
diff --git a/posthog/api/test/__snapshots__/test_action.ambr b/posthog/api/test/__snapshots__/test_action.ambr
index fea4d59b3399..40ef2506862a 100644
--- a/posthog/api/test/__snapshots__/test_action.ambr
+++ b/posthog/api/test/__snapshots__/test_action.ambr
@@ -29,6 +29,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -412,6 +413,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -493,6 +495,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -1005,6 +1008,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -1259,6 +1263,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -1316,6 +1321,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
diff --git a/posthog/api/test/__snapshots__/test_annotation.ambr b/posthog/api/test/__snapshots__/test_annotation.ambr
index bc3076f994e3..9834d0e3cd85 100644
--- a/posthog/api/test/__snapshots__/test_annotation.ambr
+++ b/posthog/api/test/__snapshots__/test_annotation.ambr
@@ -29,6 +29,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -449,6 +450,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -503,6 +505,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -1052,6 +1055,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -1272,6 +1276,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
diff --git a/posthog/api/test/__snapshots__/test_element.ambr b/posthog/api/test/__snapshots__/test_element.ambr
index 65bde2164bf9..1dff70be34a2 100644
--- a/posthog/api/test/__snapshots__/test_element.ambr
+++ b/posthog/api/test/__snapshots__/test_element.ambr
@@ -29,6 +29,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
diff --git a/posthog/api/test/__snapshots__/test_feature_flag.ambr b/posthog/api/test/__snapshots__/test_feature_flag.ambr
index 3a8c1b99be22..7b887b00e7f0 100644
--- a/posthog/api/test/__snapshots__/test_feature_flag.ambr
+++ b/posthog/api/test/__snapshots__/test_feature_flag.ambr
@@ -1760,6 +1760,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -2532,6 +2533,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -2831,6 +2833,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -2868,6 +2871,7 @@
T5."allow_sidebar_suggestions",
T5."shortcut_position",
T5."passkeys_enabled_for_2fa",
+ T5."hide_mcp_hints",
T5."onboarding_skipped_at",
T5."onboarding_skipped_reason",
T5."onboarding_skipped_organization_id",
diff --git a/posthog/api/test/__snapshots__/test_insight.ambr b/posthog/api/test/__snapshots__/test_insight.ambr
index 34d5dbfe8795..1f59a3903c65 100644
--- a/posthog/api/test/__snapshots__/test_insight.ambr
+++ b/posthog/api/test/__snapshots__/test_insight.ambr
@@ -603,6 +603,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -1597,6 +1598,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -2134,6 +2136,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
diff --git a/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr b/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr
index 62408bfb105d..f81176f9aa6f 100644
--- a/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr
+++ b/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr
@@ -29,6 +29,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -2915,6 +2916,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -3455,6 +3457,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -3678,6 +3681,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -3722,6 +3726,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
diff --git a/posthog/api/test/__snapshots__/test_plugin.ambr b/posthog/api/test/__snapshots__/test_plugin.ambr
index 211bc39e130f..32a62029fdda 100644
--- a/posthog/api/test/__snapshots__/test_plugin.ambr
+++ b/posthog/api/test/__snapshots__/test_plugin.ambr
@@ -29,6 +29,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -354,6 +355,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -717,6 +719,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -1177,6 +1180,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
diff --git a/posthog/api/test/__snapshots__/test_preflight.ambr b/posthog/api/test/__snapshots__/test_preflight.ambr
index cec306521845..4bb56298152c 100644
--- a/posthog/api/test/__snapshots__/test_preflight.ambr
+++ b/posthog/api/test/__snapshots__/test_preflight.ambr
@@ -29,6 +29,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
diff --git a/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr b/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr
index 57ab6f08fa83..2e614fe5be0c 100644
--- a/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr
+++ b/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr
@@ -29,6 +29,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -1155,6 +1156,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -1620,6 +1622,7 @@
T6."allow_sidebar_suggestions",
T6."shortcut_position",
T6."passkeys_enabled_for_2fa",
+ T6."hide_mcp_hints",
T6."onboarding_skipped_at",
T6."onboarding_skipped_reason",
T6."onboarding_skipped_organization_id",
@@ -1882,6 +1885,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -1919,6 +1923,7 @@
T6."allow_sidebar_suggestions",
T6."shortcut_position",
T6."passkeys_enabled_for_2fa",
+ T6."hide_mcp_hints",
T6."onboarding_skipped_at",
T6."onboarding_skipped_reason",
T6."onboarding_skipped_organization_id",
@@ -2470,6 +2475,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -2507,6 +2513,7 @@
T6."allow_sidebar_suggestions",
T6."shortcut_position",
T6."passkeys_enabled_for_2fa",
+ T6."hide_mcp_hints",
T6."onboarding_skipped_at",
T6."onboarding_skipped_reason",
T6."onboarding_skipped_organization_id",
@@ -2753,6 +2760,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -2967,6 +2975,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -4089,6 +4098,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -4547,6 +4557,7 @@
T6."allow_sidebar_suggestions",
T6."shortcut_position",
T6."passkeys_enabled_for_2fa",
+ T6."hide_mcp_hints",
T6."onboarding_skipped_at",
T6."onboarding_skipped_reason",
T6."onboarding_skipped_organization_id",
@@ -4980,6 +4991,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -5571,6 +5583,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -7096,6 +7109,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -8621,6 +8635,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -9150,6 +9165,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -9187,6 +9203,7 @@
T6."allow_sidebar_suggestions",
T6."shortcut_position",
T6."passkeys_enabled_for_2fa",
+ T6."hide_mcp_hints",
T6."onboarding_skipped_at",
T6."onboarding_skipped_reason",
T6."onboarding_skipped_organization_id",
@@ -9291,6 +9308,7 @@
T6."allow_sidebar_suggestions",
T6."shortcut_position",
T6."passkeys_enabled_for_2fa",
+ T6."hide_mcp_hints",
T6."onboarding_skipped_at",
T6."onboarding_skipped_reason",
T6."onboarding_skipped_organization_id",
@@ -9507,6 +9525,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -9544,6 +9563,7 @@
T6."allow_sidebar_suggestions",
T6."shortcut_position",
T6."passkeys_enabled_for_2fa",
+ T6."hide_mcp_hints",
T6."onboarding_skipped_at",
T6."onboarding_skipped_reason",
T6."onboarding_skipped_organization_id",
@@ -10077,6 +10097,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -10114,6 +10135,7 @@
T6."allow_sidebar_suggestions",
T6."shortcut_position",
T6."passkeys_enabled_for_2fa",
+ T6."hide_mcp_hints",
T6."onboarding_skipped_at",
T6."onboarding_skipped_reason",
T6."onboarding_skipped_organization_id",
@@ -10360,6 +10382,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -10536,6 +10559,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -11378,6 +11402,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -11415,6 +11440,7 @@
T6."allow_sidebar_suggestions",
T6."shortcut_position",
T6."passkeys_enabled_for_2fa",
+ T6."hide_mcp_hints",
T6."onboarding_skipped_at",
T6."onboarding_skipped_reason",
T6."onboarding_skipped_organization_id",
@@ -11542,6 +11568,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -13550,6 +13577,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -14737,6 +14765,7 @@
T6."allow_sidebar_suggestions",
T6."shortcut_position",
T6."passkeys_enabled_for_2fa",
+ T6."hide_mcp_hints",
T6."onboarding_skipped_at",
T6."onboarding_skipped_reason",
T6."onboarding_skipped_organization_id",
@@ -14953,6 +14982,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -14990,6 +15020,7 @@
T6."allow_sidebar_suggestions",
T6."shortcut_position",
T6."passkeys_enabled_for_2fa",
+ T6."hide_mcp_hints",
T6."onboarding_skipped_at",
T6."onboarding_skipped_reason",
T6."onboarding_skipped_organization_id",
@@ -15396,6 +15427,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -15433,6 +15465,7 @@
T6."allow_sidebar_suggestions",
T6."shortcut_position",
T6."passkeys_enabled_for_2fa",
+ T6."hide_mcp_hints",
T6."onboarding_skipped_at",
T6."onboarding_skipped_reason",
T6."onboarding_skipped_organization_id",
@@ -15512,6 +15545,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -15899,6 +15933,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -16332,6 +16367,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -16369,6 +16405,7 @@
T6."allow_sidebar_suggestions",
T6."shortcut_position",
T6."passkeys_enabled_for_2fa",
+ T6."hide_mcp_hints",
T6."onboarding_skipped_at",
T6."onboarding_skipped_reason",
T6."onboarding_skipped_organization_id",
@@ -16579,6 +16616,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -17389,6 +17427,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -17426,6 +17465,7 @@
T6."allow_sidebar_suggestions",
T6."shortcut_position",
T6."passkeys_enabled_for_2fa",
+ T6."hide_mcp_hints",
T6."onboarding_skipped_at",
T6."onboarding_skipped_reason",
T6."onboarding_skipped_organization_id",
@@ -17553,6 +17593,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -18011,6 +18052,7 @@
T6."allow_sidebar_suggestions",
T6."shortcut_position",
T6."passkeys_enabled_for_2fa",
+ T6."hide_mcp_hints",
T6."onboarding_skipped_at",
T6."onboarding_skipped_reason",
T6."onboarding_skipped_organization_id",
diff --git a/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr b/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr
index d6b3d78877d9..ab401d7d88cb 100644
--- a/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr
+++ b/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr
@@ -29,6 +29,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -503,6 +504,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -540,6 +542,7 @@
T5."allow_sidebar_suggestions",
T5."shortcut_position",
T5."passkeys_enabled_for_2fa",
+ T5."hide_mcp_hints",
T5."onboarding_skipped_at",
T5."onboarding_skipped_reason",
T5."onboarding_skipped_organization_id",
@@ -967,6 +970,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -1010,6 +1014,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -1403,6 +1408,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -1609,6 +1615,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
diff --git a/posthog/api/user.py b/posthog/api/user.py
index ea770a3494b6..5bc437745e37 100644
--- a/posthog/api/user.py
+++ b/posthog/api/user.py
@@ -258,6 +258,7 @@ class UserSerializer(serializers.ModelSerializer):
"shortcut_position",
"role_at_organization",
"passkeys_enabled_for_2fa",
+ "hide_mcp_hints",
"onboarding_skipped_at",
"onboarding_skipped_reason",
"onboarding_skipped_organization_id",
diff --git a/posthog/migrations/1165_user_hide_mcp_hints.py b/posthog/migrations/1165_user_hide_mcp_hints.py
new file mode 100644
index 000000000000..5add5a6678da
--- /dev/null
+++ b/posthog/migrations/1165_user_hide_mcp_hints.py
@@ -0,0 +1,29 @@
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("posthog", "1164_alter_alertconfiguration_calculation_interval"),
+ ]
+
+ # db_default keeps the Postgres-level DEFAULT (Django would otherwise emit
+ # `ALTER COLUMN ... DROP DEFAULT` right after ADD COLUMN, because it treats
+ # plain `default=` as a Python-only concern). The DB default matters because
+ # (a) posthog_user has non-Django writers in rust/ and nodejs/ that INSERT
+ # without listing this column, and (b) the test DB is created from model
+ # definitions (see posthog/management/commands/setup_test_environment.py
+ # disable_migrations), so without db_default the CREATE TABLE in tests
+ # would omit the default entirely and break those writers.
+ operations = [
+ migrations.AddField(
+ model_name="user",
+ name="hide_mcp_hints",
+ field=models.BooleanField(
+ blank=False,
+ db_default=False,
+ default=False,
+ help_text="When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.",
+ null=False,
+ ),
+ ),
+ ]
diff --git a/posthog/migrations/max_migration.txt b/posthog/migrations/max_migration.txt
index d917f6083f37..21a7f5c20317 100644
--- a/posthog/migrations/max_migration.txt
+++ b/posthog/migrations/max_migration.txt
@@ -1 +1 @@
-1164_alter_alertconfiguration_calculation_interval
+1165_user_hide_mcp_hints
diff --git a/posthog/models/user.py b/posthog/models/user.py
index 8c10e028034e..9175e50f6448 100644
--- a/posthog/models/user.py
+++ b/posthog/models/user.py
@@ -229,6 +229,13 @@ class User(AbstractUser, UUIDTClassicModel, ModelActivityMixin): # type: ignore
blank=True,
help_text="Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.",
)
+ hide_mcp_hints = models.BooleanField(
+ default=False,
+ db_default=False,
+ null=False,
+ blank=False,
+ help_text="When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.",
+ )
# Onboarding exit tracking. Set when the user explicitly leaves the onboarding flow (skip or delegate).
ONBOARDING_SKIPPED_REASONS = OnboardingSkippedReason.choices
diff --git a/posthog/session_recordings/test/__snapshots__/test_session_recording_playlist.ambr b/posthog/session_recordings/test/__snapshots__/test_session_recording_playlist.ambr
index 681bc1d783e3..7a74c3adff47 100644
--- a/posthog/session_recordings/test/__snapshots__/test_session_recording_playlist.ambr
+++ b/posthog/session_recordings/test/__snapshots__/test_session_recording_playlist.ambr
@@ -200,6 +200,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -237,6 +238,7 @@
T4."allow_sidebar_suggestions",
T4."shortcut_position",
T4."passkeys_enabled_for_2fa",
+ T4."hide_mcp_hints",
T4."onboarding_skipped_at",
T4."onboarding_skipped_reason",
T4."onboarding_skipped_organization_id",
@@ -321,6 +323,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -831,6 +834,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -868,6 +872,7 @@
T4."allow_sidebar_suggestions",
T4."shortcut_position",
T4."passkeys_enabled_for_2fa",
+ T4."hide_mcp_hints",
T4."onboarding_skipped_at",
T4."onboarding_skipped_reason",
T4."onboarding_skipped_organization_id",
@@ -1007,6 +1012,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -1309,6 +1315,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -1360,82 +1367,6 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.39
- '''
- SELECT "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_experiment_stats_method",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_hipaa",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
- LIMIT 21
- '''
-# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.39
- '''
- SELECT "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_experiment_stats_method",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_hipaa",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
- LIMIT 21
- '''
-# ---
# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.4
'''
SELECT "posthog_organization"."id",
@@ -1907,6 +1838,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -1944,6 +1876,7 @@
T4."allow_sidebar_suggestions",
T4."shortcut_position",
T4."passkeys_enabled_for_2fa",
+ T4."hide_mcp_hints",
T4."onboarding_skipped_at",
T4."onboarding_skipped_reason",
T4."onboarding_skipped_organization_id",
diff --git a/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr b/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr
index bfe8c02c14a4..202c2128d73f 100644
--- a/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr
+++ b/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr
@@ -37,6 +37,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -718,6 +719,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -1395,6 +1397,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -2068,6 +2071,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -2741,6 +2745,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -3418,6 +3423,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -4095,6 +4101,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -4772,6 +4779,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -5481,6 +5489,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -6138,6 +6147,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -6217,6 +6227,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -6943,6 +6954,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -7811,6 +7823,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -9086,6 +9099,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -9796,6 +9810,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -10574,6 +10589,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -11337,6 +11353,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -12069,6 +12086,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
diff --git a/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr b/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr
index 0e4f8d83e6a8..4f2169518d12 100644
--- a/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr
+++ b/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr
@@ -518,6 +518,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -1339,6 +1340,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
diff --git a/products/actions/frontend/components/ActionsTable.tsx b/products/actions/frontend/components/ActionsTable.tsx
index dc1bc238151a..42f073379741 100644
--- a/products/actions/frontend/components/ActionsTable.tsx
+++ b/products/actions/frontend/components/ActionsTable.tsx
@@ -297,6 +297,7 @@ export function ActionsTable(): JSX.Element {
actionElementOverride={
<NewActionButton onSelectOption={() => updateHasSeenProductIntroFor(ProductKey.ACTIONS)} />
}
+ mcpSurfaceKey="actions.create"
/>
{(shouldShowEmptyState && filterType === 'me') || !shouldShowEmptyState ? (
<div className="flex items-center justify-between gap-2 mb-4">
diff --git a/products/actions/frontend/logics/actionEditLogic.tsx b/products/actions/frontend/logics/actionEditLogic.tsx
index 7dd8aa1cd039..fc007c43676d 100644
--- a/products/actions/frontend/logics/actionEditLogic.tsx
+++ b/products/actions/frontend/logics/actionEditLogic.tsx
@@ -5,6 +5,7 @@ import { beforeUnload, router, urlToAction } from 'kea-router'
import { CombinedLocation } from 'kea-router/lib/utils'
import api from 'lib/api'
+import { tryShowMCPHint } from 'lib/components/MCPHint/mcpHintLogic'
import { SetupTaskId, globalSetupLogic } from 'lib/components/ProductSetup'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
import { Link } from 'lib/lemon-ui/Link'
@@ -161,6 +162,7 @@ export const actionEditLogic = kea<actionEditLogicType>([
if (!props.id) {
// Mark task complete when creating a new action
globalSetupLogic.findMounted()?.actions.markTaskAsCompleted(SetupTaskId.DefineActions)
+ tryShowMCPHint('actions.create')
router.actions.push(urls.action(action.id))
} else {
const id = parseInt(props.id.toString()) // props.id can be a string
diff --git a/products/early_access_features/backend/test/__snapshots__/test_early_access_feature.ambr b/products/early_access_features/backend/test/__snapshots__/test_early_access_feature.ambr
index 9b43244bdfc2..5808375f97c0 100644
--- a/products/early_access_features/backend/test/__snapshots__/test_early_access_feature.ambr
+++ b/products/early_access_features/backend/test/__snapshots__/test_early_access_feature.ambr
@@ -326,6 +326,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -457,6 +458,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -822,6 +824,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
@@ -993,6 +996,7 @@
"posthog_user"."allow_sidebar_suggestions",
"posthog_user"."shortcut_position",
"posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
"posthog_user"."onboarding_skipped_at",
"posthog_user"."onboarding_skipped_reason",
"posthog_user"."onboarding_skipped_organization_id",
diff --git a/products/early_access_features/frontend/EarlyAccessFeatures.tsx b/products/early_access_features/frontend/EarlyAccessFeatures.tsx
index 11c3725d94bf..7b51846bb17b 100644
--- a/products/early_access_features/frontend/EarlyAccessFeatures.tsx
+++ b/products/early_access_features/frontend/EarlyAccessFeatures.tsx
@@ -76,6 +76,7 @@ export function EarlyAccessFeatures(): JSX.Element {
docsURL="https://posthog.com/docs/feature-flags/early-access-feature-management"
action={() => router.actions.push(urls.earlyAccessFeature('new'))}
className="my-0"
+ mcpSurfaceKey="early_access_features.create"
/>
{!shouldShowEmptyState && (
<>
diff --git a/products/early_access_features/frontend/earlyAccessFeatureLogic.ts b/products/early_access_features/frontend/earlyAccessFeatureLogic.ts
index 5d0c5da4b8ca..21316e371aec 100644
--- a/products/early_access_features/frontend/earlyAccessFeatureLogic.ts
+++ b/products/early_access_features/frontend/earlyAccessFeatureLogic.ts
@@ -7,6 +7,7 @@ import React from 'react'
import { lemonToast } from '@posthog/lemon-ui'
import api from 'lib/api'
+import { tryShowMCPHint } from 'lib/components/MCPHint/mcpHintLogic'
import { SetupTaskId, globalSetupLogic } from 'lib/components/ProductSetup'
import { LemonDialog } from 'lib/lemon-ui/LemonDialog'
import { identifierToHuman } from 'lib/utils'
@@ -320,6 +321,7 @@ export const earlyAccessFeatureLogic = kea<earlyAccessFeatureLogicType>([
// Mark feature creation task as completed
globalSetupLogic.findMounted()?.actions.markTaskAsCompleted(SetupTaskId.CreateEarlyAccessFeature)
+ tryShowMCPHint('early_access_features.create')
}
},
showGAPromotionConfirmation: ({ onConfirm }) => {
diff --git a/products/error_tracking/frontend/components/IssueActions/issueActionsLogic.tsx b/products/error_tracking/frontend/components/IssueActions/issueActionsLogic.tsx
index befeb674078f..27dcbeee08bc 100644
--- a/products/error_tracking/frontend/components/IssueActions/issueActionsLogic.tsx
+++ b/products/error_tracking/frontend/components/IssueActions/issueActionsLogic.tsx
@@ -2,6 +2,7 @@ import { actions, kea, listeners, path, reducers } from 'kea'
import posthog from 'posthog-js'
import api from 'lib/api'
+import { tryShowMCPHint } from 'lib/components/MCPHint/mcpHintLogic'
import { SetupTaskId, globalSetupLogic } from 'lib/components/ProductSetup'
import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'
import { BehavioralFilterKey } from 'scenes/cohorts/CohortFilters/types'
@@ -187,6 +188,11 @@ export const issueActionsLogic = kea<issueActionsLogicType>([
await api.errorTracking.assignCohort(id, cohort.id)
})
},
+ mutationSuccess: ({ mutationName }) => {
+ if (mutationName === 'updateIssueAssignee' || mutationName === 'assignIssues') {
+ tryShowMCPHint('error_tracking.assign')
+ }
+ },
}
}),
])
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/issues/IssuesList.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/issues/IssuesList.tsx
index 2f10d66a301c..da2b5a195f97 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/issues/IssuesList.tsx
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/issues/IssuesList.tsx
@@ -3,6 +3,7 @@ import { useMemo } from 'react'
import { Tooltip } from '@posthog/lemon-ui'
+import { MCPUseCaseCard } from 'lib/components/MCPHint/MCPUseCaseCard'
import { humanFriendlyLargeNumber } from 'lib/utils'
import { cn } from 'lib/utils/css-classes'
@@ -163,10 +164,23 @@ export function IssuesList(): JSX.Element {
<div data-attr="error-tracking-issue-row">
<Query query={query} context={context} />
</div>
+ <IssuesListMCPHint />
</BindLogic>
)
}
+const IssuesListMCPHint = (): JSX.Element | null => {
+ const { results, responseLoading } = useValues(issuesDataNodeLogic)
+ if (responseLoading || results.length > 0) {
+ return null
+ }
+ return (
+ <div className="mt-4 flex justify-center">
+ <MCPUseCaseCard surfaceKey="error_tracking.assign" className="max-w-140" />
+ </div>
+ )
+}
+
export const ListOptions = (): JSX.Element => {
const { selectedIssueIds } = useValues(bulkSelectLogic)
const { results } = useValues(issuesDataNodeLogic)
diff --git a/products/workflows/frontend/Workflows/WorkflowsTable.tsx b/products/workflows/frontend/Workflows/WorkflowsTable.tsx
index 2c25962a9918..e6006a261ab5 100644
--- a/products/workflows/frontend/Workflows/WorkflowsTable.tsx
+++ b/products/workflows/frontend/Workflows/WorkflowsTable.tsx
@@ -326,6 +326,7 @@ export function WorkflowsTable(props: WorkflowsSceneProps): JSX.Element {
}}
customHog={MailHog}
isEmpty
+ mcpSurfaceKey="workflows.create"
/>
)}
{!showProductIntroduction && (
diff --git a/products/workflows/frontend/Workflows/workflowLogic.ts b/products/workflows/frontend/Workflows/workflowLogic.ts
index a2c0b390da2a..b757d4d0cd43 100644
--- a/products/workflows/frontend/Workflows/workflowLogic.ts
+++ b/products/workflows/frontend/Workflows/workflowLogic.ts
@@ -8,6 +8,7 @@ import { LemonDialog } from '@posthog/lemon-ui'
import api from 'lib/api'
import { CyclotronJobInputsValidation } from 'lib/components/CyclotronJob/CyclotronJobInputsValidation'
+import { tryShowMCPHint } from 'lib/components/MCPHint/mcpHintLogic'
import { SetupTaskId, globalSetupLogic } from 'lib/components/ProductSetup'
import { dayjs } from 'lib/dayjs'
import { lemonToast } from 'lib/lemon-ui/LemonToast'
@@ -663,6 +664,10 @@ export const workflowLogic = kea<workflowLogicType>([
lemonToast.success('Workflow saved')
+ if (props.id === 'new') {
+ tryShowMCPHint('workflows.create')
+ }
+
if (props.id === 'new' && originalWorkflow.id) {
router.actions.replace(
urls.workflow(
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index f651ad7ebc46..a73f1722d890 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -25208,6 +25208,8 @@ export namespace Schemas {
* @nullable
*/
passkeys_enabled_for_2fa?: boolean | null;
+ /** When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions. */
+ hide_mcp_hints?: boolean;
/** @nullable */
readonly onboarding_skipped_at: string | null;
readonly onboarding_skipped_reason: OnboardingSkippedReasonEnum | null;
@@ -30876,6 +30878,8 @@ export namespace Schemas {
* @nullable
*/
passkeys_enabled_for_2fa?: boolean | null;
+ /** When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions. */
+ hide_mcp_hints?: boolean;
/** @nullable */
readonly onboarding_skipped_at?: string | null;
readonly onboarding_skipped_reason?: OnboardingSkippedReasonEnum | null;
diff --git a/services/mcp/src/generated/core/api.ts b/services/mcp/src/generated/core/api.ts
index 35fc8f329375..5764a93a5978 100644
--- a/services/mcp/src/generated/core/api.ts
+++ b/services/mcp/src/generated/core/api.ts
@@ -633,4 +633,10 @@ export const UsersPartialUpdateBody = /* @__PURE__ */ zod.object({
.describe(
'Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.'
),
+ hide_mcp_hints: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'
+ ),
})
diff --git a/services/mcp/src/hono/tool-catalog.ts b/services/mcp/src/hono/tool-catalog.ts
index 26fef158e750..a210659cd740 100644
--- a/services/mcp/src/hono/tool-catalog.ts
+++ b/services/mcp/src/hono/tool-catalog.ts
@@ -2,7 +2,6 @@ import { hasScopes } from '@/lib/api'
import {
type ToolDefinition,
type ToolFilterOptions,
- getToolDefinition,
getToolDefinitions,
getToolsForFeatures,
} from '@/tools/toolDefinitions'
@@ -68,9 +67,7 @@ export class ToolCatalog {
getFilteredTools(options: ToolCatalogFilterOptions): Tool<ZodObjectAny>[] {
const { scopes = [], excludeTools = [], ...filterOptions } = options
- const allowedToolNames = getToolsForFeatures(filterOptions).filter(
- (name) => !excludeTools.includes(name)
- )
+ const allowedToolNames = getToolsForFeatures(filterOptions).filter((name) => !excludeTools.includes(name))
const effectiveVersion = filterOptions.version ?? 1
const tools: Tool<ZodObjectAny>[] = []
@@ -86,8 +83,7 @@ export class ToolCatalog {
continue
}
- const definition =
- preBuilt.definitions[effectiveVersion === 2 ? 'v2' : 'v1'] ?? preBuilt.definitions.v1
+ const definition = preBuilt.definitions[effectiveVersion === 2 ? 'v2' : 'v1'] ?? preBuilt.definitions.v1
if (!definition) {
continue
}
diff --git a/services/mcp/src/tools/generated/core.ts b/services/mcp/src/tools/generated/core.ts
index 03a128023ef1..1911f1a2c3a6 100644
--- a/services/mcp/src/tools/generated/core.ts
+++ b/services/mcp/src/tools/generated/core.ts
@@ -581,6 +581,9 @@ const userSettingsUpdate = (): ToolBase<typeof UserSettingsUpdateSchema, Schemas
if (params.passkeys_enabled_for_2fa !== undefined) {
body['passkeys_enabled_for_2fa'] = params.passkeys_enabled_for_2fa
}
+ if (params.hide_mcp_hints !== undefined) {
+ body['hide_mcp_hints'] = params.hide_mcp_hints
+ }
const result = await context.api.request<Schemas.User>({
method: 'PATCH',
path: `/api/users/${encodeURIComponent(String(params.uuid))}/`,
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/common/user-settings-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/common/user-settings-update.json
index bb6f49b2191f..1635ef6ba886 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/common/user-settings-update.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/common/user-settings-update.json
@@ -49,6 +49,10 @@
},
"has_seen_product_intro_for": {},
"hedgehog_config": {},
+ "hide_mcp_hints": {
+ "description": "When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.",
+ "type": "boolean"
+ },
"last_name": {
"maxLength": 150,
"type": "string"