diff --git a/src/transports/http/types.ts b/src/transports/http/types.ts index b1db39d..ca49840 100644 --- a/src/transports/http/types.ts +++ b/src/transports/http/types.ts @@ -71,7 +71,7 @@ export interface HttpStreamTransportConfig { /** * Response mode: stream (Server-Sent Events) or batch (JSON) - * Defaults to 'stream' + * Defaults to 'batch' */ responseMode?: ResponseMode; @@ -119,7 +119,7 @@ export const DEFAULT_SESSION_CONFIG: SessionConfig = { export const DEFAULT_HTTP_STREAM_CONFIG: HttpStreamTransportConfig = { port: 8080, endpoint: '/mcp', - responseMode: 'stream', + responseMode: 'batch', batchTimeout: 30000, maxMessageSize: 4 * 1024 * 1024, session: DEFAULT_SESSION_CONFIG, diff --git a/tests/transports/host-binding.test.ts b/tests/transports/host-binding.test.ts index 56ed3e9..a38f9e1 100644 --- a/tests/transports/host-binding.test.ts +++ b/tests/transports/host-binding.test.ts @@ -80,5 +80,11 @@ describe('Host binding defaults', () => { expect(DEFAULT_HTTP_STREAM_CONFIG.port).toBe(8080); expect((DEFAULT_HTTP_STREAM_CONFIG as any).host).toBeUndefined(); }); + + it('should default responseMode to "batch" in DEFAULT_HTTP_STREAM_CONFIG', () => { + // README and the type doc comment both document "batch" as the default + // response mode for the HTTP Stream transport; the runtime default must match. + expect(DEFAULT_HTTP_STREAM_CONFIG.responseMode).toBe('batch'); + }); }); });