Skip to content

Summary

PostHog's official remote MCP server — query product analytics with HogQL, manage feature flags, and triage errors from your editor.

Features

  • Run HogQL queries against your product analytics data
  • Create, read, and update insights and dashboards
  • Create and manage feature flags
  • Launch and analyze experiments
  • Inspect error-tracking issues and stack traces
  • Hosted remote server — no local install to maintain

Installation

Set up this MCP server in your favorite AI agent — copy a ready-made configuration below.

Any MCP-compatible agent

Most agents (Claude, Cursor, Windsurf, VS Code, and more) read a standard mcpServers configuration.

  1. Open your agent's MCP configuration file.
  2. Merge the snippet below into it, filling in the environment variables with your own values.
  3. Restart the agent — the "PostHog" tools will be available.
{
  "mcpServers": {
    "posthog": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.posthog.com/mcp"
      ],
      "env": {
        "POSTHOG_AUTH_HEADER": "Bearer <your-personal-api-key>"
      }
    }
  }
}

Description

The official PostHog MCP server connects an AI agent directly to your PostHog project, turning product analytics into something you can interrogate in plain language. An agent can run HogQL queries against your event data, build and read insights and dashboards, inspect trends and funnels, create and toggle feature flags, launch and analyze experiments, and pull error-tracking stack traces without leaving the editor.

It is a hosted remote server rather than a local process, so there is nothing to run or keep updated: authenticate with a PostHog personal API key and connect from Claude Code, Claude Desktop, Cursor, VS Code, Windsurf, or any other MCP client. The fastest setup is PostHog's own installer, npx @posthog/wizard mcp add, which detects supported clients and writes the config for you across 25+ environments.

Connecting to the server and calling its tools is free. A handful of tools use LLMs internally and are billed as PostHog AI spend; those are only available when AI data processing is enabled in your organization settings.

Related MCP Servers

MCP: Engram

by Gentleman Programming

New

Persistent memory for coding agents as a single Go binary — SQLite and FTS5 behind MCP, an HTTP API, a CLI and a TUI, with no Node, Python or Docker required.

MCP: agent-device

by Callstack

New

Give a coding agent a live feedback loop on real mobile, TV and desktop apps — inspect, tap, type and capture evidence on iOS, Android and HarmonyOS over MCP or a CLI.

New

The official W&B MCP server: query experiment runs, Weave LLM traces, artifacts and registries in natural language, and write findings back as a W&B report.

Featured

Replicate's official MCP server: search thousands of hosted models, read their schemas, and run predictions on image, video, audio and language models from inside an agent.

Browse all MCP servers →