What is PostHog MCP server for managing model context protocols.?
PostHog MCP is a server that allows users to manage model context protocols. It supports multiple language implementations and provides a quick installation method via npx. Users can configure the server for both EU cloud and self-hosted instances, and it includes tools for inspecting MCP tool call results.
Documentation
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 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
If you're using PostHog EU cloud or a self-hosted instance, you can specify a custom base URL by adding the POSTHOG_BASE_URLenvironment 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 dev
And replace https://mcp.posthog.com/sse with http://localhost:8787/sse in the MCP configuration.
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 server
pnpm run schema:build:json - Generate JSON schema for other language implementations
pnpm run lint:fix - Format and lint code
Environment variables
Create .dev.vars in the root
Add Inkeep API key to enable docs-search tool (see Inkeep 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.