PostHog MCP for Claude Code

The PostHog MCP server enables Claude Code to directly interact with your PostHog data – managing feature flags, querying analytics, investigating errors, and more.

Server URL

https://mcp.posthog.com/mcp

The PostHog authentication server automatically routes you to the correct data region (US or EU) based on the account you log in with.

Quick install

The PostHog Wizard can install the MCP server directly into Claude Code:

Terminal
npx @posthog/wizard mcp add

Claude Code plugin

You can also install PostHog as a Claude Code plugin, which provides the same MCP tools along with built-in slash commands for quick access:

Terminal
claude plugin install posthog

After installing, run /mcp in Claude Code and follow the browser prompts to log in to PostHog.

The plugin includes slash commands like /posthog:flags, /posthog:insights, /posthog:errors, /posthog:experiments, and more.

Manual MCP setup

Run the following command in your shell. The next time you run Claude Code, it will have access to the PostHog MCP.

Terminal
claude mcp add --transport http posthog https://mcp.posthog.com/mcp -s user

When you first use the MCP server, you'll be prompted to log in to PostHog to authenticate.

Be mindful of prompt injection – LLMs can be tricked into following untrusted commands, so always review tool calls before executing them.

What's next

  • Use cases – 20+ example prompts and multi-step recipes for the most useful MCP workflows
  • Tools reference – every tool the MCP server exposes, grouped by category
  • FAQ and advanced setup – auth, scoping, filtering, safety, and other operational details

Community questions

Was this page useful?

Questions about this page? or post a community question.