Posthog logo

Posthog

by PostHog

Connects AI clients to PostHog for analytics, feature flags, experiments, dashboards, surveys, replay, and error tracking.

Install Posthog

Pick your client, then add it in one click or paste the config.

Streamable HTTP (Remote)
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "posthog-posthog": {
      "command": "npx",
      "args": [
        "-y",
        "@posthog/wizard@latest"
      ],
      "env": {
        "POSTHOG_AUTH_HEADER": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Claude Code command
claude mcp add --env POSTHOG_AUTH_HEADER=YOUR_VALUE_HERE --transport stdio posthog-posthog -- npx -y @posthog/wizard@latest

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

Hosted endpointLive · 4d agoLive Remote EndpointOur automated health check connected to this remote MCP endpoint successfully.Last checked 4d ago · Nov 30, 2026, 23:00 UTC

Clients with native remote MCP support can connect directly to this URL.

Remote endpoint
https://mcp.posthog.com/mcp
We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y @posthog/wizard@latest

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

PostHog/posthog connects MCP-compatible clients to PostHog through the hosted Streamable HTTP endpoint at https://mcp.posthog.com/mcp. It exposes tools for product analytics and SQL, dashboards, experiments, feature flags, surveys, session replay, error tracking, and related PostHog features. Use it when an agent needs to inspect product data or manage PostHog resources with a personal API key.

Use cases

  • Query signup trends and unique-user counts
  • Create and configure percentage-based feature flags
  • Set up experiments with funnel conversion metrics
  • Inspect dashboards and tracked events
  • Investigate top errors and affected users

Key features

  • PostHog analytics and SQL queries
  • Feature flag management
  • Experiment creation and monitoring
  • Dashboard and workspace access
  • Survey, session replay, and error tracking tools
  • Feature-based tool filtering

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

63/63 checks healthy over the last 50d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 1

Scanned 2d ago via OSV.dev · @posthog/wizard@latest (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars41kStargazers on the source repository.
npm downloads36kPackage downloads in the last 30 days.
Last commit4d agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Directory activity5 viewsConfig copies, upvotes, and views on AllMCPs.

How Posthog works

What PostHog/posthog does

PostHog/posthog exposes PostHog functionality through the Model Context Protocol. Agents can query analytics data, work with SQL, inspect dashboards, manage feature flags, create and monitor experiments, review surveys and session recordings, and investigate error-tracking issues.

The server is useful for both read and write workflows. Example tasks include counting unique signups by day, listing active flags, creating a percentage rollout, setting up an A/B test with a funnel metric, and finding high-frequency errors with affected-user counts.

How it works

Clients connect to the hosted Streamable HTTP endpoint:

https://mcp.posthog.com/mcp

Authentication uses a personal PostHog API key sent as a Bearer token in the Authorization header. Streamable HTTP clients must advertise support for both JSON and server-sent events with this header:

Accept: application/json, text/event-stream

An MCP client initializes the connection before listing or calling tools. With the official Model Context Protocol Node SDK, connect() handles the initialization exchange and the required notifications/initialized message.

The endpoint exposes all available tools by default. Add a features query parameter to restrict the tool set, such as ?features=flags,workspace,dashboards.

Setup and configuration

The automatic setup command can add the server to Cursor, Claude, Claude Code, VS Code, and Zed:

Terminal
npx @posthog/wizard@latest mcp add

For manual configuration, run mcp-remote against the hosted endpoint and provide the authorization value through an environment variable:

config.json
{
  "mcpServers": {
    "posthog": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote@latest",
        "https://mcp.posthog.com/mcp",
        "--header",
        "Authorization:${POSTHOG_AUTH_HEADER}"
      ],
      "env": {
        "POSTHOG_AUTH_HEADER": "Bearer {YOUR_PERSONAL_API_KEY}"
      }
    }
  }
}

Create the personal key using PostHog's MCP Server preset. A standalone Node client can use StreamableHTTPClientTransport from the MCP SDK and set the same authorization and Accept headers.

Tools and capabilities

Available capability groups include:

  • Product analytics queries, trends, events, and SQL
  • Feature flag creation, inspection, and rollout configuration
  • Experiment creation, variants, metrics, and monitoring
  • Dashboards and workspace resources
  • Surveys, session replay, and error tracking
  • Actions, alerts, annotations, cohorts, and customer analytics
  • Data catalog, schema exploration, and data warehouse access
  • Core utilities such as project switching and PostHog documentation search
  • Data pipelines through batch exports

Feature filtering supports groups such as actions, alerts, annotations, batch_exports, cohorts, core, dashboards, data_catalog, data_schema, data_warehouse, and flags, along with other PostHog areas exposed by the endpoint.

Limitations and notes

Use a personal PostHog API key for authentication. Streamable HTTP clients must include both media types in the Accept header and complete the MCP initialization lifecycle. Supplying feature parameters narrows the exposed tools; omitting them leaves the full tool set available.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Posthog

PostHog/posthog is an MCP server that connects AI clients to PostHog through Streamable HTTP. Its main tools cover analytics and SQL queries, dashboards, feature flags, experiments, surveys, session replay, error tracking, and related PostHog resources, allowing agents to inspect data and manage supported project features.

Run `npx @posthog/wizard@latest mcp add` to add it automatically to supported clients including Cursor, Claude, Claude Code, VS Code, and Zed. For manual setup, configure `mcp-remote` with the hosted endpoint and a Bearer token from a personal PostHog API key.

PostHog/posthog uses a personal PostHog API key as a Bearer token in the `Authorization` header. Store the complete value in `POSTHOG_AUTH_HEADER`, for example `Bearer phx_...`, when configuring a client or Node application.

Yes. Add a `features` query parameter to the hosted MCP URL, such as `https://mcp.posthog.com/mcp?features=flags,workspace,dashboards`. Only tools in the selected feature groups are exposed; without the parameter, all available tools are exposed.

Yes. A Node client can use the Model Context Protocol SDK's `StreamableHTTPClientTransport` to connect to the hosted endpoint. It must send the Bearer authorization and an `Accept` header containing both `application/json` and `text/event-stream`.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewPosthog AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/posthog-posthog?style=directory)](https://allmcps.com/mcp/posthog-posthog)
HTML Embed
<a href="https://allmcps.com/mcp/posthog-posthog"><img src="https://allmcps.com/api/badge/posthog-posthog?style=directory" alt="Posthog on AllMCPs" /></a>