developer-toolsapi_key

PostHog

Open-source product analytics.

Verdict

PostHog brings product analytics and feature flag management into your AI workspace. @mention it to query user behavior data, toggle feature flags, manage dashboards, or pull experiment results without leaving the conversation. Engineers and product managers get the most value — you can check funnel drop-off rates, assign flag access, or bookmark key events directly from a Space. Setup requires a personal API key with appropriate project permissions; some endpoints need specific scopes like `feature_flag:write`.

Common use cases

  • Query funnel conversion rates mid-standup
  • Toggle feature flags for canary releases
  • Add dashboard collaborators from chat
  • Pull experiment results for product reviews
  • Bookmark critical activity log events

Integration

Vendor
PostHog
Category
developer-tools
Auth
API_KEY
Tools
50
Composio slug
posthog

Tools

  • Add dashboard collaborators with access level

    Add collaborators to a specific project dashboard. requires 'project id' and 'dashboard id'. supports json, form-urlencoded, and multipart data. returns added collaborator details. auth: 'personalapikeyauth'.

  • Add member to organization role

    Add a member to an organization role by submitting their details and uuid in json/form, using organization and role ids. requires personalapikeyauth. success gives a 201 status.

  • Add project specific member roles

    Add members with specific roles to a project by providing their user uuid and level (member or admin). requires project id in the url. supports json, form-data, and form-urlencoded input. returns the newly created membership data upon succe

  • Assign feature flag role based access

    Set up role-based access for a feature flag using `project id` and `feature flag id`. submit access info in json or form format, with `feature flag:write` rights. success returns new details with a 201 code.

  • Bookmark project activity notification

    Create a bookmark for an activity notification in a project's activity log. requires a `project id` and json payload with activity details. supports verification status, impersonation flags, and system activity distinction.

  • Bulk create organization invites

    Post /api/organizations/{organization id}/invites/bulk/: bulk-create organization invites with customizable levels, sender details, and validation checks. supports email automation and private project access settings.

  • Cancel insights for a project

    The "/api/projects/{project id}/insights/cancel/" endpoint allows users to cancel insights for a project by providing a project id and insight details in json or csv, and confirms cancellation in the response.

  • Check pipeline destination updates

    Get the newest updates and plugin info for a pipeline destination by organization and destination id via get request to /api/.../{id}/check for updates.

  • Check pipeline import app updates

    Retrieve the latest update information for a specific pipeline import app by its id within an organization. this endpoint returns details such as plugin type, name, description, and version data. requires 'id' and 'organization id' as path

  • Check pipeline plugin update status

    Get update status for a specific pipeline transformation plugin by its unique id within an organization. this endpoint requires the 'organization id' and 'plugin' ids and returns details like plugin type, name, and update information.

  • Check project s demo data generation status

    Projects for the current organization.

  • Cohort duplication to static

    This endpoint duplicates a specified cohort as a static one within a project. path parameters include `project id` (string) and cohort `id` (integer). successful requests return cohort details.

  • Create a notebook in a project

    The api for interacting with notebooks. this feature is in early access and the api can have breaking changes without announcement.

  • Create dashboard from template in project

    Create a new dashboard for a specified project from a template. accepts project id in the path and a json payload with various dashboard object parameters. returns a dashboard instance on success.

  • Create domain with saml for organization

    Create a domain for a specific organization by post to `/api/organizations/{id}/domains` with json/form data. requires domain, saml setup, and write permissions. returns new domain data with status 201.

  • Create experiment exposure cohort

    Create a new exposure cohort for an experiment in a project by sending a post request with experiment details and feature flag data. requires experiment id and project id in the path.

  • Create feature flag dashboard

    Manage feature flags by creating, reading, updating, and deleting them. utilize javascript library or endpoint for user-specific flag status. refer to documentation for details.

  • Create feature flags for project

    Manage feature flags by creating, reading, updating, and deleting them using posthog's javascript library or api endpoint. details in the provided documentation.

  • Create frontend app pipeline config

    Create a config for pipeline frontend apps within a specified project. requires project id and payload with object properties such as plugin, enabled status, order, etc. returns newly created config details.

  • Create funnel analysis for project persons

    This endpoint handles reading and deleting persons. for creation or updates, use the capture api, `$set` or `$unset` properties, or sdks.

  • Create new organization with configurable access

    Post /api/organizations/ - create a new organization with details like name, membership level, and features access. requires organization:write permission. returns organization info on success.

  • Create new project experiment

    Create a new experiment in a specific project using json, form, or multipart data. requires project id and experiment details, secured with personalapikeyauth. generates a 201 response with experiment info.

  • Create organization invite with role and email

    Send invites with roles (member, admin, owner) via email to join an organization by id. use json, form data, or multipart with a personal api key for security. successful invites return a 201 status.

  • Create organization role with feature flag levels

    Create a new role for the specified organization by supplying role details. requires organization id (uuid) and role data in json. returns the created role on success with a 201 status code. security: personalapikeyauth.

  • Create org proxy record with domain and status

    Create a proxy record for an org by sending org id in url and json/form/multipart data with domain, target cname, and status. requires personalapikeyauth and org write access; returns record details.

  • Create person funnel correlation

    This endpoint is for reading and deleting persons. use the capture api, `$set`/`$unset` properties, or sdks to create or update them.

  • Create person path with format option

    This api endpoint is for reading and deleting users. use the capture api, `$set`/`$unset` properties, or sdks for creating/updating users.

  • Create pipeline destination config

    Create pipeline destination configurations for a specific project by submitting plugin and order details, among other configuration info, with required project id. authentication needed. responds with 201 on success.

  • Create pipeline destination config job

    Create a job for a pipeline destination config with a specific id within the specified project. requires project id & config id in the path, and a json payload with plugin and order info.

  • Create pipeline import apps config job

    A job imports app settings into a project pipeline using project id and plugin config id, accepting json/form/multipart, and specifies plugin details, enabling status, and order for pipeline import apps configs.

  • Create plugin job configuration

    Create a job-related configuration for a specific plugin by providing plugin and project ids. accepts json, form data, and returns config details on success. use carefully; requires mandatory fields.

  • Create project action with format

    This post endpoint creates actions for a project, accepts various data types, requires project id and action data, optionally outputs in csv/json, and needs personalapikeyauth, returning a 201 with action details.

  • Create project cohorts

    Create cohorts for a specified project by posting json-form data to "/api/projects/{project id}/cohorts/". provide project id in url and the necessary payload, adhering to json schema constraints. authentication required. returns 201 upon s

  • Create project dashboard

    The post endpoint creates a dashboard within a project using a `project id`, accepting details in json/form formats. it uses 'personalapikeyauth' for security and returns http 201 with dashboard details on success.

  • Create project insights with customizable parameters

    The post endpoint enables creating insights for projects using a project id and supports json/csv. it offers detailed parameters for customizing insights and returns structured data with personalapikeyauth for security.

  • Create project insights with format option

    Create project insights with optional csv/json format parameter. requires `project id` in the path and a json body with project insight details. supports personal api key authentication. successful requests return a 201 status code with ins

  • Create project pipeline app configs

    Create pipeline app configurations for a specified project via post, requiring a project id and json, form, or multipart payload. supports configs, plugins, and app details. returns 201 on success. auth required.

  • Create project pipeline frontend app job

    Create a job for a pipeline frontend app config in a project. requires `project id` and config `id`, accepting json/form-data. returns the created job's details.

  • Create project pipeline transformation config

    Create a pipeline transformation config within a specific project by posting json, form, or multipart data. include plugin id, order, and enabled status. ensure project id is in the path. authentication required.

  • Create project plugin configuration

    Create a new plugin configuration for a specified project by post to /api/projects/{project id}/plugin configs/. requires project id and json payload with plugin details; must authenticate with personalapikeyauth.

  • Create project subscription with delivery options

    Create a subscription for a given project by providing required details such as delivery method, frequency, and starting date. requires a project id and supports various content types. returns the newly created subscription. security: perso

  • Create project surveys with questions and targets

    Create surveys in a project by providing a project id and details like type, questions, and targets in json, form-data, or urlencoded format. use personalapikeyauth for security. get a survey object on success.

  • Create project timing insights

    Create timing insights for a project by post to /api/projects/{project id}/insights/timing, supporting csv or json. it returns a 200 status with content in the chosen format.

  • Create query in project by id

    The `/api/projects/{project id}/query/` post endpoint allows users to submit queries for a specific project by providing the project id in the url and the query details in json or form data. authentication is required and it returns query r

  • Create retrieve retention insights for project

    Create and retrieve retention insights for a project using its id, allowing csv/json outputs. requires an api key with `insight:read` permissions and supports query node json strings and old dashboard ids.

  • Create session recording in playlist

    The post endpoint generates a project's session recording, needing 'project id', 'short id', and 'session recording id' in the url, and accepts various content formats for recording details.

  • Create session recording playlists

    Create playlists of session recordings for a specified project. requires 'project id' path parameter and personal api key with write access. supports json, form-encoded, or multipart data. returns 201 on success with playlist details.

  • Create session recording summary

    Summarize a session recording by providing the project id and the recording's uuid. get details like duration, activities, and user info.

  • Create static cohort for feature flag

    Manage feature flags for apps with create, read, update, and delete operations using posthog's javascript library or dedicated endpoint. more info in the docs.

  • Crud operations for project annotations

    Create, read, update and delete annotations. [see docs](https://posthog.com/docs/user-guides/annotations) for more information on annotations.

Setup

Setup guide

  1. 11. In Switchy, open your workspace settings and navigate to the Integrations tab. 2. Find PostHog in the MCP directory and click Connect. 3. You'll be prompted to paste a PostHog personal API key — generate one from your PostHog account under Settings > Personal API Keys. 4. Grant the key access to the projects and features your team needs (dashboards, feature flags, insights, activity logs). 5. Name the connection something recognizable like 'PostHog Prod' if you manage multiple environments. 6. Click Save and wait for the green confirmation badge. 7. Open any Space, type '@PostHog' and ask it to list your project dashboards — if it returns results, the connection works. 8. To invoke a specific tool, @mention PostHog and describe what you need in plain language (e.g. '@PostHog show me the top funnels for project 12345').

What teammates see: by default, memories from PostHog are scoped to the Space (PROJECT visibility) - you can mark any memory PRIVATE or share it ORG-wide.

Works well with

Top models

Compatibility data appears once enough Spaces have used this MCP together with a given model.

How Switchy teams use it

Not enough Spaces yet to publish anonymised usage stats (we require ≥ 50 Spaces per week).

Starter prompts

Check Funnel Performance

@PostHog retrieve the conversion rates for funnel 'Onboarding Flow' in project 12345 over the last 7 days
Open in a Space →

Enable Feature Flag

@PostHog enable the 'new-checkout' feature flag for the beta user segment in project 12345
Open in a Space →

Add Dashboard Viewer

@PostHog add sarah@company.com as a viewer to dashboard 'Weekly Metrics' in project 12345
Open in a Space →

Summarize Experiment Results

@PostHog get the latest results for experiment 'Pricing Page Variant B' in project 12345 including significance levels
Open in a Space →

Bookmark Key Activity

@PostHog bookmark the activity notification about the spike in error events at 14:32 UTC in project 12345
Open in a Space →

Example outputs

Illustrative - representative of the model's voice and quality, not literal recordings.

Prompt

@posthog show me the top 5 events by volume in the last 7 days, and break down which user properties correlate with high engagement

Output

Based on your PostHog project data, the top 5 events are: 1) page_view (42,318 events), 2) button_click (18,904), 3) form_submit (7,221), 4) video_play (3,109), 5) search_query (2,847). Users with 'plan: pro' triggered 3.2x more events than free-tier users. The 'mobile_app' property correlates with 68% higher engagement on button_click events. This analysis covers the period from Jan 15-22, 2025.

Notes

This example demonstrates PostHog's analytics querying capability. The MCP can retrieve event volumes and breakdowns, but the depth of correlation analysis depends on your project's configured properties and the AI's ability to interpret returned data structures. Requires read access to insights and events.

Prompt

@posthog create a new feature flag called 'dark-mode-v2' targeting users in the 'beta-testers' cohort, and set it to 50% rollout

Output

Feature flag 'dark-mode-v2' created successfully in your PostHog project. Configuration: targeting cohort 'beta-testers' (412 users), rollout percentage set to 50%, flag key is 'dark_mode_v2'. The flag is currently active and will affect approximately 206 users in the target cohort. You can adjust rollout or targeting rules via the PostHog dashboard or by asking me to update the flag settings.

Notes

This showcases PostHog's feature flag management. The MCP can create flags and assign rollout rules, but you must have 'feature_flag:write' permissions. Side-effect: the flag goes live immediately unless you specify otherwise. Verify cohort names exist in your project before creating targeting rules.

Prompt

@posthog pull the last 10 session recordings where users encountered a JS error, then summarize the most common error messages and the pages they occurred on

Output

Retrieved 10 session recordings with JS errors from the past 3 days. Most common errors: 1) 'Cannot read property of undefined' (6 occurrences, primarily on /checkout and /profile pages), 2) 'Network request failed' (3 occurrences on /api/submit), 3) 'Invalid date format' (1 occurrence on /settings). The checkout page errors cluster around the payment form interaction. Five of these sessions resulted in user drop-off within 30 seconds of the error.

Notes

This pairs PostHog's session replay data with AI synthesis to surface patterns. The MCP retrieves recording metadata and error logs, but the AI interprets trends. Session recordings must be enabled in your PostHog project, and this query can be slow if your project has high recording volume. Rate limits apply to bulk recording fetches.

Use-case deep-dives

Feature rollout coordination at 8-person startup

When PostHog MCP makes feature flagging a team sport

A product team shipping a redesigned checkout flow needs to coordinate flag access across eng, design, and customer success. The PostHog MCP's role-based flag assignment tool lets your PM set up read-only access for CS reps monitoring the rollout while keeping write access locked to the eng lead. This works when your feature flag count stays under 20 active experiments—beyond that, the 50-tool catalog gets cluttered and you're better off scripting flag changes in your deploy pipeline. The MCP shines in the messy middle stage where you're past manual dashboard clicks but not yet at infrastructure-as-code maturity. If your team runs standups where someone asks 'who can toggle the beta flag,' this integration pays for itself in week one.

Customer support insight lookup during live calls

PostHog analytics access for non-technical support teams

A 12-person SaaS company wants support reps to pull funnel drop-off data mid-call without learning SQL or bothering the analytics lead. The PostHog MCP's insight cancellation and dashboard collaboration tools let your ops manager grant time-boxed dashboard access to support staff, then revoke it when the campaign ends. This setup works if your dashboards are pre-built and stable—if your support team needs to create custom cohorts or modify queries, the MCP's tool surface is too narrow and they'll ping Slack anyway. The threshold is about 5 standing dashboards that answer 80% of support questions. Below that, just share a login. Above that, the MCP keeps your PostHog project clean while giving support the autonomy to self-serve during peak ticket hours.

Onboarding contractors to analytics workspace

Temporary PostHog access without credential sprawl

A 6-person growth team brings on a freelance conversion optimizer for a 3-month engagement and needs to grant scoped PostHog access without creating a full org seat. The MCP's bulk invite and project-specific role tools let you provision a contractor with read access to two dashboards, then auto-expire the invite when the contract ends. This beats manual credential management if you onboard more than one contractor per quarter—otherwise the setup overhead outweighs clicking 'invite user' in the PostHog UI. The MCP also logs every access grant in your Switchy workspace, which matters if you're SOC 2 tracking or just want a paper trail when the contractor's NDA expires. If your team cycles through 4+ external collaborators a year and you've ever lost track of who has PostHog access, this integration closes that gap.

Frequently asked

What does the PostHog MCP let me do in Switchy?

It connects your PostHog analytics workspace so AI agents can query event data, manage feature flags, update dashboards, and handle team permissions. You can ask questions like 'show conversion funnel for last week' or 'turn off the beta flag for mobile users' without opening PostHog. The MCP exposes 50 tools covering insights, flags, projects, and org management.

Do I need admin access to connect PostHog?

You need a PostHog Personal API Key with appropriate scopes for the tools you want to use. Most read operations work with basic access, but writing feature flags requires 'feature_flag:write', and adding team members needs org-level permissions. Generate the key in PostHog under Personal API Keys, not the project API key used for event ingestion.

Can the MCP create new feature flags or just toggle existing ones?

The MCP can assign role-based access to existing feature flags but the representative tools shown focus on access control rather than flag creation. If you need to create flags programmatically, check the full tool list or use PostHog's main API directly. The MCP is strongest for querying analytics and managing permissions across projects.

Why use this instead of just logging into PostHog?

You skip context-switching when an AI agent can pull conversion data or toggle a flag mid-conversation. It's faster for repetitive tasks like checking experiment results or inviting contractors to specific projects. For one-off dashboard design or complex cohort building, PostHog's UI is still better. Use the MCP when analytics questions come up during planning or debugging.

Who on the team should connect the PostHog MCP?

Whoever owns your PostHog org or has Personal API Key creation rights. That's usually a product lead or engineering manager. Once connected in Switchy, any team member can ask the AI to query PostHog data within their permission scope. The API key's permissions define what the MCP can do, so don't connect with an admin key if you only need read access.

Compare with

Compare with anything else →
Data last verified 7 hours ago.Sources aggregated hourly to weekly. See docs/architecture/model-directory.md.