feat(mcp log): print mcp stderr to opencode log file (#9982)

Co-authored-by: chuxuan.liang <chuxuan.liang@bytedance.com>
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
This commit is contained in:
karta0807913
2026-01-23 00:02:26 +08:00
committed by GitHub
parent e4286ae7a3
commit 29cebd73e5

View File

@@ -409,7 +409,7 @@ export namespace MCP {
const [cmd, ...args] = mcp.command
const cwd = Instance.directory
const transport = new StdioClientTransport({
stderr: "ignore",
stderr: "pipe",
command: cmd,
args,
cwd,
@@ -419,6 +419,9 @@ export namespace MCP {
...mcp.environment,
},
})
transport.stderr?.on("data", (chunk: Buffer) => {
log.info(`mcp stderr: ${chunk.toString()}`, { key })
})
const connectTimeout = mcp.timeout ?? DEFAULT_TIMEOUT
try {