Connector

PostHog

PostHog is a comprehensive product and user analytics platform designed to integrate seamlessly into your workflow, providing deep insights into user behavior and product performance. It empowers teams to make data-driven decisions by capturing and analyzing user interactions in real-time.

posthog

Features

  • Open-source analytics platform allowing full data ownership
  • Real-time user behavior tracking and event analytics
  • Built-in feature flags and A/B testing capabilities
  • Easy integration with existing tech stacks and APIs
  • Customizable dashboards for tailored data visualization

Benefits

  • Gain complete control over your analytics data and infrastructure
  • Improve user engagement through data-driven product enhancements
  • Reduce reliance on third-party analytics providers, enhancing privacy
  • Accelerate decision-making with actionable, real-time insights
  • Optimize feature rollouts with integrated experimentation tools

Available tools

52 actions available as tools

posthog

Add insight to dashboard

Add an existing insight to a dashboard. Requires insight ID and dashboard ID. Optionally supports layout and color customization.

posthog

Dashboard create

Create a new dashboard in the project. Requires name and optional description, tags, and other properties.

posthog

Dashboard delete

Delete a dashboard by ID (soft delete - marks as deleted).

posthog

Dashboard get

Get a specific dashboard by ID. The response will include insights / tiles that are on the dashboard.

posthog

Dashboards get all

Get all dashboards in the project with optional filtering. Can filter by pinned status, search term, or pagination.

posthog

Dashboard update

Update an existing dashboard by ID. Can update name, description, pinned status or tags.

posthog

Dashboard reorder tiles

Reorder tiles (insights) on a dashboard. Provide an array of tile IDs in the desired order from top to bottom. First, use dashboard-get to retrieve the dashboard and see the current tile IDs, then provide the tile IDs in your desired order.

posthog

Docs search

Use this tool to search the PostHog documentation for information that can help the user with their request. Use it as a fallback when you cannot answer the user's request using other tools in this MCP. Only use this tool for PostHog related questions.

posthog

Error details

Use this tool to get the details of an error in the project.

posthog

List errors

Use this tool to list errors in the project.

posthog

Create feature flag

Creates a new feature flag in the project. Once you have created a feature flag, you should: Ask the user if they want to add it to their codebase, Use the "search-docs" tool to find documentation on how to add feature flags to the codebase (search for the right language / framework), Clarify where it should be added and then add it.

posthog

Delete feature flag

Delete a feature flag in the project.

posthog

Feature flag get all

Get all feature flags in the project.

posthog

Feature flag get definition

Get the definition of a feature flag. You can provide either the flagId or the flagKey. If you provide both, the flagId will be used.

posthog

Update feature flag

Update a new feature flag in the project. To enable a feature flag, you should make sure it is active and the rollout percentage is set to 100 for the group you want to target. To disable a feature flag, you should make sure it is inactive, you can keep the rollout percentage as it is.

posthog

Experiment get all

Get all experiments in the project.

posthog

Experiment create

Create a comprehensive A/B test experiment. PROCESS: 1) Understand experiment goal and hypothesis 2) Search existing feature flags with 'feature-flags-get-all' tool first and suggest reuse or new key 3) Help user define success metrics by asking what they want to optimize 4) MOST IMPORTANT: Use 'event-definitions-list' tool to find available events in their project 5) For funnel metrics, ask for specific event sequence (e.g., ['product_view', 'add_to_cart', 'purchase']) and use funnel_steps parameter 6) Configure variants (default 50/50 control/test unless they specify otherwise) 7) Set targeting criteria if needed.

posthog

Experiment delete

Delete an experiment by ID.

posthog

Experiment update

Update an existing experiment by ID. Can update name, description, lifecycle state, variants, metrics, and other properties. RESTART WORKFLOW: To restart a concluded experiment, set end_date=null, conclusion=null, conclusion_comment=null, and optionally set a new start_date. To make it draft again, also set start_date=null. COMMON PATTERNS: Launch draft (set start_date), stop running (set end_date + conclusion), archive (set archived=true), modify variants (update parameters.feature_flag_variants). NOTE: feature_flag_key cannot be changed after creation.

posthog

Experiment get

Get details of a specific experiment by ID.

posthog

Experiment results get

Get comprehensive experiment results including all metrics data (primary and secondary) and exposure data. This tool fetches the experiment details and executes the necessary queries to get complete experiment results. Only works with new experiments (not legacy experiments).

posthog

Insight create from query

Create an insight from a query that you have previously tested with 'query-run'. You should check the query runs, before creating an insight. Do not create an insight before running the query, unless you know already that it is correct (e.g. you are making a minor modification to an existing query you have seen).

posthog

Insight delete

Delete an insight by ID (soft delete - marks as deleted).

posthog

Insight get

Get a specific insight by ID.

posthog

Insight query

Execute a query on an existing insight to get its results/data. Provide the insight ID to retrieve the current query results.

posthog

Insights get all

Get all insights in the project with optional filtering. Can filter by saved status, favorited status, or search term.

posthog

Insight update

Update an existing insight by ID. Can update name, description, filters, and other properties. You should get the insight before update it to see it's current query structure, and only modify the parts needed to answer the user's request.

posthog

Query run

You should use this to answer questions that a user has about their data and for when you want to create a new insight. You can use 'event-definitions-list' to get events to use in the query, and 'event-properties-list' to get properties for those events. It can run a trend, funnel or HogQL query. Where possible, use a trend or funnel rather than a HogQL query, unless you know the HogQL is correct (e.g. it came from a previous insight.).

posthog

Query generate hogql from question

This is a slow tool, and you should only use it once you have tried to create a query using the 'query-run' tool, or the query is too complicated to create a trend / funnel. Queries project's PostHog data based on a provided natural language question - don't provide SQL query as input but describe the output you want. When giving the results back to the user, first show the SQL query that was used, then provide results in reasily readable format. You should also offer to save the query as an insight if the user wants to.

posthog

Get llm total costs for project

Fetches the total LLM daily costs for each model for a project over a given number of days. If no number of days is provided, it defaults to 7. The results are sorted by model name. The total cost is rounded to 4 decimal places. The query is executed against the project's data warehouse. Show the results as a Markdown formatted table with the following information for each model: Model name, Total cost in USD, Each day's date, Each day's cost in USD. Write in bold the model name with the highest total cost. Properly render the markdown table in the response.

posthog

Organization details get

Get the details of the active organization.

posthog

Organizations get

Get the organizations the user has access to.

posthog

Switch organization

Change the active organization from the default organization. You should only use this tool if the user asks you to change the organization - otherwise, the default organization will be used.

posthog

Projects get

Fetches projects that the user has access to in the current organization.

posthog

Event definitions list

List all event definitions in the project with optional filtering. Can filter by search term.

posthog

Event definition update

Update event definition metadata. Can update description, tags, mark status as verified or hidden. Use exact event name like '$pageview' or 'user_signed_up'.

posthog

Properties list

List properties for events or persons. If fetching event properties, you must provide an event name.

posthog

Switch project

Change the active project from the default project. You should only use this tool if the user asks you to change the project - otherwise, the default project will be used.

posthog

Survey create

Creates a new survey in the project. Surveys can be popover or API-based and support various question types including open-ended, multiple choice, rating, and link questions. Once created, you should ask the user if they want to add the survey to their application code.

posthog

Survey get

Get a specific survey by ID. Returns the survey configuration including questions, targeting, and scheduling details.

posthog

Surveys get all

Get all surveys in the project with optional filtering. Can filter by search term or use pagination.

posthog

Survey update

Update an existing survey by ID. Can update name, description, questions, scheduling, and other survey properties.

posthog

Survey delete

Delete a survey by ID (soft delete - marks as archived).

posthog

Surveys global stats

Get aggregated response statistics across all surveys in the project. Includes event counts (shown, dismissed, sent), unique respondents, conversion rates, and timing data. Supports optional date filtering.

posthog

Survey stats

Get response statistics for a specific survey. Includes detailed event counts (shown, dismissed, sent), unique respondents, conversion rates, and timing data. Supports optional date filtering.

posthog

Logs query

Search and query logs in the project. Supports filtering by severity levels (trace, debug, info, warn, error, fatal), service names, date range, and free text search. Returns log entries with their attributes, timestamps, and trace information. Supports pagination via cursor.

posthog

Logs list attributes

List available log attributes in the project. Use this to discover what attributes you can filter on when querying logs. Supports filtering by attribute type (log or resource) and searching by attribute name.

posthog

Logs list attribute values

Get possible values for a specific log attribute. Use this to discover what values exist for a given attribute key, which helps when building log queries with filters.

posthog

Actions get all

Get all actions in the project. Actions are reusable event definitions that can combine multiple trigger conditions (page views, clicks, form submissions) into a single trackable event for use in insights and funnels. Supports pagination with limit and offset parameters. Note: Search/filtering by name is not supported on this endpoint.

posthog

Action get

Get a specific action by ID. Returns the action configuration including all steps and their trigger conditions.

posthog

Entity search

Search for PostHog entities by name or description. Can search across multiple entity types including insights, dashboards, experiments, feature flags, notebooks, actions, cohorts, event definitions, and surveys. Use this to find entities when you know part of their name. Returns matching entities with their IDs and URLs.

posthog

Demo mcp ui apps

Demo tool for testing MCP Apps SDK integration. Returns sample data that is displayed in an interactive UI app. Use this to verify that MCP Apps are working correctly.

Try Needle today

Streamline AI productivity at your company today

Join thousands of people who have transformed their workflows.

Agentic workflowsAutomations, meet AI agents
AI SearchAll your data, searchable
Chat widgetsDrop-in widget for your website
Developer APIMake your app talk to Needle
    Needle LogoNeedle
    Like many websites, we use cookies to enhance your experience, analyze site traffic and deliver personalized content while you are here. By clicking "Accept", you are giving us your consent to use cookies in this way. Read our more on our cookie policy .