# PostHog MCP Server

Connects PostHog analytics and feature flag management to AI assistants via Streamable HTTP.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 40409
- Author: PostHog
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/PostHog/posthog/tree/HEAD/services/mcp
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server

## What it does

This remote server connects AI clients to PostHog data through `https://mcp.posthog.com/mcp`. The assistant can query event trends and inspect active dashboards. It also handles operational tasks like generating feature flags or launching experiments with custom funnels.

Communication runs over HTTP. Clients must pass a personal PostHog API key in the `Authorization` header as a Bearer token. Tools can be filtered by appending parameters to the endpoint URL, such as `?features=flags,workspace,dashboards`.

Without a personal PostHog API token, requests to the remote endpoint will fail.

## Requirements
- Remote server: `https://mcp.posthog.com/mcp`

## Install

### Claude Code (native platform)

**Platform CLI: remote server**
```bash
claude mcp add --transport http mcp https://mcp.posthog.com/mcp
```

### Codex

**Platform CLI: remote server**
```bash
codex mcp add mcp --url https://mcp.posthog.com/mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp": {
            "url": "https://mcp.posthog.com/mcp"
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp": {
            "type": "http",
            "url": "https://mcp.posthog.com/mcp"
        }
    }
}
```

### Gemini CLI

**Platform CLI: remote server**
```bash
gemini mcp add -t http mcp https://mcp.posthog.com/mcp
```

## When to use it
- inspect daily signup trends and aggregated user counts
- create feature flags with targeting rules and percentage rollouts
- set up A/B tests with custom funnel metrics
- fetch recent error groups and identify affected user counts

## Example prompts
- Create a feature flag named checkout-v2 with a 20% rollout and print its settings
- Count unique users who signed up over the last 7 days grouped by day
- List the top 5 error issues this week along with affected user counts

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433
- [apify-mcp-server](https://affpapa.org/en/nevibecode/mcp/apify-mcp-server.md) — MCP server · ★ 12927
- [Nhost](https://affpapa.org/en/nevibecode/mcp/nhost.md) — MCP server · ★ 9366
- [Finance Toolkit](https://affpapa.org/en/nevibecode/mcp/finance-toolkit.md) — MCP server · ★ 5458
- [JobSpy](https://affpapa.org/en/nevibecode/mcp/jobspy.md) — MCP server · ★ 4552

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
