Skip to content

Commit b993cc5

Browse files
mfuntowiczjulien-c
andauthored
fix(mcp): use a more generic folder to put mcp filesystem root (#1413)
Currently the MCP server attempts to access a folder under `${HOMEDIR}/Desktop` which is not portable accross different OSes. This PR proposes to change the `Desktop` part to `.mcp` which is OS agnostic and ensure the folder exists when spawning. --------- Co-authored-by: Julien Chaumond <[email protected]>
1 parent 4ca8ab4 commit b993cc5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/mcp-client/cli.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ import { version as packageVersion } from "./package.json";
1212
const MODEL_ID = process.env.MODEL_ID ?? "Qwen/Qwen2.5-72B-Instruct";
1313
const PROVIDER = (process.env.PROVIDER as InferenceProvider) ?? "nebius";
1414
const ENDPOINT_URL = process.env.ENDPOINT_URL ?? process.env.BASE_URL;
15+
const MCP_EXAMPLER_LOCAL_FOLDER = process.platform === "darwin" ? join(homedir(), "Desktop") : homedir();
1516

1617
const SERVERS: StdioServerParameters[] = [
1718
{
1819
// Filesystem "official" mcp-server with access to your Desktop
1920
command: "npx",
20-
args: ["-y", "@modelcontextprotocol/server-filesystem", join(homedir(), "Desktop")],
21+
args: ["-y", "@modelcontextprotocol/server-filesystem", MCP_EXAMPLER_LOCAL_FOLDER],
2122
},
2223
{
2324
// Playwright MCP
@@ -30,6 +31,7 @@ if (process.env.EXPERIMENTAL_HF_MCP_SERVER) {
3031
SERVERS.push({
3132
// Early version of a HF-MCP server
3233
// you can download it from gist.github.com/julien-c/0500ba922e1b38f2dc30447fb81f7dc6
34+
// and replace the local path below
3335
command: "node",
3436
args: ["--disable-warning=ExperimentalWarning", join(homedir(), "Desktop/hf-mcp/index.ts")],
3537
env: {

0 commit comments

Comments
 (0)