Skip to content

Commit 6e8cd31

Browse files
authored
Include current working directory in local MCP transport (anomalyco#6303)
1 parent 5bfffbe commit 6e8cd31

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/opencode/src/mcp/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,12 @@ export namespace MCP {
308308

309309
if (mcp.type === "local") {
310310
const [cmd, ...args] = mcp.command
311+
const cwd = Instance.directory
311312
const transport = new StdioClientTransport({
312313
stderr: "ignore",
313314
command: cmd,
314315
args,
316+
cwd,
315317
env: {
316318
...process.env,
317319
...(cmd === "opencode" ? { BUN_BE_BUN: "1" } : {}),
@@ -334,6 +336,7 @@ export namespace MCP {
334336
log.error("local mcp startup failed", {
335337
key,
336338
command: mcp.command,
339+
cwd,
337340
error: error instanceof Error ? error.message : String(error),
338341
})
339342
status = {

0 commit comments

Comments
 (0)