-
Notifications
You must be signed in to change notification settings - Fork 558
fix(mcp): use a more generic folder to put mcp filesystem root #1413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d2339cd to
e471fcb
Compare
Wauplin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 about not defaulting to ~/Desktop but not sure ~/.mcp is really relevant either (it would only be able to work on new files, not existing ones).
Another possibility is to default to ~/.mcp and make it a optional parameter of the CLI.
packages/mcp-client/cli.ts
Outdated
| // Filesystem "official" mcp-server with access to your Desktop | ||
| command: "npx", | ||
| args: ["-y", "@modelcontextprotocol/server-filesystem", join(homedir(), "Desktop")], | ||
| args: ["-y", "@modelcontextprotocol/server-filesystem", MCP_LOCAL_FOLDER], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would rather still use Desktop on mac OS and just homedir() on Win32, can you switch to this?
You can use process.platform === "darwin" to figure out
Thanks!
packages/mcp-client/cli.ts
Outdated
| if (!existsSync(MCP_LOCAL_FOLDER)) { | ||
| mkdirSync(MCP_LOCAL_FOLDER); | ||
| console.info("created folder", MCP_LOCAL_FOLDER); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note (unimportant given we'll not need that code) you're inside an async block so you can use the promise-based variants and just await them
|
i can finish your PR if you want @mfuntowicz? let me know |
|
I've put Happy to take a snab at it 👍🏻 |
|
yes, branching depending on OS is completely fine |
Currently the MCP server attempts to access a folder under
${HOMEDIR}/Desktopwhich is not portable accross different OSes.This PR proposes to change the
Desktoppart to.mcpwhich is OS agnostic and ensure the folder exists when spawning.