mcp --http: no request timeout (tool calls can run for many minutes)

This commit is contained in:
CRTkafa 2026-10-29 09:31:41 +00:00
parent e433ae1e1c
commit 39cc89c0d4

View file

@ -165,6 +165,9 @@ export function startHttp(o: HttpOptions): Promise<{ close: () => void; port: nu
return r ? send(res, 200, r) : send(res, 202);
} catch (e) { return send(res, 500, { jsonrpc: '2.0', id: (msg as { id?: unknown }).id ?? null, error: { code: -32603, message: String((e as Error).message) } }); }
});
// a tool call can run for many minutes (check on a big project, uploads): Node's 300 s request timeout would cut it
server.requestTimeout = 0;
server.timeout = 0;
return new Promise((ok, fail) => {
server.once('error', fail);
server.listen(o.port, o.host, () => {