Skip to content

Commit f573506

Browse files
committed
fix wrapTransportSend to handle all transport.send arguments
1 parent b6f19ca commit f573506

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/core/src/integrations/mcp-server/transport.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,12 @@ export function wrapTransportOnMessage(transport: MCPTransport): void {
7878
export function wrapTransportSend(transport: MCPTransport): void {
7979
if (transport.send) {
8080
fill(transport, 'send', originalSend => {
81-
return async function (this: MCPTransport, message: unknown) {
81+
return async function (this: MCPTransport, ...args: unknown[]) {
82+
const [message] = args;
83+
8284
if (isJsonRpcNotification(message)) {
8385
return createMcpOutgoingNotificationSpan(message, this, () => {
84-
return (originalSend as (...args: unknown[]) => unknown).call(this, message);
86+
return (originalSend as (...args: unknown[]) => unknown).call(this, ...args);
8587
});
8688
}
8789

@@ -107,7 +109,7 @@ export function wrapTransportSend(transport: MCPTransport): void {
107109
}
108110
}
109111

110-
return (originalSend as (...args: unknown[]) => unknown).call(this, message);
112+
return (originalSend as (...args: unknown[]) => unknown).call(this, ...args);
111113
};
112114
});
113115
}

0 commit comments

Comments
 (0)