Merge pull request #546 from modelcontextprotocol/antonp/quiet-partial-log

fix: skip debug log for high-frequency tool-input-partial notifications
This commit is contained in:
Anton Pidkuiko 2026-03-10 17:33:19 +00:00 • committed by GitHub
commit a2d2d8c6d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,6 +7,7 @@ import {
Transport,
TransportSendOptions,
} from "@modelcontextprotocol/sdk/shared/transport.js";
import { TOOL_INPUT_PARTIAL_METHOD } from "./spec.types";
/**
* JSON-RPC transport using `window.postMessage` for iframe↔parent communication.
@ -123,7 +124,11 @@ export class PostMessageTransport implements Transport {
* @param options - Optional send options (currently unused)
*/
async send(message: JSONRPCMessage, options?: TransportSendOptions) {
console.debug("Sending message", message);
// Skip debug log for high-frequency streaming notifications — these
// can fire dozens of times per second and flood the console.
if ((message as { method?: string }).method !== TOOL_INPUT_PARTIAL_METHOD) {
console.debug("Sending message", message);
}
this.eventTarget.postMessage(message, "*");
}