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.

October 19, 2026
MCP ServerAnalytics & DataPostHog MCP Server: AI-Powered Analytics & Feature Flags
PostHog MCP Server: AI-Powered Analytics & Feature Flags
GitHub stars

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:

ToolPurposeCategory
annotation-createCreate annotationAnnotations
annotations-listList annotationsAnnotations
feature-flag-get-allGet all feature flagsFeature flags
feature-flag-enableEnable a feature flagFeature flags
query-error-tracking-issues-listQuery error tracking issues listError tracking
project-getGet projectCore

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