PostHog MCP server for AI agents

Let Claude, ChatGPT or your own agent read PostHog: 4 typed functions through one MCP server. No PostHog API key needed.

Functions
4
Sign-in
Not needed
Works with
MCP, HTTP, Node, Python

Connect

Just PostHog

An MCP server for PostHog alone, with one tool per function. Paste it into Claude, ChatGPT, Cursor or any MCP client as a remote server.

https://api.bowmark.ai/mcp/site/posthog
Every site

One MCP server for PostHog and every other site Bowmark covers. Your agent looks up what it needs and calls it.

https://api.bowmark.ai/mcp
Set it up in your client

Both need a Bowmark API key. The quickstart gets you one and a first result in a few minutes.

Functions

Open a function to see its arguments, what it returns and how to call it.

Read 4
  • getInsightReads one saved PostHog insight, including its definition and latest result.

    Arguments

    NameTypeRequired
    argsPostHogInsightArgsYes
    interface PostHogProjectArgs { projectId: number; }
    
    interface PostHogInsightArgs extends PostHogProjectArgs { insightId: number; }

    Returns PostHogInsight

    interface PostHogInsight { id: number; short_id?: string; name?: string; [key: string]: unknown; }

    HTTP endpoint

    POST https://api.bowmark.ai/v1/sites/posthog/getInsight

    Call it

    import { bowmark } from "@bowmark/web";
    
    const result = await bowmark.providers.posthog.getInsight({ projectId: 1, insightId: 1 });
  • listInsightsLists saved insights in one caller-selected PostHog project.

    Arguments

    NameTypeRequired
    projectIdnumberYes

    Returns PostHogPage<PostHogInsight>

    interface PostHogInsight { id: number; short_id?: string; name?: string; [key: string]: unknown; }
    
    interface PostHogPage<T> { results: T[]; next: string | null; previous: string | null; [key: string]: unknown; }

    HTTP endpoint

    POST https://api.bowmark.ai/v1/sites/posthog/listInsights

    Call it

    import { bowmark } from "@bowmark/web";
    
    const result = await bowmark.providers.posthog.listInsights({ projectId: 1 });
  • listProjectsLists projects the caller can access in their PostHog account.

    Arguments

    None.

    Returns PostHogPage<PostHogProject>

    interface PostHogProject { id: number; name: string; [key: string]: unknown; }
    
    interface PostHogPage<T> { results: T[]; next: string | null; previous: string | null; [key: string]: unknown; }

    HTTP endpoint

    POST https://api.bowmark.ai/v1/sites/posthog/listProjects

    Call it

    import { bowmark } from "@bowmark/web";
    
    const result = await bowmark.providers.posthog.listProjects();
  • runRetentionQueryRuns a caller-supplied PostHog RetentionQuery without saving or changing it.

    Arguments

    NameTypeRequired
    argsPostHogRetentionQueryArgsYes
    interface PostHogProjectArgs { projectId: number; }
    
    interface PostHogRetentionQueryArgs extends PostHogProjectArgs { query: Record<string, unknown>; name?: string; }

    Returns Record<string, unknown>

    HTTP endpoint

    POST https://api.bowmark.ai/v1/sites/posthog/runRetentionQuery

    Call it

    import { bowmark } from "@bowmark/web";
    
    const result = await bowmark.providers.posthog.runRetentionQuery({
      projectId: 1,
      query: { kind: "RetentionQuery", retentionFilter: {} }
    });

Use it from code