Skip to content

feat: setup mcp server automatically on install#48

Merged
joshsny merged 10 commits into
mainfrom
setup-mcp-server
Jun 2, 2025
Merged

feat: setup mcp server automatically on install#48
joshsny merged 10 commits into
mainfrom
setup-mcp-server

Conversation

@joshsny
Copy link
Copy Markdown
Collaborator

@joshsny joshsny commented May 26, 2025

This adds support on the wizard for setting up the PostHog MCP server after an install happens.

If the /wizard/data endpoint returns a personal API key than we will use that to setup the MCP clients on the users computer by adding the MCP server to their application config.

It adds support for Claude Desktop and Cursor as MCP clients.

This also adds two new commands npx @posthog/wizard mcp add and npx @posthog/wizard mcp remove for dealing with mcp servers only.

@joshsny joshsny requested review from a team and daniloc May 26, 2025 13:02
Comment thread src/mcp.ts

Get started with some prompts like:

- What feature flags do I have active?
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Copy link
Copy Markdown
Collaborator

@daniloc daniloc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very, very cool!

one thought:

Would it be valuable to extract ALL the configuration paths here into a separate file? as is they're kind of buried in the code and I suspect we should prepare for them to change from time to time, given the state of flux we're in. then we could audit them all at a glance.

@joshsny
Copy link
Copy Markdown
Collaborator Author

joshsny commented Jun 2, 2025

Very, very cool!

one thought:

Would it be valuable to extract ALL the configuration paths here into a separate file? as is they're kind of buried in the code and I suspect we should prepare for them to change from time to time, given the state of flux we're in. then we could audit them all at a glance.

So right now all of these clients have different ways of adding servers, some use yaml files, others use different configs etc.

Probably makes sense to standardize this as it coalesces into a standard format.

@joshsny
Copy link
Copy Markdown
Collaborator Author

joshsny commented Jun 2, 2025

@daniloc I've moved the API key stuff to be more explicit since it feels off to create a broadly scoped API key for the user without them doing it themselves. Will ship this flow and we can start testing it and see what the feedback is...

@joshsny joshsny merged commit 0b6b0b5 into main Jun 2, 2025
6 checks passed
@joshsny joshsny mentioned this pull request Jun 2, 2025
daniloc pushed a commit that referenced this pull request Oct 27, 2025
* feat: add mcp client support, add cursor client

* feat: automatically add mcp servers + mcp client support for cursor

* fix: remove spare arg

* feat: add client for claude desktop

* fix: import correctly

* chore: add some tests

* chore: remove testing defaults

* feat: ask for personal api keys, redirect to api key preset

* chore: add mcp setup to all frameworks

* fix: remove dead test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants