diff --git a/vibn-frontend/app/api/mcp/route.ts b/vibn-frontend/app/api/mcp/route.ts index 1fb3642d..bc2b1abe 100644 --- a/vibn-frontend/app/api/mcp/route.ts +++ b/vibn-frontend/app/api/mcp/route.ts @@ -5083,10 +5083,7 @@ async function toolFsList(principal: Principal, params: Record) { if (guard) return guard; const project = await resolveProjectOr404(principal, params); if (project instanceof NextResponse) return project; - const path = normalizeFsPath( - String(params.path ?? "/workspace"), - project.slug, - ); + const path = normalizeFsPath(String(params.path ?? ""), project.slug); if (path instanceof NextResponse) return path; const cmd = `cd ${shq(path)} && ls -lA --time-style=long-iso 2>&1 | head -200`; const r = await runFsCmd(principal, project, cmd); @@ -5133,7 +5130,7 @@ async function toolFsGlob(principal: Principal, params: Record) { { status: 400 }, ); } - const cwd = normalizeFsPath(String(params.cwd ?? "/workspace"), project.slug); + const cwd = normalizeFsPath(String(params.cwd ?? ""), project.slug); if (cwd instanceof NextResponse) return cwd; // ripgrep --files --glob is faster + smarter than `find` and respects .gitignore. const cmd = `cd ${shq(cwd)} && rg --files --glob ${shq(pattern)} | head -500`; @@ -5159,7 +5156,7 @@ async function toolFsGrep(principal: Principal, params: Record) { { status: 400 }, ); } - const cwd = normalizeFsPath(String(params.cwd ?? "/workspace"), project.slug); + const cwd = normalizeFsPath(String(params.cwd ?? ""), project.slug); if (cwd instanceof NextResponse) return cwd; const glob = typeof params.glob === "string" && params.glob.trim() @@ -6131,10 +6128,7 @@ async function toolFsTree(principal: Principal, params: Record) { if (guard) return guard; const project = await resolveProjectOr404(principal, params); if (project instanceof NextResponse) return project; - const path = normalizeFsPath( - String(params.path ?? "/workspace"), - project.slug, - ); + const path = normalizeFsPath(String(params.path ?? ""), project.slug); if (path instanceof NextResponse) return path; // Use find to generate a tree structure, ignoring node_modules and .git