propagate abortSignal (#18477)

This commit is contained in:
Tommaso Sciortino
2026-02-08 13:56:26 -08:00
committed by GitHub
parent 92012365ca
commit 29a6aecffc
3 changed files with 11 additions and 4 deletions
+5 -1
View File
@@ -286,7 +286,10 @@ export class McpClient {
this.resourceRegistry.setResourcesForServer(this.serverName, resources);
}
async readResource(uri: string): Promise<ReadResourceResult> {
async readResource(
uri: string,
options?: { signal?: AbortSignal },
): Promise<ReadResourceResult> {
this.assertConnected();
return this.client!.request(
{
@@ -294,6 +297,7 @@ export class McpClient {
params: { uri },
},
ReadResourceResultSchema,
options,
);
}