All integrations

PostHog

Proxy PostHog's hosted MCP server for analytics, feature flags, error tracking, HogQL, and more.

OAuth

Overview

Proxy PostHog's hosted MCP server for analytics, feature flags, error tracking, HogQL, and more. Tools mirror upstream dynamically after connect.

Prerequisites

  • A PostHog account with access to the org/project you want AI to query
  • A stackgate.ai account

Getting credentials

  1. Open Integrations → PostHog in stackgate.ai.
  2. Click Activate, then Connect PostHog.
  3. Complete PostHog OAuth (RFC 9728 / PKCE).
  4. Open Preferences to pin a default organization, project, region (US/EU), and optional read-only mode.

You can optionally override with a PostHog personal API key in preferences instead of OAuth.

Using with AI clients

  • Dedicated endpoint: POST /mcp/posthog
  • Private gateway: posthog__* namespaced tools (mirrored from upstream)
  • Run refresh_tools after connect to sync the latest upstream tool list
  • Preferences pin the default org/project. Pass optional organization_id and project_id on any PostHog tool to target another org/project for that call only. organization_id without project_id clears the stored project pin so projects-get can list that org's projects.

See PostHog MCP documentation for upstream capabilities.

Troubleshooting

  • OAuth failed — confirm PostHog OAuth client registration for your region (US vs EU MCP URL).
  • Empty tool list — call refresh_tools after connect; upstream may require org/project preferences.
  • Token expired — reconnect PostHog from My Integrations.

Available tools

Tools are mirrored dynamically from PostHog's hosted MCP server after you connect. Use refresh_tools to sync the latest upstream tool list.

  • Analytics queries and HogQL
  • Feature flags inspection
  • Error tracking and session replay metadata
  • Experiment and dashboard context

See also: upstream MCP documentation.

MCP endpoint: https://stackgate.ai/mcp/posthog (HTTP) or via the private gateway.

Related workflows

Multi-integration playbooks that use PostHog to solve concrete business outcomes.