shaun smith commited on
Commit
0ab931d
·
unverified ·
1 Parent(s): c0ef209

Reset MCP timeout on Progress Notifications (#1992)

Browse files

use the reset on progress setting for adaptable timeouts. progress not surfaced to ux yet.

Files changed (1) hide show
  1. src/lib/server/mcp/httpClient.ts +7 -1
src/lib/server/mcp/httpClient.ts CHANGED
@@ -40,7 +40,13 @@ export async function callMcpTool(
40
  const response = await activeClient.callTool(
41
  { name: tool, arguments: normalizedArgs },
42
  undefined,
43
- { signal, timeout: timeoutMs }
 
 
 
 
 
 
44
  );
45
 
46
  const parts = Array.isArray(response?.content) ? (response.content as Array<unknown>) : [];
 
40
  const response = await activeClient.callTool(
41
  { name: tool, arguments: normalizedArgs },
42
  undefined,
43
+ {
44
+ signal,
45
+ timeout: timeoutMs,
46
+ // Enable progress tokens so long-running tools keep extending the timeout.
47
+ onprogress: () => {},
48
+ resetTimeoutOnProgress: true,
49
+ }
50
  );
51
 
52
  const parts = Array.isArray(response?.content) ? (response.content as Array<unknown>) : [];