posthog-mcp
Allows listing projects, creating annotations with optional timestamps, getting and searching insights, and searching documentation online via PostHog's API.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@posthog-mcp List my PostHog projects"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PostHog MCP Server 📊
A Model Context Protocol (MCP) server for interacting with PostHog. Create annotations and manage projects directly through Claude Desktop!
Features 🚀
List Projects: View all available PostHog projects in your organization
Create Annotations: Add annotations to your PostHog projects with optional timestamps [this list can be much longer, anything our api has basically...]
Related MCP server: PostHog MCP Server
Setup 🛠️
Prerequisites
Python 3.10 or higher
uvpackage managerPostHog API Key with
annotation:writeandproject:readscopes obtained from your project settings
Installation
# clone the repo git clone git@github.com:PostHog/posthog-mcp.git # or if https, use: git clone https://github.com/PostHog/posthog-mcp.git cd posthog-mcp uv venv source .venv/bin/activate # Install dependencies uv pip install .Configuration
Create a
.envfile in the project root:PERSONAL_API_KEY=phx_your_posthog_api_key_here
Claude Desktop Setup
Install Claude Desktop
Open Claude Desktop settings and click "Edit Config". Alternatively, you can open the file from:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Add this to your
claude_desktop_config.json(adjust paths according to your system):{ "mcpServers": { "posthog": { "command": "/path/to/uv", # Get this by running: which uv "args": [ "--directory", "/path/to/your/posthog-mcp", # Full path to this project "run", "posthog_mcp" ] } } }Check the latest documentation on setting up Claude Desktop as MCP client if you ran into any issues.
Usage 💡
After setup, you'll see a hammer 🔨 icon in Claude Desktop. The following commands are available:
List Projects
Ask Claude:
"List my PostHog projects"Get and Search for Insights
Ask Claude:
"List my PostHog insights" or "Search for revenue insights in my PostHog"
Search for documentations online
You can ask:
"how can i do reverse proxy in nextjs in posthog?"
Create Annotation
Using the Project ID you get from the list of projects, ask Claude:
"Create a PostHog annotation in project 53497 saying 'Deployed v1.2.3'"
or with a specific date:
"Create a PostHog annotation in project 53497 for March 20th saying 'Started new marketing campaign'"Troubleshooting 🔍
If the hammer icon doesn't appear, restart Claude Desktop
Check logs at
~/Library/Logs/Claude/mcp*.log(macOS) or%APPDATA%\Claude\logs(Windows)Verify your PostHog API key has the correct permissions
Make sure all paths in
claude_desktop_config.jsonare absolute paths
Contributing 🤝
Feel free to open issues and PRs! We follow PostHog's contribution guidelines.
Available Tools
5 toolscreate_posthog_annotationB
Create a PostHog annotation.
Args: project_id: The ID of the project as an integer (e.g. 99423) content: The content/text of the annotation date_marker: Optional ISO-8601 timestamp for the annotation (e.g. 2024-03-20T14:15:22Z)
Inputs: project_id (required), content (required), date_marker.
get_posthog_insight_detailsA
Get details for a specific PostHog insight.
Args: project_id: The ID of the project as an integer (e.g. 99423) insight_id: The ID of the insight as an integer (e.g. 12345)
Inputs: project_id (required), insight_id (required).
list_posthog_insightsB
List all available PostHog insights for a project.
Args: project_id: The ID of the project as an integer (e.g. 99423) search: Optional search query to filter insights
Inputs: project_id (required), search.
list_posthog_projectsA
List all available PostHog projects.
Inputs: no named parameters.
search_posthog_insightsB
Search for PostHog insights by name.
Args: project_id: The ID of the project as an integer (e.g. 99423) search: The search query to filter insights by name
Inputs: project_id (required), search (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Tools are mostly distinct. However, list_posthog_insights and search_posthog_insights have overlapping functionality since list already supports a search filter, which could cause confusion.
All tools follow a consistent verb_posthog_noun pattern in snake_case, making them predictable and easy to understand.
5 tools is on the low side for a platform like PostHog which has many resources. The server feels undersized for its stated purpose.
Missing key CRUD operations: annotations lack read, update, delete; insights lack create, update, delete; projects only have list. Significant gaps in coverage.
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)
Manage Redbooth tasks, task lists, comments, tags and files from Claude and other AI assistants.
Query your Logspot analytics, companies, and revenue from any AI assistant, and run your actions.
Related MCP Servers
AlicenseNot gradedqualityNot gradedmaintenanceA Model Context Protocol server that enables Claude Desktop users to interact directly with PostHog, allowing them to view projects and create annotations through natural language commands.10MIT- AlicenseNot gradedqualityNot gradedmaintenanceA server that allows users to interact with PostHog analytics platform through Claude Desktop, enabling listing projects, creating annotations, searching insights, and accessing documentation.1MIT
- 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
- AlicenseNot gradedqualityDmaintenanceEnables interaction with PostHog product analytics API, supporting project listing, event queries, insight analysis, feature flag management, and annotation creation.MIT