---
title: "PostHog MCP server – install in Claude Desktop and Cursor"
summary: "PostHog's official MCP server that lets an agent query events, run insights, and inspect feature flags in your PostHog project."
canonical: https://unlocksaas.com/mcp-tools/posthog
updated: 2026-05-22
publisher: "Unlock SaaS"
author: "Maryan"
license: All rights reserved. Quotation with attribution permitted.
---

# PostHog MCP server

> PostHog's official MCP server that lets an agent query events, run insights, and inspect feature flags in your PostHog project.

- Vendor: PostHog
- Vendor URL: https://posthog.com/docs/llm-observability
- Category: Indie SaaS infrastructure
- Distribution: npm package (runs locally)
- Install handle: @posthog/mcp-server
- Official: yes
- Access: Requires a PostHog personal API key with appropriate scopes.

## TL;DR

PostHog's official MCP server exposes product analytics, insights, and feature flag state as MCP tools. The agent can ask questions like 'how many users hit the diagnostic page yesterday' or 'which flag is gating onboarding' and get a structured answer grounded in your PostHog project, not a guess.

## Why an indie SaaS founder cares

If you are already using PostHog for product analytics, this server turns Claude into a competent product-analyst pair. Drop in a question about activation, retention, or a specific event and let the assistant write the insight against your real project rather than hallucinating numbers.

## What an agent can do with it

- **Query events and insights** – Run structured insight queries and inspect event volume by name and property.
- **Inspect feature flags** – Read flag state, payloads, and rollouts the agent has permission to see.
- **Trace funnels and retention** – Surface funnel conversion and retention cohort answers without leaving the chat.

## Install in Claude Desktop

```json
{
  "mcpServers": {
    "posthog": {
      "command": "npx",
      "args": ["-y", "@posthog/mcp-server"]
    }
  }
}
```

## Install in Cursor

```json
{
  "mcpServers": {
    "posthog": {
      "command": "npx",
      "args": ["-y", "@posthog/mcp-server"]
    }
  }
}
```

## FAQ

**Does the agent see PII in events?**

It sees whatever your PostHog project sees. If you mask or filter PII at ingest, the agent is bound by the same view.

Last verified: 2026-05-22.

---

Canonical URL: https://unlocksaas.com/mcp-tools/posthog
Publisher: Unlock SaaS (https://unlocksaas.com)
Contact: maryan@unlocksaas.com