shaun smith commited on
Reset MCP timeout on Progress Notifications (#1992)
Browse filesuse the reset on progress setting for adaptable timeouts. progress not surfaced to ux yet.
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 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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>) : [];
|