diff --git a/client/src/hooks/MCP/useAppBridge.ts b/client/src/hooks/MCP/useAppBridge.ts index 0ad90f82a8..dfc583c93b 100644 --- a/client/src/hooks/MCP/useAppBridge.ts +++ b/client/src/hooks/MCP/useAppBridge.ts @@ -155,11 +155,11 @@ export function useAppBridge( bridge.oninitialized = async () => { const args = toolArgsRef.current; const result = toolResultRef.current; - if (args) { - await bridge! - .sendToolInput({ arguments: args }) - .catch((err: unknown) => logger.error('[MCP App] sendToolInput failed', err)); - } + // MCP Apps expect tool input exactly once before the result, even for no-argument tools, + // so apps that initialize from ontoolinput always receive it. + await bridge! + .sendToolInput({ arguments: args ?? {} }) + .catch((err: unknown) => logger.error('[MCP App] sendToolInput failed', err)); if (result) { await bridge! .sendToolResult(result as never) diff --git a/packages/api/src/mcp/MCPManager.ts b/packages/api/src/mcp/MCPManager.ts index 0f5d95a2f8..91708e9da8 100644 --- a/packages/api/src/mcp/MCPManager.ts +++ b/packages/api/src/mcp/MCPManager.ts @@ -966,7 +966,7 @@ Please follow these instructions when using tools from the respective MCP server }, }, CallToolResultSchema, - { timeout: connection.timeout }, + { timeout: connection.timeout, resetTimeoutOnProgress: true }, ); return result;