> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # PostHog MCP for Windsurf Canonical URL: https://posthog.com/docs/model-context-protocol/windsurf ## On this page - [Server URL](#server-url) - [Quick install](#quick-install) - [Manual setup](#manual-setup) - [What's next](#whats-next) The PostHog [MCP server](https://modelcontextprotocol.io/introduction) enables Windsurf to directly interact with your PostHog data – managing feature flags, querying analytics, investigating errors, and more. ## Server URL `https://mcp.posthog.com/mcp` The PostHog authentication server automatically routes you to the correct data region (US or EU) based on the account you log in with. ## Quick install The [PostHog Wizard](https://github.com/PostHog/wizard) can install the MCP server directly into Windsurf: ```bash npx @posthog/wizard mcp add ``` ## Manual setup 1. Open [Windsurf](https://windsurf.com/) and navigate to **Windsurf Settings > Cascade > MCP Servers** 2. Click **Manage MCP Servers** 3. Click **View raw config** 4. Update `mcp_config.json` with the following configuration: ```json { "mcpServers": { "posthog": { "command": "npx", "args": [ "-y", "mcp-remote@latest", "https://mcp.posthog.com/mcp" ] } } } ``` When you first use the MCP server, you'll be prompted to log in to PostHog to authenticate. > Be mindful of prompt injection – LLMs can be tricked into following untrusted commands, so always review tool calls before executing them. ## What's next - **[Use cases](https://posthog.com/docs/model-context-protocol/use-cases.md)** – 20+ example prompts and multi-step recipes for the most useful MCP workflows - **[Tools reference](https://posthog.com/docs/model-context-protocol/tools.md)** – every tool the MCP server exposes, grouped by category - **[FAQ and advanced setup](https://posthog.com/docs/model-context-protocol/faq.md)** – auth, scoping, filtering, safety, and other operational details