Installs Python dependencies (mixpanel_headless, pandas, numpy, matplotlib, seaborn, networkx, anytree, scipy, pyarrow) and verifies Mixpanel credentials for analytics. Useful when setting up a new environment or configuring service account/OAuth credentials.
Ships in mixpanel-headless. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Install dependencies and verify credentials for CodeMode analytics.
Before running bundled scripts, set SKILL_DIR to the absolute path of this
skills/setup directory.
bash $SKILL_DIR/scripts/setup.sh
This will:
mixpanel_headless, pandas, numpy, matplotlib, seaborn, networkx>=3.0, anytree>=2.8.0, scipy, and pyarrow>=17.0 on Python 3.11+ (tries uv, pip in order)After installation, check the active session:
python3 $SKILL_DIR/../mixpanelyst/scripts/auth_manager.py session
Parse the JSON state field:
ok — credentials configured. Show account.name → project project.id and proceed to verification.needs_account — no account configured. Read next for onboarding suggestions and follow "If Credentials Are Missing" below.needs_project — account configured but no project pinned. Suggest mp project list then mp project use <id>.error — show error.message. If error.actionable is true, the message names a concrete next command.If no credentials are configured, guide the user to one of these methods:
mp loginThe frictionless one-shot path. Tell the user to run:
mp login
mp login runs the right auth flow for the environment, derives the
account name from /me, and pins a default project. For laptops with a
usable browser, this opens the PKCE flow; for environments with
MP_USERNAME + MP_SECRET set, it skips the browser and uses the
service-account path; for MP_OAUTH_TOKEN set, it uses the static
bearer.
Region behavior:
service_account and oauth_token paths probe us → eu → in when
--region is omitted.oauth_browser (the bare-mp login default) defaults to us. EU and
India browser users must pass --region eu or --region in.Useful flags: --name NAME, --region us|eu|in, --project ID,
--service-account, --token-env VAR, --no-browser, --secret-stdin.
Use the mixpanel-auth skill's account-add workflow for a
step-by-step walkthrough. The workflow never prompts for secrets in
conversation — it instructs the user to run mp account add ...
themselves so the secret is read with hidden input. Use this path when
the user wants explicit control over the account name, region, and type
at registration time.
For quick testing, set all four variables in the shell — the resolver picks them up directly without account registration:
export MP_USERNAME="service-account-username"
export MP_SECRET="service-account-secret"
export MP_PROJECT_ID="12345"
export MP_REGION="us" # or "eu", "in"
If the user has an OAuth 2.0 access token from another source, they can use it directly without the PKCE browser flow:
export MP_OAUTH_TOKEN="<bearer-token>"
export MP_PROJECT_ID="12345"
export MP_REGION="us" # or "eu", "in"
This is the recommended mode for non-interactive contexts. The full
service-account env-var set (MP_USERNAME + MP_SECRET + MP_PROJECT_ID
MP_REGION) takes precedence when both sets are complete.If running inside a remote or sandboxed agent environment, credentials work differently:
Tell the user:
No Mixpanel credentials found in this remote session.
On your host machine (outside the remote session), run:
mp account export-bridge --to ~/.claude/mixpanel/auth.jsonThis writes a v2 bridge file embedding your account record (and any oauth_browser tokens) so the remote session can read your credentials at startup.
Then start a new remote session — credentials will be available automatically.
Do NOT suggest the account-login or account-add interactive workflows — these won't work inside remote sessions without browser or terminal access.
The library will auto-refresh the OAuth token via the on-disk refresh token (no browser needed). If refresh fails:
Your OAuth session has expired and could not be refreshed. On your host machine, run:
mp login --name personal # re-authenticate (or `mp account login personal`) mp account export-bridge --to ~/.claude/mixpanel/auth.jsonThen start a new remote session.
python3 $SKILL_DIR/../mixpanelyst/scripts/auth_manager.py account test
The subcommand never raises — read result.ok to determine outcome.
result.ok: true → setup is complete; the user can ask analytics questions.result.ok: false → suggest the mixpanel-auth account-test workflow for detailed diagnostics.Once authenticated, these slash commands help orient the user:
mixpanel-auth project-list workflow — discover all accessible projects via /memixpanel-auth session workflow — see active account / project / workspacemixpanel-auth project-use workflow — switch to a different projectmixpanel-auth target-add workflow — save a named cursor positionThe user can also construct a Workspace targeting a specific account / project / workspace directly:
import mixpanel_headless as mp
ws = mp.Workspace() # default session
ws = mp.Workspace(account="team") # named account
ws = mp.Workspace(project="67890") # explicit project (active account)
ws = mp.Workspace(account="team", project="67890") # both axes
ws.use(project="98765").events() # in-session switch (no re-auth)
The mixpanelyst skill auto-triggers on analytics questions. For the analytical frameworks that guide investigations, see analytical-frameworks.md. For the complete Python API, see python-api.md.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
4 skills in this plugin
/dashboard-expertFull CRUD and analysis for Mixpanel dashboards. Use when the user asks to build, create, analyze, read, understand, explain, modify, update, enhance, or manage dashboards, or asks about dashboard layout, text cards, or report arrangement. Covers dashboard analysis (read + understand existing), creation (new builds), modification (update existing), and explanation (data-driven annotation)./mixpanel-authManage Mixpanel Headless authentication: check session state, list/add/use accounts, run OAuth login, switch projects/workspaces, manage targets, and check bridge credentials./mixpanelystThis skill should be used when the user asks about Mixpanel product analytics, event data, funnel analysis, retention curves, cohort analysis, segmentation queries, user behavior, conversion rates, churn, DAU/MAU, ARPU, revenue metrics, feature adoption, A/B test results, user paths, flow analysis, or any request to query, explore, visualize, or analyze Mixpanel data using Python. Also use when the user asks to read, write, or manage Mixpanel "business context" — the markdown documentation that grounds AI assistants in an organization's structure and goals./mixpanel-headless:mixpanel-headless-setupfrom mixpanel-headless
npx claudepluginhub kael-odin/codex-plugins-zh --plugin mixpanel-headlessOther plugins' skills for the same job