PostHog MCP Server: AI-Powered Analytics & Feature Flags
PostHog MCP server enables AI models to interact with PostHog analytics for project management, annotations, feature flags, and error analysis.

Overview
The PostHog MCP Server is the official Model Context Protocol (MCP) server that connects AI assistants to PostHog's analytics platform via natural language. It enables tasks like creating annotations, managing projects, querying data, and toggling feature flags without touching PostHog's UI.
Moved upstream:
The PostHog/mcp repository is no longer the active source. Its README states: "The MCP server has been moved into the PostHog Monorepo" and points to PostHog/posthog/tree/master/services/mcp. Do not clone the old repository. Use the hosted server below.
Key Features
Project Management
List and manage PostHog projects
Annotations
Add timestamped notes for events (e.g., product launches)
Feature Flags
Control and query feature flags dynamically
Error Tracking
Debug errors directly in your IDE
Available Tools
Quick Reference
The hosted server exposes a large tool catalog across PostHog products. These are exact tool names from PostHog's tools reference:
| Tool | Purpose | Category |
|---|---|---|
annotation-create | Create annotation | Annotations |
annotations-list | List annotations | Annotations |
feature-flag-get-all | Get all feature flags | Feature flags |
feature-flag-enable | Enable a feature flag | Feature flags |
query-error-tracking-issues-list | Query error tracking issues list | Error tracking |
project-get | Get project | Core |
Detailed Usage
annotation-createβΆ
Creates an annotation, for example to mark a launch or release.
annotations-listβΆ
Lists annotations for the project.
feature-flag-get-allβΆ
Returns all feature flags.
feature-flag-enableβΆ
Enables a feature flag.
query-error-tracking-issues-listβΆ
Queries the list of error tracking issues.
project-getβΆ
Gets a project.
PostHog's tools reference lists the full catalog, grouped by product, and documents the tools query parameter for scoping a session to a subset.
Installation
The server is hosted at https://mcp.posthog.com/mcp. The fastest install is the PostHog Wizard, which adds it to PostHog Desktop, Cursor, Claude Code, Claude Desktop, Codex, VS Code, and Zed:
npx @posthog/wizard mcp add
To configure a client manually, create a personal API key using the MCP Server preset and add the server:
{
"mcpServers": {
"posthog": {
"command": "npx",
"args": [
"-y",
"mcp-remote@latest",
"https://mcp.posthog.com/mcp",
"--header",
"Authorization:${POSTHOG_AUTH_HEADER}"
],
"env": {
"POSTHOG_AUTH_HEADER": "Bearer {INSERT_YOUR_PERSONAL_API_KEY_HERE}"
}
}
}
}
PostHog's authentication server routes you to the correct data region (US or EU) based on the account you log in with; the monorepo README notes that EU users can use the mcp-eu.posthog.com endpoint. Self-hosted instances are supported with the POSTHOG_API_BASE_URL environment variable. There is no local clone or Python environment to install β PostHog/mcp now only points at the monorepo.
Common Use Cases
1. Annotate Product Launches
Create an annotation for a product launch or significant event:
use_mcp_tool({ server_name: "posthog", tool_name: "annotation-create" });
2. Toggle Feature Flags
Enable or disable a flag from the conversation:
use_mcp_tool({ server_name: "posthog", tool_name: "feature-flag-enable" });
use_mcp_tool({ server_name: "posthog", tool_name: "feature-flag-get-all" });
3. Triage Errors
Query error tracking issues without leaving the editor:
use_mcp_tool({ server_name: "posthog", tool_name: "query-error-tracking-issues-list" });
Connection String Format
The hosted server uses OAuth; the authentication server selects the US or EU region from the account you authorize. Tool arguments are defined by the server and can be inspected through your client's tool list.
Sources
Related Articles & Guides
Clamp Analytics MCP Server
Connect AI assistants to Clamp Analytics for product analytics, user behavior tracking, and data-driven insights through the Model Context Protocol.
#MCP ServerSeq MCP Server: Real-time Log Analytics for AI Models
Search, stream, and analyze structured log events from Datalust Seq using the Seq MCP Server. Integrate log analytics directly with AI assistants through the Model Context Protocol.
#MCP ServerGoogle Analytics MCP Server: AI-Powered Analytics for GA4
Google Analytics MCP server enables AI models to interact with Google Analytics 4 for reports, user behavior analysis, event tracking, and real-time data access.