MCP Server for Analytics

The agent-native analytics layer

Give your AI agent read access to your PostHog project. Analyze sessions, scroll depth, button clicks, and saved insights — or drop into raw HogQL when you need something custom. All through the Model Context Protocol, connected to your own PostHog workspace.

Works with Claude Code, Claude Web, OpenClaw, Claude Cowork, ChatGPT, n8n, and more.

How it works

From PostHog key to HogQL query in five steps.

1

Sign up and get an API key

Create a free account at gentic.co, generate an API key from your dashboard, and use it as a Bearer token to authenticate your agent.

2

Connect your PostHog project

In the Gentic dashboard, paste your PostHog Personal API Key, Project ID, and Host (US/EU). The key is encrypted at rest and scoped to your organization.

3

Add the MCP server to your agent

Drop https://mcp.gentic.co/analytics into Claude Code, Claude Web, OpenClaw, ChatGPT, n8n, or any MCP-compatible client. Pass your Gentic API key as a Bearer token.

4

Ask about a page or campaign

Point the agent at an entry pathname — e.g. a landing page or an ad destination. It calls posthog_analyze_sessions to compare recent vs previous period, scroll depth, and button clicks.

5

Drop into HogQL when you need more

For anything the built-in tools don't cover, the agent writes raw HogQL against events, sessions, and persons — the same dialect you'd type into PostHog's own query editor.

Available tools

5 tools your AI agent can call through the Model Context Protocol.

posthog_analyze_button_clicks

8¢ / call

Analyze button click breakdown for sessions that entered through a specific page.

posthog_analyze_sessions

10¢ / call

Analyze session metrics for a specific entry page, comparing recent vs previous period.

posthog_execute_hogql_query

10¢ / call

Execute a raw HogQL query against PostHog.

posthog_get_insights

Free

List saved PostHog insights (dashboards, funnels, trends) for the connected project.

posthog_scroll_depth_analysis

8¢ / call

Analyze scroll depth for sessions entering through a specific pathname.

Connect in seconds

Sign up, connect your PostHog project, and add the MCP server to your agent. Works with Claude Code, Claude Web, OpenClaw, Claude Cowork, ChatGPT, n8n, and any MCP client.

claude mcp add gentic-analytics \
  --transport http \
  https://mcp.gentic.co/analytics \
  --header "Authorization: Bearer YOUR_API_KEY"
OAuth
Using Claude or ChatGPT websites?

You can also connect via OAuth — just add gentic-analytics as a connector in Claude or ChatGPT settings. No API key needed; authentication is handled automatically.

Recommended
Supercharge with Agent Skills

Install the Gentic agent skill to teach your agent the optimal workflow so it gets the best results automatically.

npx skills add gentic-co/agent-skills

Works with Claude Code, Cursor, Copilot, and 40+ other agents.

Transparent per-call pricing

PostHog analytics tools are priced per call. Pricing is visible at connect time and deducted from your Gentic credits.

ToolCost
posthog_analyze_button_clicks8¢ / call
posthog_analyze_sessions10¢ / call
posthog_execute_hogql_query10¢ / call
posthog_get_insightsFree
posthog_scroll_depth_analysis8¢ / call

Pricing is pulled live from the Gentic MCP manifest so it always matches what you'll actually be charged. Connect to a PostHog project once and run as many queries as you need.

Why agent-native analytics?

PostHog is powerful. But your agent can't click through the UI — it needs typed tools, clean schemas, and a path into raw HogQL when the pre-built tools fall short. That's what this is.

No dashboards to click

Your agent describes what it wants to know — 'why did this landing page convert worse last week?' — and calls the right tool. No dashboard tours, no copy-paste from the PostHog UI.

Read-only by default

The integration only needs a read-scoped Personal API Key. Your agent cannot ingest, mutate, or delete anything in your PostHog project.

Raw HogQL escape hatch

When the pre-built tools don't cover what you need, the agent drops into posthog_execute_hogql_query and writes the exact query it wants against your events, sessions, and persons.

Composable with every MCP server

Chain PostHog data with Gentic Data, Meta ads, Research, and Influencer tools — e.g. pull session metrics for an ad's landing page and compare against ad spend from Meta.

Start analyzing in minutes

Sign up, connect PostHog, and let your agent tell you why the funnel is leaking.