You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using call_tool_chain via the @utcp/code-mode-mcp MCP bridge, the result field in the response is always empty ({}). Data returned via return statements inside the tool chain is silently dropped. The only way to retrieve output is by using console.log(JSON.stringify(...)) and reading from the logs array.
Environment
@utcp/code-mode-mcp: 1.2.0
MCP client: Claude Desktop (claude-ai/0.1.0, protocolVersion 2025-11-25)
Node.js: v24.14.0
npm: 11.9.0
macOS (arm64)
Underlying MCP server: mcp/github via Docker (stdio transport)
Steps to Reproduce
Configure @utcp/code-mode-mcp as an MCP server in Claude Desktop with a valid .utcp_config.json
Invoke call_tool_chain with a code block that returns a value:
const{ result, logs }=awaitclient.callToolChain(` const repos = await github.search_repositories({ query: "user:example" }); return repos;`);console.log(result);// should contain the returned value
The result field should contain the return value of the executed code block.
Additional Notes
The bug appears to be in the MCP bridge layer (code-mode-mcp) specifically — the underlying @utcp/code-mode TypeScript library likely serializes result correctly, but it is lost when the MCP tool response is constructed.
Top-level await also does not work inside call_tool_chain despite documentation suggesting it should — an explicit async IIFE wrapper is required.
Related: issue Example from readme incorrect #7 notes several other discrepancies between the README examples and actual behavior.
Bug Report
Summary
When using
call_tool_chainvia the@utcp/code-mode-mcpMCP bridge, theresultfield in the response is always empty ({}). Data returned viareturnstatements inside the tool chain is silently dropped. The only way to retrieve output is by usingconsole.log(JSON.stringify(...))and reading from thelogsarray.Environment
@utcp/code-mode-mcp: 1.2.0mcp/githubvia Docker (stdio transport)Steps to Reproduce
@utcp/code-mode-mcpas an MCP server in Claude Desktop with a valid.utcp_config.jsoncall_tool_chainwith a code block that returns a value:Actual Behavior
The MCP tool response contains:
{ "success": true, "nonMcpContentResults": {}, "logs": [] }The
result/nonMcpContentResultsfield is empty. Thereturnvalue is silently discarded.Workaround
Using
console.log(JSON.stringify(result))instead ofreturn resultcauses the data to appear in thelogsarray:Response:
{ "success": true, "nonMcpContentResults": {}, "logs": ["{\"total_count\":11,\"items\":[...]}"] }Expected Behavior
Per the README documentation:
The
resultfield should contain the return value of the executed code block.Additional Notes
code-mode-mcp) specifically — the underlying@utcp/code-modeTypeScript library likely serializesresultcorrectly, but it is lost when the MCP tool response is constructed.awaitalso does not work insidecall_tool_chaindespite documentation suggesting it should — an explicit async IIFE wrapper is required.