summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDaniel Polito <[email protected]>2025-12-28 16:09:24 -0300
committerGitHub <[email protected]>2025-12-28 13:09:24 -0600
commit6e8cd3174c6e02d9c4b42086d33a4a232c812b49 (patch)
tree16e6d574da6e54fe5811eedcb77de9a568d757d0
parent5bfffbe083cf8cbd3168ca5b1168673d9252b1b9 (diff)
downloadopencode-6e8cd3174c6e02d9c4b42086d33a4a232c812b49.tar.gz
opencode-6e8cd3174c6e02d9c4b42086d33a4a232c812b49.zip
Include current working directory in local MCP transport (#6303)
-rw-r--r--packages/opencode/src/mcp/index.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/opencode/src/mcp/index.ts b/packages/opencode/src/mcp/index.ts
index 88886c4ff..8ee54a4bf 100644
--- a/packages/opencode/src/mcp/index.ts
+++ b/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 = {