PostHog MCP is a Model Context Protocol server for interacting with PostHog projects and data. It exposes tools for tasks like feature flag management, analytics queries, experiments, error tracking, dashboards, and other PostHog features, with optional feature-based filtering.
From the registry: Official PostHog MCP Server for product analytics, feature flags, experiments, and more.
Please install the `mcp-posthog` MCP server into my current AI client (that's you).
Required prerequisites (do these first if not already done):
- **Obtain a PostHog personal API key** — Create a personal API key using the MCP Server preset. This key is required for authentication and should be passed as a Bearer token in the Authorization header. (https://app.posthog.com/settings/user-api-keys?preset=mcp_server)
Canonical MCP server config (stdio transport):
- command: `npx`
- args: ["-y","mcp-remote@latest","https://mcp.posthog.com/mcp","--header","Authorization:${POSTHOG_AUTH_HEADER}"]
- required environment variables:
- `POSTHOG_AUTH_HEADER`: Authorization header value for PostHog MCP authentication. Use your personal PostHog API key as a Bearer token. (example: `Bearer <your-personal-api-key>`)
- optional environment variables:
- `POSTHOG_BASE_URL`: Custom base URL for self-hosted PostHog instances when running the MCP server locally or on your own infrastructure. (example: `<your-posthog-base-url>`)
Note: Preferred install path is the stdio wrapper using `mcp-remote` over PostHog's hosted Streamable HTTP endpoint. Default endpoint is `https://mcp.posthog.com/mcp`. If your client does not support Streamable HTTP, the README says you can use `https://mcp.posthog.com/sse` instead. You can also add query parameters to the MCP URL such as `features=<feature-list>` and/or `tools=<tool-list>` to filter exposed tools. For EU users, the README notes `mcp-eu.posthog.com` endpoints for EU routing.
Add this MCP server to my current client's config in the correct format for you. If you need secrets or credentials I haven't provided, ASK me — do not invent values or leave raw placeholders. After adding it, tell me how to verify the server is connected.POSTHOG_AUTH_HEADERrequiredBearer authorization header containing the personal PostHog API key.