# PostHog/posthog [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/PostHog/posthog/tree/master/services/mcp  
**GitHub Stars:** 41348  
**npm Downloads (last month):** 36634  
**Views:** 5  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/posthog-posthog

## Description
Interact with PostHog analytics, feature flags, error tracking and more.

## Claude Desktop Quick Installation
Remote MCP endpoint (confidence: high). Install path detected from listing signals. Add as a URL/SSE server in your client:

```json
"mcpServers": {
  "posthog": {
    "url": "https://mcp.posthog.com/mcp"
  }
}
```

## Documentation

## 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:

```bash
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:

```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.

_Full upstream README: https://allmcps.com/mcp/posthog-posthog/readme_

