Skip to content

Commit 0c592b5

Browse files
authored
Reset MCP timeout on Progress Notifications (#1992)
use the reset on progress setting for adaptable timeouts. progress not surfaced to ux yet.
1 parent cca007b commit 0c592b5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/lib/server/mcp/httpClient.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@ export async function callMcpTool(
4040
const response = await activeClient.callTool(
4141
{ name: tool, arguments: normalizedArgs },
4242
undefined,
43-
{ signal, timeout: timeoutMs }
43+
{
44+
signal,
45+
timeout: timeoutMs,
46+
// Enable progress tokens so long-running tools keep extending the timeout.
47+
onprogress: () => {},
48+
resetTimeoutOnProgress: true,
49+
}
4450
);
4551

4652
const parts = Array.isArray(response?.content) ? (response.content as Array<unknown>) : [];

0 commit comments

Comments
 (0)