Skip to content

Commit 29cebd7

Browse files
karta0807913chuxuan.liangrekram1-node
authored
feat(mcp log): print mcp stderr to opencode log file (#9982)
Co-authored-by: chuxuan.liang <[email protected]> Co-authored-by: Aiden Cline <[email protected]>
1 parent e4286ae commit 29cebd7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/opencode/src/mcp/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ export namespace MCP {
409409
const [cmd, ...args] = mcp.command
410410
const cwd = Instance.directory
411411
const transport = new StdioClientTransport({
412-
stderr: "ignore",
412+
stderr: "pipe",
413413
command: cmd,
414414
args,
415415
cwd,
@@ -419,6 +419,9 @@ export namespace MCP {
419419
...mcp.environment,
420420
},
421421
})
422+
transport.stderr?.on("data", (chunk: Buffer) => {
423+
log.info(`mcp stderr: ${chunk.toString()}`, { key })
424+
})
422425

423426
const connectTimeout = mcp.timeout ?? DEFAULT_TIMEOUT
424427
try {

0 commit comments

Comments
 (0)