---
title: "PostHog MCP server: product analytics and feature flags for agents"
description: "Install the PostHog MCP server in an Aldena project and agents query analytics with SQL, manage feature flags and experiments, and triage errors in PostHog."
url: "https://aldena.ai/mcp-servers/posthog"
---

# Let agents check PostHog before and after they ship a change

PostHog MCP server. Install the PostHog MCP server in an Aldena project and agents query analytics with SQL, manage feature flags and experiments, and triage errors in PostHog.

- **Sign-in**: Browser sign-in
- **Installs as**: `posthog`
- **Transport**: Streamable HTTP
- **Last verified**: 2026-11-28

PostHog is an open source product platform that bundles analytics, session replay, feature flags, experiments, error tracking, a data warehouse and more. Its free hosted MCP server lets an agent use PostHog through plain requests: query events with analytics queries or SQL, create and roll out feature flags, set up experiments, look into error tracking issues, manage CDP destinations and triage support tickets, acting as the person who signed in.

That breadth suits agents in an Aldena project that build and ship. An engineering agent working on a checkout change creates a feature flag, wires the check into the code in its conversation's sandbox, and opens the pull request through the [GitHub connector](https://aldena.ai/integrations/github). After the merge, it rolls the flag out to a small share of users and queries the conversion funnel over the next days, then reports whether the change helped. If the error tracker lights up, it turns the flag off, reads the stack trace, and writes the fix before rolling out again.

Each PostHog tool has its own row in the project's [permissions](https://aldena.ai/features/human-in-the-loop), so changing a flag's rollout can wait for approval. For analytics alongside other tools, see the [Amplitude MCP server](https://aldena.ai/mcp-servers/amplitude), and for deeper error triage the [Sentry MCP server](https://aldena.ai/mcp-servers/sentry).

## With PostHog, your agents can

- Run analytics queries and SQL over your PostHog events
- Create, roll out and turn off feature flags
- Set up experiments and read their results
- Look into error tracking issues and their stack traces
- Manage CDP destinations and triage support tickets

## Try asking

- “Create a PostHog feature flag called new-checkout, roll it out to 10% of users in Germany, and add the flag check to the checkout page in a branch.”
- “Query PostHog for the signup funnel over the last 14 days and tell me which step lost the most users after Tuesday's release.”
- “Look at the top PostHog error tracking issue from today, find the line that throws in our repo, and propose a fix.”

## Server

- **Server URL**: `https://mcp.posthog.com/mcp`
- **Website**: [posthog.com](https://posthog.com)
- **MCP docs**: [PostHog MCP docs](https://posthog.com/docs/model-context-protocol)

## How to connect PostHog

1. **Open Marketplace.** In a project, open Settings → Connectors → MCP servers and press Marketplace.
2. **Install PostHog.** Search for PostHog and press Install. Aldena adds it as `posthog`.
3. **Sign in to PostHog.** Open the sign-in link Aldena shows and approve. The server then acts as you.
4. **Let agents use it.** Agents find its tools with `mcp_search` and call them with `mcp_call`. Each tool gets its own row in the project's permissions.

## Related MCP servers

- [Amplitude MCP server](https://aldena.ai/mcp-servers/amplitude): Query product analytics events, charts, and cohorts.
- [Postman MCP server](https://aldena.ai/mcp-servers/postman): Work with collections, environments, and API specs.
- [Prisma MCP server](https://aldena.ai/mcp-servers/prisma): Manage Prisma Postgres databases and schema.
- [SearchApi MCP server](https://aldena.ai/mcp-servers/searchapi): Run Google, YouTube, and other engine searches.
- [All MCP servers](https://aldena.ai/mcp-servers)

## FAQ

### Does the PostHog MCP server cost extra?

Connecting to PostHog's hosted server and calling its tools is free. Some tools use an LLM internally and can be billed as PostHog AI spend, and those are only available when AI data processing is enabled for your organization. The rest of your PostHog usage is billed as usual.

### Does PostHog's MCP server work for EU accounts?

Yes, with the same URL. PostHog's sign-in routes you to the US or EU data region based on the account you log in with, so the marketplace install works for both. The tools then act as you, in the project and organization you have access to.

### How do flags and experiments fit an agent's coding work?

An agent building a risky change can ship it behind a PostHog flag it creates, roll it out to a small share of users, and read the results before going wider. If errors climb, it turns the flag off and says so in the chat, so the release is reversible without a deploy.
