> **Building with AI coding agents?** If you're using an AI coding agent, install the official Scalekit plugin. It gives your agent full awareness of the Scalekit API — reducing hallucinations and enabling faster, more accurate code generation.
>
> - **Claude Code**: `/plugin marketplace add scalekit-inc/claude-code-authstack` then `/plugin install <auth-type>@scalekit-auth-stack`
> - **GitHub Copilot CLI**: `copilot plugin marketplace add scalekit-inc/github-copilot-authstack` then `copilot plugin install <auth-type>@scalekit-auth-stack`
> - **Codex**: run the bash installer, restart, then open Plugin Directory and enable `<auth-type>`
> - **Skills CLI** (Windsurf, Cline, 40+ agents): `npx skills add scalekit-inc/skills --list` then `--skill <skill-name>`
>
> `<auth-type>` / `<skill-name>`: `agentkit`, `full-stack-auth`, `mcp-auth`, `modular-sso`, `modular-scim` — [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# PostHog MCP

## What you can do

Connect this agent connector to let your agent:

- **Analytics & insights** — Run trend, funnel, path, and HogQL queries; create and retrieve insights and dashboards
- **Feature flags** — Create, update, evaluate, and delete flags; manage multivariate and early-access feature flags
- **Experiments** — Create A/B tests, configure variants and metrics, launch experiments, and retrieve results
- **Surveys** — Create surveys with multiple question types; retrieve response stats and submissions
- **Persons & cohorts** — List and query persons, create and manage cohorts, retrieve person activity
- **Session recordings** — List and retrieve session recordings and playlists
- **Error tracking** — List, merge, resolve, and suppress error tracking issues
- **Events & actions** — List event and property definitions, create and manage actions
- **CDP & data pipelines** — List and manage transformations, destinations, and external data sources
- **Activity & audit** — Retrieve activity logs and audit trails for all resources

## Authentication

This connector uses **OAuth 2.1/DCR with PKCE**. PostHog MCP is an MCP server that issues credentials dynamically via Dynamic Client Registration — Scalekit handles DCR, obtains an access token, and automatically refreshes it before it expires. Your agent code never handles tokens directly — you only pass a `connectionName` and a user `identifier`.

<details>
<summary>Code examples</summary>

<UsagePosthogmcpSection />

</details>

## Tool list

<ToolList tools={tools} />

---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
