PostHog MCP
Provides tools for interacting with PostHog, enabling AI agents to query active feature flags, create new feature flags, and inspect common errors.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
PostHog MCP
Use the MCP Server
Quick install
You can install the MCP server automatically into popular clients by running the following command:
npx @posthog/wizard@latest mcp addManual install
Obtain a personal API key using the MCP Server preset here.
Add the MCP configuration to your desktop client (e.g. Cursor, Windsurf, Claude Desktop) and add your personal API key
{
"mcpServers": {
"posthog": {
"command": "npx",
"args": [
"-y",
"mcp-remote@latest",
"https://mcp.posthog.com/sse",
"--header",
"Authorization:${POSTHOG_AUTH_HEADER}"
],
"env": {
"POSTHOG_AUTH_HEADER": "Bearer {INSERT_YOUR_PERSONAL_API_KEY_HERE}"
}
}
}
}Using EU cloud or self-hosted instances
If you're using PostHog EU cloud or a self-hosted instance, you can specify a custom base URL by adding the POSTHOG_BASE_URL environment variable when running the MCP server locally or on your own infrastructure, e.g. POSTHOG_BASE_URL=https://eu.posthog.com
Here are some examples of prompts you can use:
What feature flags do I have active?
Add a new feature flag for our homepage redesign
What are my most common errors?
Development
To run the MCP server locally, run the following command:
pnpm run devAnd replace https://mcp.posthog.com/sse with http://localhost:8787/sse in the MCP configuration.
Related MCP server: PostHog MCP
Project Structure
This repository is organized to support multiple language implementations:
typescript/- TypeScript implementation (current)python/- Python implementation (planned)schema/- Shared schema files generated from TypeScript for cross-language compatibility
Development Commands
pnpm run dev- Start development serverpnpm run schema:build:json- Generate JSON schema for other language implementationspnpm run lint:fix- Format and lint code
Environment variables
Create
.dev.varsin the rootAdd Inkeep API key to enable
docs-searchtool (seeInkeep API key - mcp)
INKEEP_API_KEY="..."Configuring the Model Context Protocol Inspector
During development you can directly inspect the MCP tool call results using the MCP Inspector.
You can run it using the following command:
npx @modelcontextprotocol/inspector npx -y mcp-remote@latest http://localhost:8787/sse --header "\"Authorization: Bearer {INSERT_YOUR_PERSONAL_API_KEY_HERE}\""Alternatively, you can use the following configuration in the MCP Inspector:
Use transport type STDIO.
Command:
npxArguments:
-y mcp-remote@latest http://localhost:8787/sse --header "Authorization: Bearer {INSERT_YOUR_PERSONAL_API_KEY_HERE}"Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Query analytics, manage feature flags and experiments, and investigate errors in PostHog.
Unofficial PostHog MCP — wraps PostHog Analytics API (app.posthog.com/api)
Hosted MCP server for RudderStack, the agentic CDP that runs on your warehouse. Ask Claude, ChatGPT, Cursor or Codex why events failed, which warehouse loads broke, or where your tracking plan is violated. Build and test transformations and audiences. OAuth login, your permissions, PII masked.
Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables interaction with PostHog analytics platform, allowing users to list projects, create annotations, and search insights through natural language in Claude Desktop.5MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables interaction with PostHog's product analytics platform through natural language, allowing users to manage feature flags, view errors, and access other platform features.1MIT
- AlicenseBqualityDmaintenanceEnables AI agents to query PostHog analytics data directly via tool calls, including insights, events, feature flags, trends, and persons.5MIT
- AlicenseAqualityFmaintenanceConnects AI assistants to PostHog to query events, persons, insights, dashboards, feature flags, cohorts, and experiments through the Model Context Protocol.1344 npmMIT