Skip to content

Commit f2257eb

Browse files
authored
Merge branch 'main' into jerrylin-mparticlefix
2 parents 086a1d9 + 58e95c5 commit f2257eb

4 files changed

Lines changed: 80 additions & 65 deletions

File tree

pages/docs/features/mcp.mdx

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,23 @@ The MCP integration provides access to all core Mixpanel analysis capabilities t
2222

2323
### Analytics Functions
2424

25-
- Segmentation: Event counts and unique users with filtering and grouping (`Run-Segmentation-Query`)
26-
- Funnels: Conversion rate analysis across user journeys (`Run-Funnels-Query`)
27-
- Retention: User engagement and return behavior tracking (`Run-Retention-Query`)
28-
- Frequency: User engagement patterns and usage intensity (`Run-Frequency-Query`)
25+
- Run Query: Execute insights, funnels, flows, and retention queries and return data points (`Run-Query`)
26+
- Query Schema: Get the full instructions and JSON schema for building a query (`Get-Query-Schema`)
27+
- Get Report: Retrieve a saved report from a Mixpanel project, optionally including results (`Get-Report`)
28+
29+
### Dashboards
30+
31+
- Create Dashboard: Create a new dashboard with rows of text cards and reports (`Create-Dashboard`)
32+
- List Dashboards: Browse dashboards in a project, with optional title search (`List-Dashboards`)
33+
- Get Dashboard: Retrieve detailed information about a specific dashboard (`Get-Dashboard`)
2934

3035
### Data Discovery & Exploration
3136

3237
- Project Management: Access projects and workspace information (`Get-Projects`)
3338
- Event Discovery: Browse all available events in your project (`Get-Events`)
3439
- Property Names: Explore properties available for events or users (`Get-Property-Names`)
3540
- Property Values: Discover specific values for event or user properties (`Get-Property-Values`)
41+
- Property Details: Retrieve full property metadata (`Get-Property`)
3642
- Data Quality: Get and filter data quality issues by event, property, type, or date range (`Get-Issues`)
3743
- Lexicon Integration: Get direct links to event or property definitions in Mixpanel Lexicon (`Get-Lexicon-URL`)
3844

@@ -126,7 +132,7 @@ For additional information on setting up Claude connectors, see [Claude's connec
126132
**Setup Steps:**
127133
1. Open Claude desktop app
128134
2. Navigate to **Settings** (from window nav bar) → **Developer****Edit Config**
129-
3. Add the following configuration:
135+
3. Add the following configuration (replace the URL with `https://mcp-eu.mixpanel.com/mcp` for EU or `https://mcp-in.mixpanel.com/mcp` for IN):
130136

131137
```json
132138
{
@@ -136,7 +142,7 @@ For additional information on setting up Claude connectors, see [Claude's connec
136142
"args": [
137143
"-y",
138144
"mcp-remote",
139-
"https://mcp.mixpanel.com/mcp", // or use mcp-eu.mixpanel.com/mcp for EU, mcp-in.mixpanel.com/mcp for IN
145+
"https://mcp.mixpanel.com/mcp",
140146
"--allow-http"
141147
]
142148
}
@@ -146,17 +152,17 @@ For additional information on setting up Claude connectors, see [Claude's connec
146152

147153
4. Run authorization command in terminal:
148154
```bash
149-
npx -y mcp-remote https://mcp.mixpanel.com/mcp --static-oauth-client-metadata '{ "scope": "projects analysis events insights segmentation retention data:read funnels flows data_definitions" }' --allow-http
155+
npx -y mcp-remote https://mcp.mixpanel.com/mcp --allow-http
150156
```
151157

152158
For EU,
153159
```bash
154-
npx -y mcp-remote https://mcp-eu.mixpanel.com/mcp --static-oauth-client-metadata '{ "scope": "projects analysis events insights segmentation retention data:read funnels flows data_definitions" }' --allow-http
160+
npx -y mcp-remote https://mcp-eu.mixpanel.com/mcp --allow-http
155161
```
156162

157163
For IN,
158164
```bash
159-
npx -y mcp-remote https://mcp-in.mixpanel.com/mcp --static-oauth-client-metadata '{ "scope": "projects analysis events insights segmentation retention data:read funnels flows data_definitions" }' --allow-http
165+
npx -y mcp-remote https://mcp-in.mixpanel.com/mcp --allow-http
160166
```
161167

162168
5. Complete Mixpanel authorization via the provided link
@@ -165,13 +171,13 @@ npx -y mcp-remote https://mcp-in.mixpanel.com/mcp --static-oauth-client-metadata
165171

166172
### Option 3: Cursor
167173
**Additional Requirements:**
168-
- Cursor application
174+
- Cursor application
169175
- Command line access
170176

171177
**Setup Steps:**
172178
1. Open Cursor application
173179
2. Navigate to **Cursor Settings****MCP & Integrations****MCP Tools****New MCP Server**
174-
3. This opens MCP.json where you paste the following configuration:
180+
3. This opens MCP.json where you paste the following configuration (replace the URL with `https://mcp-eu.mixpanel.com/mcp` for EU or `https://mcp-in.mixpanel.com/mcp` for IN):
175181

176182
```json
177183
{
@@ -181,7 +187,7 @@ npx -y mcp-remote https://mcp-in.mixpanel.com/mcp --static-oauth-client-metadata
181187
"args": [
182188
"-y",
183189
"mcp-remote",
184-
"https://mcp.mixpanel.com/mcp", // or use mcp-eu.mixpanel.com/mcp for EU, mcp-in.mixpanel.com/mcp for IN
190+
"https://mcp.mixpanel.com/mcp",
185191
"--allow-http"
186192
]
187193
}
@@ -191,17 +197,17 @@ npx -y mcp-remote https://mcp-in.mixpanel.com/mcp --static-oauth-client-metadata
191197

192198
4. Run authorization command in terminal:
193199
```bash
194-
npx -y mcp-remote https://mcp.mixpanel.com/mcp --static-oauth-client-metadata '{ "scope": "projects analysis events insights segmentation retention data:read funnels flows data_definitions" }' --allow-http
200+
npx -y mcp-remote https://mcp.mixpanel.com/mcp --allow-http
195201
```
196202

197203
For EU,
198204
```bash
199-
npx -y mcp-remote https://mcp-eu.mixpanel.com/mcp --static-oauth-client-metadata '{ "scope": "projects analysis events insights segmentation retention data:read funnels flows data_definitions" }' --allow-http
205+
npx -y mcp-remote https://mcp-eu.mixpanel.com/mcp --allow-http
200206
```
201207

202208
For IN,
203209
```bash
204-
npx -y mcp-remote https://mcp-in.mixpanel.com/mcp --static-oauth-client-metadata '{ "scope": "projects analysis events insights segmentation retention data:read funnels flows data_definitions" }' --allow-http
210+
npx -y mcp-remote https://mcp-in.mixpanel.com/mcp --allow-http
205211
```
206212

207213

@@ -223,28 +229,28 @@ npx -y mcp-remote https://mcp-in.mixpanel.com/mcp --static-oauth-client-metadata
223229
```
224230
3. Configure Mixpanel MCP as a remote server and authorize:
225231
```bash
226-
npx -y mcp-remote https://mcp.mixpanel.com/mcp --static-oauth-client-metadata '{ "scope": "projects analysis events insights segmentation retention data:read funnels flows data_definitions" }' --allow-http
232+
npx -y mcp-remote https://mcp.mixpanel.com/mcp --allow-http
227233
```
228234

229235
For EU,
230236
```bash
231-
npx -y mcp-remote https://mcp-eu.mixpanel.com/mcp --static-oauth-client-metadata '{ "scope": "projects analysis events insights segmentation retention data:read funnels flows data_definitions" }' --allow-http
237+
npx -y mcp-remote https://mcp-eu.mixpanel.com/mcp --allow-http
232238
```
233239

234240
For IN,
235241
```bash
236-
npx -y mcp-remote https://mcp-in.mixpanel.com/mcp --static-oauth-client-metadata '{ "scope": "projects analysis events insights segmentation retention data:read funnels flows data_definitions" }' --allow-http
242+
npx -y mcp-remote https://mcp-in.mixpanel.com/mcp --allow-http
237243
```
238244

239245
Running this command will provide a link in your terminal to authorize your access with Mixpanel. Follow the authorization steps in your browser. After logging in via OAuth, you should see a confirmation message.
240246

241-
4. **Verify Configuration (or Create It Manually):**
247+
4. **Verify Configuration (or Create It Manually):**
242248
After authorization, your `settings.json` file for the Gemini CLI should be updated automatically. You can find this file at `~/.gemini/settings.json`. To check, run:
243249
```bash
244250
ls -la ~/.gemini
245251
cat ~/.gemini/settings.json
246252
```
247-
The contents should be similar to the following:
253+
The contents should be similar to the following (replace the URL with `https://mcp-eu.mixpanel.com/mcp` for EU or `https://mcp-in.mixpanel.com/mcp` for IN):
248254
```json
249255
{
250256
"theme": "Default",
@@ -255,7 +261,7 @@ npx -y mcp-remote https://mcp-in.mixpanel.com/mcp --static-oauth-client-metadata
255261
"args": [
256262
"-y",
257263
"mcp-remote",
258-
"https://mcp.mixpanel.com/mcp", // or use mcp-eu.mixpanel.com/mcp for EU, mcp-in.mixpanel.com/mcp for IN
264+
"https://mcp.mixpanel.com/mcp",
259265
"--allow-http"
260266
]
261267
}
@@ -265,7 +271,7 @@ npx -y mcp-remote https://mcp-in.mixpanel.com/mcp --static-oauth-client-metadata
265271
```
266272
This configuration ensures that the Gemini CLI knows how to connect to the Mixpanel remote server.
267273
If `settings.json` is not available, create it manually using the same contents as above.
268-
274+
269275

270276
5. Complete Mixpanel authorization via the provided link (if not already done).
271277
6. Run the Gemini CLI
@@ -350,6 +356,16 @@ The following scopes are **mandatory** — connections will fail without all of
350356
projects analysis events insights segmentation retention data:read funnels flows data_definitions
351357
```
352358

359+
The following scopes are **optional** — they enable additional features when granted:
360+
361+
```
362+
dashboard_reports bookmarks user_details
363+
```
364+
365+
<Callout type="info">
366+
To request only a subset of scopes, pass `--static-oauth-client-metadata '{ "scope": "..." }'` to `npx mcp-remote`. Otherwise, all available scopes are requested automatically.
367+
</Callout>
368+
353369
---
354370

355371
## Use Case Examples
@@ -398,7 +414,7 @@ projects analysis events insights segmentation retention data:read funnels flows
398414
- Instant insights without dashboard complexity
399415
- Accessible to non-technical stakeholders
400416

401-
**Enhanced Productivity**
417+
**Enhanced Productivity**
402418
- Reduce time-to-insight from minutes to seconds
403419
- Eliminate context switching between tools
404420
- Enable real-time decision making
@@ -457,3 +473,5 @@ projects analysis events insights segmentation retention data:read funnels flows
457473
- **Authorization fails:** Ensure proper Mixpanel account permissions
458474
- **Desktop app issues:** Restart application after configuration changes
459475
- **Free user limitations:** Remote URL integrations only supported in desktop app
476+
- **"MCP access is not enabled for this project":** This means MCP has not been enabled at the organization level. Ask your **organization administrator** to enable MCP access in **Settings > Org > Overview**. Note that after the admin enables access, it may take up to 15 minutes for the change to take effect.
477+
- **"Missing scope" error:** This usually means your cached authorization was created with an outdated scope list. To fix this, clear your cached auth data by deleting the `.mcp-auth` folder in the directory where you ran the authorization command, then re-run the authorization command to get a fresh token with all available scopes. If you previously used `--static-oauth-client-metadata` in your authorization command, either remove that flag so the client auto-discovers all scopes from the server or update the scopes used for that parameter for explicit control of scopes requested.

pages/docs/session-replay.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,27 @@ The Replay Feed on the left of the player also allows you to:
8080
- See a feed of events that occurred during each replay
8181
- Display properties and their values within the event feed
8282

83+
### Magic Playlists
84+
85+
Magic Playlists allow you to save playlists of replays based on events or properties, making it easy to revisit groups of replays that matter to you over time. This feature helps solve common pain points:
86+
87+
- **Save interesting replays**: No need to repeatedly recreate replay searches
88+
- **Dynamic playlists**: Create playlists based on your Mixpanel events and properties that automatically update as new replays meet your criteria
89+
- **AI-powered insights**: Get AI text summaries that identify key patterns and insights across numerous replays at once
90+
91+
<Callout type="info">
92+
AI summaries for Magic Playlists are currently in beta and publicly available for all customers using Magic Playlists.
93+
</Callout>
94+
95+
To create a Magic Playlist:
96+
97+
1. Access Session Replay from the side navigation in your Mixpanel project
98+
2. Configure filters based on events, properties, or custom time ranges
99+
3. Save the playlist, which will remember the filters you've applied
100+
4. Select a destination Mixpanel board where you want the playlist to appear
101+
102+
Once saved, your Magic Playlist will appear as a playlist card on your selected board. Any time new replays meet your saved criteria, they will automatically appear in your playlist, keeping your board up-to-date with the replays that matter most to you.
103+
83104
## Best Practices
84105

85106
Session Replay is a powerful way to understand and debug user behavior by showing exactly what users see on their screens. This visibility is core to its value—but also introduces inherent privacy and security risks, especially when sensitive information appears in the UI.

pages/docs/session-replay/heatmaps.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ To function, Heatmaps require Session Replay to be enabled, as they rely on sess
2828
Heatmaps only capture data during sessions with recorded replays. If a page has limited replay coverage, the Heatmap may not offer meaningful insights.
2929

3030
<Callout type="warning">
31-
When clicks occur very close to page navigation events, the heatmap may occasionally show clicks on the wrong page. This happens because the timing between page changes and click events may not align perfectly. If you notice clicks appearing on the wrong page, try using a different [backdrop](#backdrops) to find the correct page state.
31+
When clicks occur very close to page navigation events, the heatmap may occasionally show clicks on the wrong page. This happens because the timing between page changes and click events may not align perfectly. If you notice clicks appearing on the wrong page, try using a different [UI State](#ui-states) to find the correct page state.
3232
</Callout>
3333

3434
### Implementation
@@ -88,9 +88,9 @@ mixpanel.init('YOUR_PROJECT_TOKEN', {
8888

8989
![heatmap_rename.png](/heatmap_rename.png)
9090

91-
4. Rotate through backdrops to view different states of your application for the same URL.
91+
4. Rotate through UI States to view different states of your application for the same URL.
9292

93-
![heatmap_backdrops.png](/heatmap_backdrops.png)
93+
![UI States view](/heatmap_backdrops.png)
9494

9595
5. Use the Click Map and Heatmap toggles to show or hide each view. Click Maps help you see exactly which elements users click, which can clarify any inaccuracies in traditional heatmaps caused by dynamic page elements.
9696

@@ -116,12 +116,12 @@ Once enabled, Goal Mode highlights the UI elements driving the most conversions,
116116
Goal Mode works with any of your existing events and properties directly out of the box—no additional setup required.
117117
</Callout>
118118

119-
### Backdrops
119+
### UI States
120120

121-
Backdrops are snapshots of your application in various states (such as a modal open, a menu expanded, or different page layouts). Backdrops are pulled from session replays that match the URL you're analyzing, helping you understand how different views or UI states affect user interactions.
121+
UI States are snapshots of your application in various states (such as a modal open, a menu expanded, or different page layouts). UI States are pulled from session replays that match the URL you're analyzing, helping you understand how different views or UI states affect user interactions.
122122

123-
Backdrops are subject to the same retention policies as your session replays. Once a session replay expires, it can no longer be used as a backdrop. If you don't see enough backdrops (or can't find the specific view or state you're looking for), consider increasing your session replay sampling rate to capture a wider set of application states.
123+
UI States are subject to the same retention policies as your session replays. Once a session replay expires, it can no longer be used as a UI State. If you don't see enough UI States (or can't find the specific view or state you're looking for), consider increasing your session replay sampling rate to capture a wider set of application states.
124124

125125
<Callout type="warning">
126-
Heatmaps only track scrolling on the main page (window). If your site scrolls inside a nested container (like a div with its own scrollbar), heatmaps and interactive mode may not display data correctly. The interactive backdrops feature lets you customize your backdrop, but click positions within nested scrollable elements will still not be fully reflected.
126+
Heatmaps only track scrolling on the main page (window). If your site scrolls inside a nested container (like a div with its own scrollbar), heatmaps and interactive mode may not display data correctly. The interactive UI States feature lets you customize your UI State, but click positions within nested scrollable elements will still not be fully reflected.
127127
</Callout>

pages/docs/tracking-methods/sdks/javascript/javascript-replay.mdx

Lines changed: 11 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -333,43 +333,19 @@ analytics.addSourceMiddleware(({ payload, next, integrations }) => {
333333

334334
### mParticle: Web SDK
335335

336-
mParticle's Web SDK has a `.getDeviceId()` method which can be used to [retrieve the device_id](https://docs.mparticle.com/developers/client-sdks/web/initialization/#device-id-device-application-stamp). In the following example, we use this method to bind mParticle's device_id to Mixpanel's device_id, as well as patching [logPageView()](https://docs.mparticle.com/developers/sdk/web/core-apidocs/classes/mParticle%20&%20mParticleInstance.html#method_logPageView) and [logEvent()](https://docs.mparticle.com/developers/sdk/web/core-apidocs/classes/mParticle%20&%20mParticleInstance.html#method_logEvent) to include session replay properties on all mParticle events.
336+
mParticle offers a direct integration for Session Replay with Mixpanel. You can configure Session Replay settings directly in your mParticle connection settings, which automatically handles session replay properties on all events.
337337

338-
This configuration assumes you are [forwarding web requests server side](https://docs.mparticle.com/integrations/mixpanel/event/#connection-settings) in the connection settings.
338+
#### Direct Integration (Recommended)
339339

340-
```javascript Javascript
341-
mixpanel.init('MIXPANEL-PROJECT-TOKEN', {
342-
record_sessions_percent: 10,
343-
loaded: function (mixpanel) {
344-
window.mParticle.ready(function() {
345-
const mParticle_device_id = mParticle.getDeviceId();
346-
if (mParticle_device_id) {
347-
mixpanel.register({ $device_id: mParticle_device_id, distinct_id : "$device:"+mParticle_device_id });
348-
}
349-
350-
// Patch logEvent and logPageView to include sessionReplayProperties
351-
const originalLogEvent = mParticle.logEvent;
352-
mParticle.logEvent = function (eventName, eventType, eventAttributes, flags, opts) {
353-
const sessionReplayProperties = mixpanel.get_session_recording_properties();
354-
eventAttributes = {
355-
...eventAttributes,
356-
...sessionReplayProperties,
357-
};
358-
originalLogEvent(eventName, eventType, eventAttributes, flags, opts);
359-
};
360-
const originalLogPageView = mParticle.logPageView;
361-
mParticle.logPageView = function (eventName, eventAttributes, flags, opts) {
362-
const sessionReplayProperties = mixpanel.get_session_recording_properties();
363-
eventAttributes = {
364-
...eventAttributes,
365-
...sessionReplayProperties,
366-
};
367-
originalLogPageView(eventName, eventAttributes, flags, opts);
368-
};
369-
});
370-
}
371-
});
372-
```
340+
To use the direct integration:
341+
342+
1. Ensure you have the mParticle Mixpanel Web integration enabled for your web workspace. This will load the Mixpanel JavaScript SDK and Session Replay on your site automatically via mParticle (no separate SDK install in your app code is required).
343+
2. Configure Session Replay settings in your [mParticle Mixpanel connection settings](https://docs.mparticle.com/integrations/mixpanel/event/#connection-settings), including:
344+
- **Session Recording Percentage**: Percentage of SDK initializations that will qualify for replay data capture
345+
- **Record Heatmap Data**: Enable heatmap, rage click, and dead click collection
346+
- Additional privacy and configuration options as needed
347+
348+
The direct integration automatically includes session replay properties (`$mp_replay_id`) on all events forwarded through mParticle, without requiring any additional code changes.
373349

374350
### Rudderstack: Cloud Mode
375351

0 commit comments

Comments
 (0)