# PostHog MCP Server [Official] [Health: Active]

**Category:** 📊 Data Platforms  
**Repository:** https://github.com/PostHog/posthog  
**GitHub Stars:** 41019  
**npm Downloads (last month):** 35470  
**Views:** 4  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/posthog-mcp-server

## Description
Official PostHog MCP Server for product analytics, feature flags, experiments, and more.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

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

## Documentation

## What PostHog MCP Server does

PostHog MCP Server exposes PostHog through the Model Context Protocol so AI agents can work with product context from an MCP-compatible client. PostHog brings together product analytics, web analytics, group analytics, session replays, error tracking, logs, tracing, feature flags, experiments, surveys, workflows, warehouse data, and other product information.

The MCP connection is useful for agents that need to investigate user behavior, inspect product signals, or help with product iteration without switching out of an editor. The available PostHog platform includes both read-oriented analysis and actions such as managing feature rollouts and experiments.

## How it works

The hosted endpoint is `https://mcp.posthog.com/mcp`. A client connects to this remote MCP server, and PostHog routes the session to the appropriate US or EU data region when the user signs in. This avoids running a local MCP process for the hosted PostHog connection.

PostHog also provides MCP analytics, marked as beta, for examining how agents use MCP servers. The wider PostHog platform can combine analytics with session recordings, errors, logs, traces, flags, experiments, and warehouse data, giving an agent access to multiple forms of product context through one service.

## Setup and configuration

Use the PostHog wizard to add the MCP server to a supported client:

```bash
npx @posthog/wizard mcp add
```

The documented clients include Claude Code, Cursor, Codex, VS Code, Zed, and PostHog Desktop. A PostHog account and sign-in are required for the hosted endpoint. PostHog Cloud is available in US and EU regions; the remote server selects the relevant region during login.

The setup wizard itself can also be installed or run with:

```bash
npx -y @posthog/wizard@latest
```

Client-specific setup guides are available in PostHog’s Model Context Protocol documentation. The MCP endpoint is hosted by PostHog, so this connection does not require a local server command or server environment variables.

## Tools and capabilities

Depending on the PostHog capabilities exposed through the MCP connection, agents can work with areas including:

- Product, web, and group analytics
- Session replays and heatmaps
- Error tracking, logs, and distributed tracing
- Feature flags and controlled rollouts
- Experiments and their goal metrics
- Surveys, support, and workflows
- Warehouse and data pipeline context
- AI observability data, including traces, generations, latency, and cost

PostHog’s product analytics supports event-based analysis through visualizations or SQL. Its feature flags support selective releases, while experiments measure changes against goal metrics. These capabilities make the server relevant for product investigation, debugging, release decisions, and analysis performed from an AI coding environment.

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

