Skip to content
Go back

Master Your Data with PostHog MCP Server Insights

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/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.

Sure, you could run it on your laptop. Or you could spend 5 minutes deploying it to Cloudflare and give your whole team access to a remote MCP server that just works.

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 Name Description Parameters
feature-flag-get-definition Get the definition of a feature flag by ID or key flagId (optional), flagKey (optional)
feature-flag-get-all Get all feature flags in the project None
create-feature-flag Creates a new feature flag with guidance for codebase integration name, key, description, filters, active, tags (optional)
update-feature-flag Update feature flag properties (enable/disable, modify filters) flagKey, data (name, description, filters, active, tags)
delete-feature-flag Delete a feature flag from the project flagKey

Insights (6 tools)

Tool Name Description Parameters
insights-get-all List all insights with optional filtering by saved/favourited status data (limit, offset, saved, favourited, search - all optional)
insight-get Get a specific insight by ID insightId (number)
insight-create-from-query Save a HogQL query as an insight (DataVisualizationNode format) data (name, query, description, saved, favourited, tags)
insight-update Update existing insight properties insightId, data (name, description, filters, query, saved, favourited, dashboard, tags)
insight-delete Soft delete an insight insightId (number)
get-sql-insight Query data warehouse with natural language, returns SQL and results query (natural language string, max 1000 chars)

Dashboards (6 tools)

Tool Name Description Parameters
dashboards-get-all List all dashboards with optional filtering data (limit, offset, search, pinned - all optional)
dashboard-get Get a specific dashboard by ID dashboardId (number)
dashboard-create Create a new dashboard data (name required, description, pinned, tags optional)
dashboard-update Update dashboard properties dashboardId, data (name, description, pinned, tags)
dashboard-delete Soft delete a dashboard dashboardId (number)
add-insight-to-dashboard Add an existing insight to a dashboard data (insightId, dashboardId - both required)

Organisations (3 tools)

Tool Name Description Parameters
organizations-get Get all organisations the user has access to None
organization-set-active Set the active organisation context orgId (UUID)
organization-details-get Get details of the active organisation None

Projects (3 tools)

Tool Name Description Parameters
projects-get List all projects user has access to (use before other tools) None
project-set-active Set the active project context projectId (positive integer)
property-definitions Get property definitions for the active project None

Error tracking (2 tools)

Tool Name Description Parameters
list-errors List errors in the project with filtering options orderBy, dateFrom, dateTo, orderDirection, filterTestAccounts, status
error-details Get detailed information about a specific error issueId (UUID), dateFrom (optional), dateTo (optional)

Documentation (1 tool)

Tool Name Description Parameters
docs-search Search PostHog documentation (fallback when other tools can’t help) query (string)

LLM observability (1 tool)

Tool Name Description Parameters
get-llm-total-costs-for-project Get LLM usage costs by model over time, formatted as markdown table projectId (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 ↑