-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Description
Bug Report
Summary
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/githubvia Docker (stdio transport)
Steps to Reproduce
- Configure
@utcp/code-mode-mcpas an MCP server in Claude Desktop with a valid.utcp_config.json - Invoke
call_tool_chainwith a code block that returns a value:
(async () => {
const repos = await github.github_search_repositories({ query: "user:cmtonkinson", perPage: 5 });
return repos;
})()- Inspect the MCP tool response
Actual Behavior
The MCP tool response contains:
{
"success": true,
"nonMcpContentResults": {},
"logs": []
}The result / nonMcpContentResults field is empty. The return value is silently discarded.
Workaround
Using console.log(JSON.stringify(result)) instead of return result causes the data to appear in the logs array:
(async () => {
const repos = await github.github_search_repositories({ query: "user:cmtonkinson", perPage: 5 });
console.log(JSON.stringify(repos));
})()Response:
{
"success": true,
"nonMcpContentResults": {},
"logs": ["{\"total_count\":11,\"items\":[...]}"]
}Expected Behavior
Per the README documentation:
const { result, logs } = await client.callToolChain(`
const repos = await github.search_repositories({ query: "user:example" });
return repos;
`);
console.log(result); // should contain the returned valueThe 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-modeTypeScript library likely serializesresultcorrectly, but it is lost when the MCP tool response is constructed. - Top-level
awaitalso does not work insidecall_tool_chaindespite 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels