Agents and MCP

PostHog for every project, next to your search data.

PostHog has its own MCP server for working inside one project. LopeBase answers a different question: how are all my products doing, and why. Connect each PostHog project once, and your agent can read retention, funnels, goal events, and traffic beside Search Console, GA4, and the rest.

A personal API key with read access. Pick which projects LopeBase reads.

Ask across projects and tools

LopeBase runs one read-only query per dataset in PostHog and hands your agent a small table.

agent · PostHog, acme

Are people from this spring's signups still coming back?

read_sourceposthog-acmeretention

cohortnewweek 1week 2week 4
Mar 341217112897
Mar 1038816011788
Mar 1750618913174
Mar 24451202149109

Week 4 return held near a quarter for every cohort but Mar 17, the launch week, which brought more people who did not stay. The Mar 24 cohort is your best yet.

Funnels from event names

Pass 2 to 6 events in order and get how many people reached each step in the last 28 days.

Weekly retention

New people per week and how many came back in weeks 1, 2, and 4.

Many projects, one agent

Each PostHog project is its own connection, alongside your other tools.

What your agent can read

Nine datasets per project. Agents never get person profiles or raw events.

  • web_analyticsPageviews for 7 and 28 days, weekly and monthly active users.pageviews_7d · pageviews_28d · wau · mau
  • daily_pageviewsPageviews and visitors per day.day · pageviews · visitors
  • top_pathsThe most viewed pages.url · views · visitors
  • goal_eventsEvents that may count as a conversion, now and in the 28 days before.event · people_28d · people_prev_28d · people_7d · with_visit
  • traffic_sourcesVisitors per channel. Add { goal } for conversions.source · visitors · sessions · converters
  • landing_pagesVisitors per entry page with bounce rate. Add { goal } for conversions.path · visitors · converters · bounce_rate
  • devicesVisitors per device. Add { goal } for conversions.device · visitors · converters
  • retentionWeekly cohorts of new people and how many came back.cohort · new_people · week1 · week2 · week4
  • funnelPeople at each step of an ordered funnel. Pass { steps: [...] }.step · event · people

Workflows worth stealing

The cross-project and cross-tool questions are where this earns its place.

Find where the funnel breaks

Build the funnel pageview, signup_started, signup_completed, first_invoice and tell me the worst step.

The agent picks the step and can open the code behind it.

funnelgoal_events

Compare retention across products

Which of my products keeps new people best at week 4?

One ask across every PostHog project you connected.

retention

Tie search to activation

Do visitors from organic search activate as well as direct visitors?

Pass your activation event as the goal.

traffic_sources

Catch a broken event

Did any goal event fall to near zero in the last 7 days?

Usually a renamed or removed capture call.

goal_events

Set it up in a few minutes

  1. 01

    Connect PostHog. Create a personal API key in PostHog with read access, paste it into LopeBase, and choose which projects to read.

  2. 02

    In a terminal agent, run npx lopebase in a project folder. It signs you in and adds LopeBase to Claude Code, Codex, Gemini CLI, opencode, or Cursor Agent.

  3. 03

    In a chat app or editor, add the remote MCP server https://app.lopebase.com/api/mcp and sign in when it asks. Any client that supports remote MCP servers with sign-in works.

US and EU cloud and your own PostHog host all work.

Good to know

  • Fixed windowsBreakdowns and funnels cover the last 28 days.
  • No raw events or peopleAgents get aggregates only. Session replays and person profiles stay in PostHog.
  • Use both if you likePostHog's own MCP server suits working inside one project, like editing flags. LopeBase is for reading across projects and tools.
  • One token, one workspaceAn agent's token only reads the workspace that issued it.

PostHog MCP questions

Something else? Email us.

Should I use this or PostHog's own MCP server?

Use PostHog's for deep work in one project, like feature flags. Use LopeBase when you want every project together with Search Console, GA4, Stripe, and uptime. They work side by side.

What key does LopeBase need?

A personal API key with read access to the projects you choose.

Can my agent run any HogQL query?

No. LopeBase runs its own fixed read-only queries and returns the results. Event names you pass are checked before they reach a query.

Does it work with EU cloud or self-hosted PostHog?

Yes. Choose your host when you connect.

Read every PostHog project from your agent.

Free for one product. No card. Agent access is on every plan.