Back to Tools
Developer Tools API Key
posthog logo

PostHog MCP Tools for AI Agents

Let an agent query trends, funnels, retention, and errors, then manage dashboards, experiments, feature flags, and surveys.

Available Tools

49 tools available in this integration

Posthog.AddInsightToDashboard

Pin an existing insight as a tile on a dashboard.

Posthog.ArchiveExperiment

Archive an experiment by ID; PostHog can restore an archived experiment.

Posthog.ArchiveSurvey

Archive a survey by ID; PostHog can restore an archived survey.

Posthog.ComparePeriods

Compare the same metric across two date ranges side-by-side.

Posthog.CreateDashboard

Create a new empty dashboard.

Posthog.CreateExperiment

Create an A/B test experiment as a draft, with its feature flag.

Posthog.CreateExperimentWithFlag

Create a feature flag and an experiment in one step.

Posthog.CreateFeatureFlag

Create a new feature flag.

Posthog.CreateInsightFromQuery

Save a tested query as a reusable insight.

Posthog.CreateSurvey

Create a new survey.

Posthog.DeleteDashboard

Delete a dashboard by ID.

Posthog.DeleteExperiment

Soft-delete an experiment by ID (marks as archived).

Posthog.DeleteFeatureFlag

Soft-delete a feature flag by numeric ID or key.

Posthog.DeleteInsight

Soft-delete an insight by ID.

Posthog.DeleteSurvey

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

Posthog.GetAllSurveyActivity

Get the activity log across all surveys.

Posthog.GetDashboard

Get a dashboard's full configuration including all insight tiles.

Posthog.GetErrorDetails

Get stack trace, occurrence count, and affected users/sessions for a specific error.

Posthog.GetErrorIssue

Get an error tracking issue: status, severity, name, description, first seen, assignee.

Posthog.GetEventTrend

Get a time-series trend for one or more events over a date range.

Posthog.GetExperiment

Get an experiment's full configuration.

Posthog.GetExperimentResult

Get a launched experiment's results: exposures per variant and each metric's statistics.

Posthog.GetExperimentResults

Get experiment results including metric data and exposure counts.

Posthog.GetFeatureFlag

Get a feature flag's full definition including rollout rules.

Posthog.GetFunnel

Build a multi-step conversion funnel with optional property breakdowns.

Posthog.GetInsight

Get an insight's full configuration and current query results.

Posthog.GetRetention

Get cohort retention data showing what percentage of users return.

Posthog.GetSurvey

Get a survey's full configuration.

Posthog.GetSurveyActivity

Get the activity log for a survey.

Posthog.GetTrend

Get a time-series trend for an event over a date range.

Posthog.GetTrends

Batch trend query: get time-series data for multiple events.

Posthog.ListDashboards

List all dashboards in the project.

Posthog.ListErrorIssues

List error tracking issues.

Posthog.ListErrors

List error tracking issues.

Posthog.ListEventDefinitions

List all tracked event names in the project.

Posthog.ListExperiments

List all A/B test experiments.

Posthog.ListFeatureFlags

List all feature flags.

Posthog.ListInsights

List all saved insights.

Posthog.ListProperties

List property definitions with names, types, and example values.

Posthog.ListSurveyActivities

List the activity log of changes made to surveys.

Posthog.ListSurveys

List all surveys.

Posthog.QueryRows

Run a HogQL query and return its rows, each keyed by column name.

Posthog.RunQuery

Execute a raw PostHog query.

Posthog.UpdateDashboard

Update a dashboard's name, description, pinned status, or tags.

Posthog.UpdateExperiment

Update an experiment's name, description, or metrics, or change its lifecycle state.

Posthog.UpdateFeatureFlag

Update a feature flag's properties or rollout rules.

Posthog.UpdateInsight

Update an insight's name, description, or query.

Posthog.UpdateSurvey

Update a survey's name, description, or questions.

Posthog.WhoAmI

Return the authenticated user's identity, organizations, and projects.

Working directly against the raw API? 766 more tools in the PostHog API server →

Why agent-optimized tools matter

Built for intent, not API schemas

Ask the agent to "find the checkout funnel drop, compare it with last month, and save the useful breakdown as an insight." Arcade picks the right PostHog tools without guessing insight, event, or dashboard IDs.

Up to 100x fewer tokens

PostHog listing reads return concise records, while focused calls fetch full configurations, query rows, and result details only when needed, so the agent can investigate without loading every dashboard and experiment at once.

Complete the workflow end to end

Query events, build a funnel, save an insight, add it to a dashboard, and review experiment results through one toolkit designed around the complete analytics task.

Make actions predictable and controlled

Arcade tools return structured results and useful errors across users and runs. Teams can apply scope restrictions, redaction, and approval policies so agents follow the same controls every time.

Securing PostHog

The more capabilities agents get, the more useful they are. However, more capabilities bring more risks of undesired effects such as data loss and exfiltration.

This is why Arcade provides you with contextual rules that dictate how and when a tool is allowed to run. Arcade’s contextual access lets you govern tool visibility and behavior at every stage of execution and control who can see a tool, what inputs are allowed, and what comes back.

Learn about Contextual Access Policies

For PostHog, you can implement some of these policies:

Access when tools are listed for a user
  • Hide Posthog.DeleteFeatureFlag from agents unless the roles your IDP marks as release managers are active, so an agent cannot remove a rollout control used by production.
  • Restrict Posthog.DeleteDashboard to agents operating under your analytics-admin role, so regular users cannot archive shared reporting views.
  • Deny Posthog.UpdateExperiment to agents without your experimentation-owner role, so unapproved automation cannot change an active test's lifecycle or configuration.
  • Hide Posthog.ArchiveExperiment from agents unless the roles your IDP marks as experimentation owners are active, so an agent cannot remove a test from active review without the right authority.
  • Restrict Posthog.ArchiveSurvey to agents running under your research-operations role, so regular users cannot take a live feedback program out of circulation.
Pre-execution before each tool call
  • Require human approval before Posthog.DeleteExperiment runs, so an agent cannot archive an experiment before its results are reviewed.
  • Block Posthog.UpdateFeatureFlag when the requested rollout targets production without an approved change record, so an agent cannot expose a release to live users on its own.
  • Require human approval before Posthog.CreateSurvey runs, so an agent cannot publish questions to your users without review.
  • Require human approval before Posthog.ArchiveExperiment runs, so an agent cannot archive a test while its results are still informing a release decision.
  • Block Posthog.ArchiveSurvey when the survey is still collecting responses or lacks an approved retirement record, so an agent cannot end feedback collection prematurely.
Post-execution after the tool returns
  • Redact Posthog.GetErrorDetails results to remove affected-user identifiers, session identifiers, and sensitive stack-trace paths before they reach the model.
  • Strip example values from Posthog.ListProperties results, so property discovery cannot expose email addresses, account IDs, or other customer data to the model.
  • Deny Posthog.RunQuery results when they contain raw user-level event records, so the model receives aggregate analytics instead of identifiable customer activity.
  • Redact Posthog.GetExperimentResult results to remove user-level exposure counts, cohort identifiers, and metric breakdowns that could reveal individual participation before they reach the model.
  • Strip email addresses, account IDs, and other direct identifiers from Posthog.QueryRows results, so a broad analytics query cannot deliver identifiable customer records to the model.
  • Deny Posthog.ListSurveyActivities output when activity entries contain respondent identifiers or internal reviewer notes, so private feedback operations do not reach the model.

How to use PostHog with your agent

Connect PostHog with a shared API key, then follow the walkthrough for your MCP client from setup to your first agent request.

Your questions, answered

A PostHog MCP server exposes PostHog analytics capabilities as structured tools that an AI agent can call through the Model Context Protocol. Agents can query events, funnels, trends, retention, errors, experiments, feature flags, surveys, dashboards, and saved insights, then perform permitted changes.

This integration provides PostHog access through Arcade rather than a separate PostHog MCP server. Arcade adds the runtime around the integration, including authenticated tool access, approval workflows, redaction, scope controls, and one connection method for different clients.

Arcade agents can query event trends, funnels, retention, errors, experiments, feature flags, surveys, dashboards, insights, properties, and HogQL rows. They can also create and update dashboards, insights, experiments, feature flags, and surveys, archive experiments or surveys, and delete dashboards, insights, and feature flags.

PostHog access uses a shared API key or secret configured once for the integration. That credential determines which PostHog organization, project, read operations, and write or destructive operations the agent can reach; Arcade does not add separate PostHog OAuth scopes.

No. Users do not each connect a separate PostHog account for this setup. One shared API key or secret is configured once, brokered by Arcade rather than given to the model, so calls use the access granted to that credential.

Yes. Contextual Access policies can require human approval before consequential PostHog actions such as deleting a dashboard or insight, changing a feature flag rollout, creating an experiment, or publishing a survey change. The call proceeds only after the policy's conditions have been satisfied.

Arcade proxies PostHog API calls and does not persist your PostHog content as part of normal tool execution. The shared credential is brokered and stored encrypted at rest, and the model never receives it.

Any framework or client that can connect to Arcade's MCP gateway or tool APIs works, including LangChain, OpenAI Agents, CrewAI, Claude Desktop, Claude Code, Cursor, Visual Studio Code, Microsoft Copilot Studio, and GitHub Copilot.

Arcade refreshes access while the authorization remains valid. If the shared key or secret is revoked, rotated, or can no longer be used, calls stop until the credential is reconnected or updated.

PostHog's API rate limits and project or account quotas still apply to calls made through Arcade. The exact limits depend on the PostHog access path and project, so high-volume querying should account for PostHog's published limits.

Ready to actually ship your agent?

Connect your agent to PostHog with a shared API key, agent-optimized tools and approval controls for consequential actions.