Skip to main content
MCP server CX Codex

PostHog MCP Server — Claude Code MCP server: setup and tools

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

Install into Claude Code · Platform CLI: remote server All methods and platforms ↓
claude mcp add --transport http mcp https://mcp.posthog.com/mcp
Open on GitHub

What PostHog MCP Server 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.

What it helps with

  • 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 for the agent

  • 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

How to install PostHog MCP Server

Platform CLI: remote server

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

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about PostHog MCP Server

How do I install PostHog MCP Server in Claude Code?

Run claude mcp add --transport http mcp https://mcp.posthog.com/mcp in your CLI. You can also run npx @posthog/wizard@latest mcp add for interactive onboarding.

What does PostHog MCP Server do?

It exposes PostHog event queries, error tracking issues, feature flags, and experiment configuration directly to your coding assistant.

How can I restrict which tools the server exposes?

Add query parameters to the URL, such as https://mcp.posthog.com/mcp?features=flags,workspace,dashboards. Only tools associated with the specified features will be loaded.

Similar MCP servers

All MCP servers for Data and databases →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor