mcp-proxy 5.6.1 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/bin/mcp-proxy.js +7 -1
- package/dist/bin/mcp-proxy.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/{stdio-D0Lv8ytu.js → stdio-AohZZTMh.js} +12 -12
- package/dist/stdio-AohZZTMh.js.map +1 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/bin/mcp-proxy.ts +6 -0
- package/src/fixtures/slow-stdio-server.ts +91 -0
- package/src/proxyServer.test.ts +148 -0
- package/src/proxyServer.ts +43 -10
- package/dist/stdio-D0Lv8ytu.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -43,10 +43,12 @@ declare class InMemoryEventStore implements EventStore {
|
|
|
43
43
|
//#region src/proxyServer.d.ts
|
|
44
44
|
declare const proxyServer: ({
|
|
45
45
|
client,
|
|
46
|
+
requestTimeout,
|
|
46
47
|
server,
|
|
47
48
|
serverCapabilities
|
|
48
49
|
}: {
|
|
49
50
|
client: Client;
|
|
51
|
+
requestTimeout?: number;
|
|
50
52
|
server: Server;
|
|
51
53
|
serverCapabilities: ServerCapabilities;
|
|
52
54
|
}) => Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client, InMemoryEventStore, JSONRPCMessageSchema, LATEST_PROTOCOL_VERSION, NEVER, ReadBuffer, Server, ZodIssueCode, anyType, arrayType, booleanType, isInitializedNotification, isJSONRPCRequest, isJSONRPCResponse, numberType, objectType, proxyServer, serializeMessage, startHTTPServer, stringType } from "./stdio-
|
|
1
|
+
import { Client, InMemoryEventStore, JSONRPCMessageSchema, LATEST_PROTOCOL_VERSION, NEVER, ReadBuffer, Server, ZodIssueCode, anyType, arrayType, booleanType, isInitializedNotification, isJSONRPCRequest, isJSONRPCResponse, numberType, objectType, proxyServer, serializeMessage, startHTTPServer, stringType } from "./stdio-AohZZTMh.js";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
|
|
4
4
|
//#region node_modules/.pnpm/eventsource-parser@3.0.6/node_modules/eventsource-parser/dist/index.js
|
|
@@ -4400,7 +4400,7 @@ var McpError = class extends Error {
|
|
|
4400
4400
|
|
|
4401
4401
|
//#endregion
|
|
4402
4402
|
//#region src/proxyServer.ts
|
|
4403
|
-
const proxyServer = async ({ client, server, serverCapabilities }) => {
|
|
4403
|
+
const proxyServer = async ({ client, requestTimeout, server, serverCapabilities }) => {
|
|
4404
4404
|
if (serverCapabilities?.logging) {
|
|
4405
4405
|
server.setNotificationHandler(LoggingMessageNotificationSchema, async (args) => {
|
|
4406
4406
|
return client.notification(args);
|
|
@@ -4411,44 +4411,44 @@ const proxyServer = async ({ client, server, serverCapabilities }) => {
|
|
|
4411
4411
|
}
|
|
4412
4412
|
if (serverCapabilities?.prompts) {
|
|
4413
4413
|
server.setRequestHandler(GetPromptRequestSchema, async (args) => {
|
|
4414
|
-
return client.getPrompt(args.params);
|
|
4414
|
+
return client.getPrompt(args.params, requestTimeout ? { timeout: requestTimeout } : void 0);
|
|
4415
4415
|
});
|
|
4416
4416
|
server.setRequestHandler(ListPromptsRequestSchema, async (args) => {
|
|
4417
|
-
return client.listPrompts(args.params);
|
|
4417
|
+
return client.listPrompts(args.params, requestTimeout ? { timeout: requestTimeout } : void 0);
|
|
4418
4418
|
});
|
|
4419
4419
|
}
|
|
4420
4420
|
if (serverCapabilities?.resources) {
|
|
4421
4421
|
server.setRequestHandler(ListResourcesRequestSchema, async (args) => {
|
|
4422
|
-
return client.listResources(args.params);
|
|
4422
|
+
return client.listResources(args.params, requestTimeout ? { timeout: requestTimeout } : void 0);
|
|
4423
4423
|
});
|
|
4424
4424
|
server.setRequestHandler(ListResourceTemplatesRequestSchema, async (args) => {
|
|
4425
|
-
return client.listResourceTemplates(args.params);
|
|
4425
|
+
return client.listResourceTemplates(args.params, requestTimeout ? { timeout: requestTimeout } : void 0);
|
|
4426
4426
|
});
|
|
4427
4427
|
server.setRequestHandler(ReadResourceRequestSchema, async (args) => {
|
|
4428
|
-
return client.readResource(args.params);
|
|
4428
|
+
return client.readResource(args.params, requestTimeout ? { timeout: requestTimeout } : void 0);
|
|
4429
4429
|
});
|
|
4430
4430
|
if (serverCapabilities?.resources.subscribe) {
|
|
4431
4431
|
server.setNotificationHandler(ResourceUpdatedNotificationSchema, async (args) => {
|
|
4432
4432
|
return client.notification(args);
|
|
4433
4433
|
});
|
|
4434
4434
|
server.setRequestHandler(SubscribeRequestSchema, async (args) => {
|
|
4435
|
-
return client.subscribeResource(args.params);
|
|
4435
|
+
return client.subscribeResource(args.params, requestTimeout ? { timeout: requestTimeout } : void 0);
|
|
4436
4436
|
});
|
|
4437
4437
|
server.setRequestHandler(UnsubscribeRequestSchema, async (args) => {
|
|
4438
|
-
return client.unsubscribeResource(args.params);
|
|
4438
|
+
return client.unsubscribeResource(args.params, requestTimeout ? { timeout: requestTimeout } : void 0);
|
|
4439
4439
|
});
|
|
4440
4440
|
}
|
|
4441
4441
|
}
|
|
4442
4442
|
if (serverCapabilities?.tools) {
|
|
4443
4443
|
server.setRequestHandler(CallToolRequestSchema, async (args) => {
|
|
4444
|
-
return client.callTool(args.params);
|
|
4444
|
+
return client.callTool(args.params, void 0, requestTimeout ? { timeout: requestTimeout } : void 0);
|
|
4445
4445
|
});
|
|
4446
4446
|
server.setRequestHandler(ListToolsRequestSchema, async (args) => {
|
|
4447
|
-
return client.listTools(args.params);
|
|
4447
|
+
return client.listTools(args.params, requestTimeout ? { timeout: requestTimeout } : void 0);
|
|
4448
4448
|
});
|
|
4449
4449
|
}
|
|
4450
4450
|
server.setRequestHandler(CompleteRequestSchema, async (args) => {
|
|
4451
|
-
return client.complete(args.params);
|
|
4451
|
+
return client.complete(args.params, requestTimeout ? { timeout: requestTimeout } : void 0);
|
|
4452
4452
|
});
|
|
4453
4453
|
};
|
|
4454
4454
|
|
|
@@ -21483,4 +21483,4 @@ function serializeMessage(message) {
|
|
|
21483
21483
|
|
|
21484
21484
|
//#endregion
|
|
21485
21485
|
export { Client, InMemoryEventStore, JSONRPCMessageSchema, LATEST_PROTOCOL_VERSION, NEVER, ReadBuffer, Server, ZodIssueCode, __commonJS, __toESM, anyType, arrayType, booleanType, isInitializedNotification, isJSONRPCRequest, isJSONRPCResponse, numberType, objectType, proxyServer, serializeMessage, startHTTPServer, stringType };
|
|
21486
|
-
//# sourceMappingURL=stdio-
|
|
21486
|
+
//# sourceMappingURL=stdio-AohZZTMh.js.map
|