Commit 2bd53450 by heheer Committed by GitHub

mcp call tools timeout (#5123)

parent 58160409
...@@ -110,10 +110,16 @@ export class MCPClient { ...@@ -110,10 +110,16 @@ export class MCPClient {
const client = await this.getConnection(); const client = await this.getConnection();
addLog.debug(`[MCP Client] Call tool: ${toolName}`, params); addLog.debug(`[MCP Client] Call tool: ${toolName}`, params);
return await client.callTool({ return await client.callTool(
{
name: toolName, name: toolName,
arguments: params arguments: params
}); },
undefined,
{
timeout: 300000
}
);
} catch (error) { } catch (error) {
addLog.error(`[MCP Client] Failed to call tool ${toolName}:`, error); addLog.error(`[MCP Client] Failed to call tool ${toolName}:`, error);
return Promise.reject(error); return Promise.reject(error);
......
...@@ -88,7 +88,8 @@ export const postUpdateMCPTools = (data: updateMCPToolsBody) => ...@@ -88,7 +88,8 @@ export const postUpdateMCPTools = (data: updateMCPToolsBody) =>
export const getMCPTools = (data: getMCPToolsBody) => export const getMCPTools = (data: getMCPToolsBody) =>
POST<McpToolConfigType[]>('/support/mcp/client/getTools', data); POST<McpToolConfigType[]>('/support/mcp/client/getTools', data);
export const postRunMCPTool = (data: RunMCPToolBody) => POST('/support/mcp/client/runTool', data); export const postRunMCPTool = (data: RunMCPToolBody) =>
POST('/support/mcp/client/runTool', data, { timeout: 300000 });
/* ============ http plugin ============== */ /* ============ http plugin ============== */
export const postCreateHttpPlugin = (data: createHttpPluginBody) => export const postCreateHttpPlugin = (data: createHttpPluginBody) =>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment