PostHog
PostHog MCP Server
Query product analytics, manage feature flags, and explore user data from PostHog.
Last reviewed Mar 2, 2026
Install
claude mcp add posthog --transport sse -- https://mcp.posthog.com/sseEnvironment variables required:
POSTHOG_API_KEY=your-personal-api-keyAvailable tools
| Tool | Description |
|---|---|
| query_insights | Query analytics insights and trends |
| list_dashboards | List all dashboards in your PostHog project |
| create_feature_flag | Create a new feature flag with targeting rules |
| list_events | List recent events with filtering |
| search_persons | Search for users and their properties |
What it does
The PostHog MCP Server connects your AI coding assistant to PostHog's product analytics platform via their hosted SSE endpoint. It enables you to query analytics data, manage feature flags, explore user behavior, and review dashboards -- all without leaving your development environment.
This integration is particularly useful when you need analytics context during development. Your assistant can check how users interact with existing features before you build new ones, verify that events are being tracked correctly, and manage feature flag rollouts alongside your code changes.
Use cases
- Query analytics data to understand user behavior before implementing new features
- Create and manage feature flags for gradual rollouts directly from your editor
- Check event tracking to verify your instrumentation is working correctly
- Explore user properties and segments to inform personalization logic
- Review dashboard metrics during sprint planning or retrospectives
Getting started
- Create a PostHog Personal API Key at app.posthog.com/settings/user-api-keys. This is different from your project API key -- it provides access to the management API.
- Set the
POSTHOG_API_KEYenvironment variable to your personal API key. - The server connects to PostHog's hosted MCP endpoint via SSE, so no local process is needed.
- Your API key determines which projects and data you can access. Ensure your PostHog user account has the necessary permissions for the projects you want to query.
Compatibility
Related MCP servers
AWS MCP Server
Interact with AWS services including S3, Lambda, CloudWatch, and ECS from your AI coding assistant.
Context7 MCP Server
Fetch up-to-date library documentation and code examples directly into your AI coding assistant.
Docker MCP Server
Manage Docker containers, images, and builds directly from your AI coding assistant.