Просмотр исходного кода

Include current working directory in local MCP transport (#6303)

Daniel Polito 1 месяц назад
Родитель
Сommit
6e8cd3174c
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      packages/opencode/src/mcp/index.ts

+ 3 - 0
packages/opencode/src/mcp/index.ts

@@ -308,10 +308,12 @@ export namespace MCP {
 
     if (mcp.type === "local") {
       const [cmd, ...args] = mcp.command
+      const cwd = Instance.directory
       const transport = new StdioClientTransport({
         stderr: "ignore",
         command: cmd,
         args,
+        cwd,
         env: {
           ...process.env,
           ...(cmd === "opencode" ? { BUN_BE_BUN: "1" } : {}),
@@ -334,6 +336,7 @@ export namespace MCP {
         log.error("local mcp startup failed", {
           key,
           command: mcp.command,
+          cwd,
           error: error instanceof Error ? error.message : String(error),
         })
         status = {