Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/transports/http/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export interface HttpStreamTransportConfig {

/**
* Response mode: stream (Server-Sent Events) or batch (JSON)
* Defaults to 'stream'
* Defaults to 'batch'
*/
responseMode?: ResponseMode;

Expand Down Expand Up @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions tests/transports/host-binding.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});
});