Skip to content
Growth Method
Go back

PostHog MCP Server: Official vs Self-Hosted Setup Guide

Stuart Brameld

Stuart Brameld

Founder
Updated:
Table of contents

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/mcp, with a dedicated EU endpoint at https://mcp-eu.posthog.com/mcp for EU cloud users, so EU cloud is no longer a reason to self-host on its own.

Self-hosting still makes sense if you want to connect a self-hosted PostHog instance, prefer a static API key over OAuth, or want the server running on infrastructure you control. If you’re weighing up options, our MCP servers hub rounds up the rest of the landscape.

Official (mcp.posthog.com / mcp-eu.posthog.com)Self-hosted (Cloudflare Workers)
EU cloud supportYes, nativeYes, via self-hosting
Self-hosted PostHog supportNoYes
AuthOAuthAPI key (no OAuth needed)
Setup timeNone (already running)~5 minutes
MaintenanceNoneYou own updates and uptime
CostFreeFree on Cloudflare’s free tier for most teams

What can this thing actually do?

The tool catalogue has grown substantially since this was first written, well past the original count, and now spans many more categories. Rather than quote a number that will go stale again, check PostHog’s MCP documentation for the current list. The categories below give a flavour of what’s available.

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

About Growth Method

If you’re already deep enough into PostHog to be wiring up your own MCP server, you’re exactly the kind of team Growth Method is built for. We’re the agentic marketing platform for B2B teams: plan, launch, analyse, repeat, all in one place, for people and agents. PostHog is one of the integrations we connect to out of the box, so your campaigns are grounded in the same first-party data you’re already querying here.

Get started: first month free, no credit card required.

Frequently asked questions

Does PostHog’s official MCP server now support EU cloud? Yes. PostHog now runs its official MCP server in both US and EU regions, with mcp-eu.posthog.com serving EU cloud directly. You no longer need to self-host purely to use EU cloud.

How much does self-hosting a PostHog MCP server cost? Typically nothing. Deploying to Cloudflare Workers fits comfortably within the free tier (100,000 requests per day) for most teams.

Can I connect this to a self-hosted PostHog instance? Yes. Self-hosting your own MCP server (rather than using PostHog’s official one) is the main way to connect a self-hosted PostHog instance, since you control the base URL it points at.

How many tools does the PostHog MCP server expose? The tool count has grown substantially since this article first covered it, spanning product analytics, error tracking, experiments, data warehouse queries and more. Check PostHog’s MCP documentation for the current, authoritative list.

Do I need OAuth to use the PostHog MCP server? No. You can authenticate with a personal API key using the “MCP Server” preset instead of OAuth, on either PostHog’s official server or a self-hosted one.


Back to top ↑