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.
- Site
- us.posthog.com
- Functions
- 4
- Sign-in
- Not needed
- Works with
- MCP, HTTP, Node, Python
Connect
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/posthogOne MCP server for PostHog and every other site Bowmark covers. Your agent looks up what it needs and calls it.
https://api.bowmark.ai/mcpSet it up in your clientBoth 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.
getInsightReads one saved PostHog insight, including its definition and latest result.Arguments
Name Type Required argsPostHogInsightArgsYes interface PostHogProjectArgs { projectId: number; } interface PostHogInsightArgs extends PostHogProjectArgs { insightId: number; }Returns
PostHogInsightinterface PostHogInsight { id: number; short_id?: string; name?: string; [key: string]: unknown; }HTTP endpoint
POST https://api.bowmark.ai/v1/sites/posthog/getInsightCall it
import { bowmark } from "@bowmark/web"; const result = await bowmark.providers.posthog.getInsight({ projectId: 1, insightId: 1 });import asyncio from bowmark_web import bowmark result = asyncio.run(bowmark.providers.posthog.getInsight({"projectId": 1, "insightId": 1}))curl -X POST https://api.bowmark.ai/v1/sites/posthog/getInsight \ -H "Authorization: Bearer $BOWMARK_API_KEY" \ -H "Content-Type: application/json" \ -d '{"args":{"projectId":1,"insightId":1}}'// The body of a run: the MCP run tool, or POST /v1/run return await bowmark.providers.posthog.getInsight({ projectId: 1, insightId: 1 });listInsightsLists saved insights in one caller-selected PostHog project.Arguments
Name Type Required 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/listInsightsCall it
import { bowmark } from "@bowmark/web"; const result = await bowmark.providers.posthog.listInsights({ projectId: 1 });import asyncio from bowmark_web import bowmark result = asyncio.run(bowmark.providers.posthog.listInsights({"projectId": 1}))curl -X POST https://api.bowmark.ai/v1/sites/posthog/listInsights \ -H "Authorization: Bearer $BOWMARK_API_KEY" \ -H "Content-Type: application/json" \ -d '{"args":{"projectId":1}}'// The body of a run: the MCP run tool, or POST /v1/run return 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/listProjectsCall it
import { bowmark } from "@bowmark/web"; const result = await bowmark.providers.posthog.listProjects();import asyncio from bowmark_web import bowmark result = asyncio.run(bowmark.providers.posthog.listProjects())curl -X POST https://api.bowmark.ai/v1/sites/posthog/listProjects \ -H "Authorization: Bearer $BOWMARK_API_KEY" \ -H "Content-Type: application/json" \ -d '{}'// The body of a run: the MCP run tool, or POST /v1/run return await bowmark.providers.posthog.listProjects();runRetentionQueryRuns a caller-supplied PostHog RetentionQuery without saving or changing it.Arguments
Name Type Required 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/runRetentionQueryCall it
import { bowmark } from "@bowmark/web"; const result = await bowmark.providers.posthog.runRetentionQuery({ projectId: 1, query: { kind: "RetentionQuery", retentionFilter: {} } });import asyncio from bowmark_web import bowmark result = asyncio.run(bowmark.providers.posthog.runRetentionQuery({ "projectId": 1, "query": {"kind": "RetentionQuery", "retentionFilter": {}} }))curl -X POST https://api.bowmark.ai/v1/sites/posthog/runRetentionQuery \ -H "Authorization: Bearer $BOWMARK_API_KEY" \ -H "Content-Type: application/json" \ -d '{"args":{"projectId":1,"query":{"kind":"RetentionQuery","retentionFilter":{}}}}'// The body of a run: the MCP run tool, or POST /v1/run return await bowmark.providers.posthog.runRetentionQuery({ projectId: 1, query: { kind: "RetentionQuery", retentionFilter: {} } });
Use it from code
- Node
npm i @bowmark/web - Python
pip install bowmark-web - HTTP
POST /v1/sites/posthog/<function> - OpenAPI
/v1/sites/posthog/openapi.json