Skip to content

Commit e36259f

Browse files
author
heheer
committed
mcp call tools timeout
1 parent 5816040 commit e36259f

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

packages/service/core/app/mcp.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,16 @@ export class MCPClient {
110110
const client = await this.getConnection();
111111
addLog.debug(`[MCP Client] Call tool: ${toolName}`, params);
112112

113-
return await client.callTool({
114-
name: toolName,
115-
arguments: params
116-
});
113+
return await client.callTool(
114+
{
115+
name: toolName,
116+
arguments: params
117+
},
118+
undefined,
119+
{
120+
timeout: 300000
121+
}
122+
);
117123
} catch (error) {
118124
addLog.error(`[MCP Client] Failed to call tool ${toolName}:`, error);
119125
return Promise.reject(error);

projects/app/src/web/core/app/api/plugin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ export const postUpdateMCPTools = (data: updateMCPToolsBody) =>
8888
export const getMCPTools = (data: getMCPToolsBody) =>
8989
POST<McpToolConfigType[]>('/support/mcp/client/getTools', data);
9090

91-
export const postRunMCPTool = (data: RunMCPToolBody) => POST('/support/mcp/client/runTool', data);
91+
export const postRunMCPTool = (data: RunMCPToolBody) =>
92+
POST('/support/mcp/client/runTool', data, { timeout: 300000 });
9293

9394
/* ============ http plugin ============== */
9495
export const postCreateHttpPlugin = (data: createHttpPluginBody) =>

0 commit comments

Comments
 (0)