Official PostHog MCP Server 🦔
- • Core MCP protocol features implemented (24/40)
- • GitHub community is not mature yet (14/20)
- • Optimal dependency management (20/20)
- • Moderate deployment maturity (5/10)
- • Documentation (8/8)
- • Archestra MCP Trust score badge is missing
{
"posthog-mcp-dev": {
"command": "pnpm",
"args": [
"run",
"dev"
],
"env": {
"POSTHOG_BASE_URL": "https://eu.posthog.com",
"INKEEP_API_KEY": "..."
}
}
}PostHog MCP
Documentation: https://posthog.com/docs/model-context-protocol
Use the MCP Server
Quick install
You can install the MCP server automatically into Cursor, Claude, Claude Code, VS Code and Zed by running the following command:
npx @posthog/wizard@latest mcp add
Manual 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/mcp", // You can replace this with https://mcp.posthog.com/sse if your client does not support Streamable HTTP
"--header",
"Authorization:${POSTHOG_AUTH_HEADER}"
],
"env": {
"POSTHOG_AUTH_HEADER": "Bearer {INSERT_YOUR_PERSONAL_API_KEY_HERE}"
}
}
}
}
Docker install
If you prefer to use Docker instead of running npx directly:
- Build the Docker image:
pnpm docker:build
# or
docker build -t posthog-mcp .
- Configure your MCP client with Docker:
{
"mcpServers": {
"posthog": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--env",
"POSTHOG_AUTH_HEADER=${POSTHOG_AUTH_HEADER}",
"--env",
"POSTHOG_REMOTE_MCP_URL=${POSTHOG_REMOTE_MCP_URL:-https://mcp.posthog.com/mcp}",
"posthog-mcp"
],
"env": {
"POSTHOG_AUTH_HEADER": "Bearer {INSERT_YOUR_PERSONAL_API_KEY_HERE}",
"POSTHOG_REMOTE_MCP_URL": "https://mcp.posthog.com/mcp"
}
}
}
}
- Test Docker with MCP Inspector:
pnpm docker:inspector
# or
npx @modelcontextprotocol/inspector docker run -i --rm --env POSTHOG_AUTH_HEADER=${POSTHOG_AUTH_HEADER} posthog-mcp
Environment Variables:
POSTHOG_AUTH_HEADER: Your PostHog API token (required)POSTHOG_REMOTE_MCP_URL: The MCP server URL (optional, defaults tohttps://mcp.posthog.com/mcp)
This approach allows you to use the PostHog MCP server without needing Node.js or npm installed locally.
Example Prompts
- What feature flags do I have active?
- Add a new feature flag for our homepage redesign
- What are my most common errors?
- Show me my LLM costs this week
Feature Filtering
You can limit which tools are available by adding query parameters to the MCP URL:
https://mcp.posthog.com/mcp?features=flags,workspace
Available features:
workspace- Organization and project managementerror-tracking- Error monitoring and debuggingdashboards- Dashboard creation and managementinsights- Analytics insights and SQL queriesexperiments- A/B testing experimentsflags- Feature flag managementllm-analytics- LLM usage and cost trackingdocs- PostHog documentation search
To view which tools are available per feature, see our documentation or alternatively check out schema/tool-definitions.json,
Data processing
The MCP server is hosted on a Cloudflare worker which can be located outside of the EU / US, for this reason the MCP server does not store any sensitive data outside of your cloud region.
Using self-hosted instances
If you're using a self-hosted instance of PostHog, 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://posthog.example.com
Development
To run the MCP server locally, run the following command:
pnpm run dev
And replace https://mcp.posthog.com/mcp with http://localhost:8787/mcp in the MCP configuration.
Project Structure
This repository is organized to support multiple language implementations:
typescript/- TypeScript implementation of the MCP server & toolsschema/- Shared schema files generated from TypeScript
Development Commands
pnpm run dev- Start development serverpnpm run schema:build:json- Generate JSON schema for other language implementationspnpm run lint && pnpm run format- Format and lint code
Adding New Tools
See the tools documentation for a guide on adding new tools to the MCP server.
Environment variables
- Create
.dev.varsin the root - Add 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/mcp --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:
npx
Arguments:
-y mcp-remote@latest http://localhost:8787/mcp --header "Authorization: Bearer {INSERT_YOUR_PERSONAL_API_KEY_HERE}"
[](https://archestra.ai/mcp-catalog/posthog__mcp)PostHog MCP
Documentation: https://posthog.com/docs/model-context-protocol
Use the MCP Server
Quick install
You can install the MCP server automatically into Cursor, Claude, Claude Code, VS Code and Zed by running the following command:
npx @posthog/wizard@latest mcp add
Manual 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/mcp", // You can replace this with https://mcp.posthog.com/sse if your client does not support Streamable HTTP
"--header",
"Authorization:${POSTHOG_AUTH_HEADER}"
],
"env": {
"POSTHOG_AUTH_HEADER": "Bearer {INSERT_YOUR_PERSONAL_API_KEY_HERE}"
}
}
}
}
Docker install
If you prefer to use Docker instead of running npx directly:
- Build the Docker image:
pnpm docker:build
# or
docker build -t posthog-mcp .
- Configure your MCP client with Docker:
{
"mcpServers": {
"posthog": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--env",
"POSTHOG_AUTH_HEADER=${POSTHOG_AUTH_HEADER}",
"--env",
"POSTHOG_REMOTE_MCP_URL=${POSTHOG_REMOTE_MCP_URL:-https://mcp.posthog.com/mcp}",
"posthog-mcp"
],
"env": {
"POSTHOG_AUTH_HEADER": "Bearer {INSERT_YOUR_PERSONAL_API_KEY_HERE}",
"POSTHOG_REMOTE_MCP_URL": "https://mcp.posthog.com/mcp"
}
}
}
}
- Test Docker with MCP Inspector:
pnpm docker:inspector
# or
npx @modelcontextprotocol/inspector docker run -i --rm --env POSTHOG_AUTH_HEADER=${POSTHOG_AUTH_HEADER} posthog-mcp
Environment Variables:
POSTHOG_AUTH_HEADER: Your PostHog API token (required)POSTHOG_REMOTE_MCP_URL: The MCP server URL (optional, defaults tohttps://mcp.posthog.com/mcp)
This approach allows you to use the PostHog MCP server without needing Node.js or npm installed locally.
Example Prompts
- What feature flags do I have active?
- Add a new feature flag for our homepage redesign
- What are my most common errors?
- Show me my LLM costs this week
Feature Filtering
You can limit which tools are available by adding query parameters to the MCP URL:
https://mcp.posthog.com/mcp?features=flags,workspace
Available features:
workspace- Organization and project managementerror-tracking- Error monitoring and debuggingdashboards- Dashboard creation and managementinsights- Analytics insights and SQL queriesexperiments- A/B testing experimentsflags- Feature flag managementllm-analytics- LLM usage and cost trackingdocs- PostHog documentation search
To view which tools are available per feature, see our documentation or alternatively check out schema/tool-definitions.json,
Data processing
The MCP server is hosted on a Cloudflare worker which can be located outside of the EU / US, for this reason the MCP server does not store any sensitive data outside of your cloud region.
Using self-hosted instances
If you're using a self-hosted instance of PostHog, 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://posthog.example.com
Development
To run the MCP server locally, run the following command:
pnpm run dev
And replace https://mcp.posthog.com/mcp with http://localhost:8787/mcp in the MCP configuration.
Project Structure
This repository is organized to support multiple language implementations:
typescript/- TypeScript implementation of the MCP server & toolsschema/- Shared schema files generated from TypeScript
Development Commands
pnpm run dev- Start development serverpnpm run schema:build:json- Generate JSON schema for other language implementationspnpm run lint && pnpm run format- Format and lint code
Adding New Tools
See the tools documentation for a guide on adding new tools to the MCP server.
Environment variables
- Create
.dev.varsin the root - Add 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/mcp --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:
npx
Arguments:
-y mcp-remote@latest http://localhost:8787/mcp --header "Authorization: Bearer {INSERT_YOUR_PERSONAL_API_KEY_HERE}"
Related MCP Servers
Agent-MCP
89/100Agent-MCP is a framework for creating multi-agent systems that enables coordinated, efficient AI collaboration through the Model Context Protocol (MCP). The system is designed for developers building AI applications that benefit from multiple specialized agents working in parallel on different aspects of a project.
serena
85/100A powerful coding agent toolkit providing semantic retrieval and editing capabilities (MCP server & other integrations)
JFrog MCP Server
85/100Official JFrog MCP server that enables AI assistants to interact with the JFrog Platform. Supports repository management, build tracking, runtime monitoring, artifact searching, package intelligence, and Xray security scanning.
context7
82/100Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
gk-cli
81/100GitKraken CLI Releases and Documentation
Excalidraw
80/100Remote MCP server for Excalidraw - streams hand-drawn diagrams with smooth viewport camera control and interactive fullscreen editing
