Skip to content
Go back

Master Your Data with PostHog MCP Server Insights

Updated:

You know that feeling when you need to dig into your analytics data but switching between tabs and clicking through dashboards feels like running through mud? PostHog’s MCP (Model Context Protocol) server changes that game completely.

Think of it this way: instead of being a human clicking buttons, you get to ask questions in plain English and get real answers. “How many visitors did we have last month?” “Which pages are people bouncing from?” “Show me our mobile vs desktop split.” The MCP server handles the heavy lifting.

Why build your own PostHog MCP server?

PostHog already has a first-party MCP server running at https://mcp.posthog.com/sse. But here’s the catch - if you’re on PostHog EU cloud, you can’t use it. You’ll need to run it locally or host it yourself.

Table of contents

Open Table of contents

What can this thing actually do?

The PostHog MCP server comes packed with 27 different tools across 7 categories. Let me break down what you’re getting:

Feature flags (5 tools)

Tool NameDescriptionParameters
feature-flag-get-definitionGet the definition of a feature flag by ID or keyflagId (optional), flagKey (optional)
feature-flag-get-allGet all feature flags in the projectNone
create-feature-flagCreates a new feature flag with guidance for codebase integrationname, key, description, filters, active, tags (optional)
update-feature-flagUpdate feature flag properties (enable/disable, modify filters)flagKey, data (name, description, filters, active, tags)
delete-feature-flagDelete a feature flag from the projectflagKey

Insights (6 tools)

Tool NameDescriptionParameters
insights-get-allList all insights with optional filtering by saved/favourited statusdata (limit, offset, saved, favourited, search - all optional)
insight-getGet a specific insight by IDinsightId (number)
insight-create-from-querySave a HogQL query as an insight (DataVisualizationNode format)data (name, query, description, saved, favourited, tags)
insight-updateUpdate existing insight propertiesinsightId, data (name, description, filters, query, saved, favourited, dashboard, tags)
insight-deleteSoft delete an insightinsightId (number)
get-sql-insightQuery data warehouse with natural language, returns SQL and resultsquery (natural language string, max 1000 chars)

Dashboards (6 tools)

Tool NameDescriptionParameters
dashboards-get-allList all dashboards with optional filteringdata (limit, offset, search, pinned - all optional)
dashboard-getGet a specific dashboard by IDdashboardId (number)
dashboard-createCreate a new dashboarddata (name required, description, pinned, tags optional)
dashboard-updateUpdate dashboard propertiesdashboardId, data (name, description, pinned, tags)
dashboard-deleteSoft delete a dashboarddashboardId (number)
add-insight-to-dashboardAdd an existing insight to a dashboarddata (insightId, dashboardId - both required)

Organisations (3 tools)

Tool NameDescriptionParameters
organizations-getGet all organisations the user has access toNone
organization-set-activeSet the active organisation contextorgId (UUID)
organization-details-getGet details of the active organisationNone

Projects (3 tools)

Tool NameDescriptionParameters
projects-getList all projects user has access to (use before other tools)None
project-set-activeSet the active project contextprojectId (positive integer)
property-definitionsGet property definitions for the active projectNone

Error tracking (2 tools)

Tool NameDescriptionParameters
list-errorsList errors in the project with filtering optionsorderBy, dateFrom, dateTo, orderDirection, filterTestAccounts, status
error-detailsGet detailed information about a specific errorissueId (UUID), dateFrom (optional), dateTo (optional)

Documentation (1 tool)

Tool NameDescriptionParameters
docs-searchSearch PostHog documentation (fallback when other tools can’t help)query (string)

LLM observability (1 tool)

Tool NameDescriptionParameters
get-llm-total-costs-for-projectGet LLM usage costs by model over time, formatted as markdown tableprojectId (positive integer), days (optional, defaults to 7)

Deploying on Cloudflare Workers

Cloudflare makes this stupidly easy. During their MCP Demo Day, companies like Atlassian, Asana, Webflow, Linear, Sentry, PayPal, Stripe, and Intercom all built their MCP servers on Cloudflare. There’s a reason for that.

Here’s the step-by-step (and yes, it really is this simple):

That’s it. You now have your own PostHog MCP server running in the cloud.

For the full details on remote MCP servers, check out Cloudflare’s guide. And if you need more info on environment variables, they’ve got you covered.

What’s this going to cost me?

Probably nothing. Cloudflare’s free plan gives you 100,000 requests per day or 1,000 requests per minute. Unless you’re planning to interrogate your data every few seconds, you’re good.

Check out their pricing page if you want the full breakdown, but for most teams, free is plenty.

Connecting to your PostHog MCP server

Once your worker is deployed, you’ll get a URL like ‘https://posthog-mcp.xxxxxx-xxx.workers.dev’. Plug that into any MCP client:

Want more options? PulseMCP has a huge list of clients.

Quick note on auth: PostHog doesn’t have OAuth support yet, but you can create an API key easily. Just go to your user API keys page and use the ‘MCP Server’ preset. It gives you read access to everything and write access to feature flags.

Additional notes

PostHog keeps their OpenAPI schema up to date, but it doesn’t cover every endpoint (like the MaxAI tools). The MCP tools aren’t exposed via OpenAPI either - you explore them through the standard MCP endpoint.

If you need current Cloudflare docs, they run their own documentation server at https://docs.mcp.cloudflare.com/sse that any MCP client can access in real-time.

Getting started: questions to ask

Once you’re connected, start having conversations with your data:

PostHog MCP Server in action

Resources

The best part? You’re not just getting answers - you’re having actual conversations with your data. No more hunting through dashboards or waiting for someone else to run reports. Just ask what you want to know, and get answers that help you make better decisions.

“We are on-track to deliver a 43% increase in inbound leads this year. There is no doubt the adoption of Growth Method is the primary driver behind these results.”

Laura Perrott, Colt Technology Services

Growth Method is the GrowthOS built for marketing teams focused on pipeline — not projects. Book a call at https://cal.com/stuartb/30min.


Back to top ↑