Skip to content

http-stream default responseMode is stream in runtime, but documented as batch #184

@esgn

Description

@esgn

The documented default for http-stream responseMode says batch, but the runtime code in the published package defaults to stream.

For current documentation stating batch is the default mode see :

This creates a behavior mismatch for applications that rely on the documented default and omit responseMode from their transport config.

Version

Observed with mcp-framework@0.2.22.

Expected behavior

If responseMode is omitted from an http-stream transport config, the framework should default to batch, as documented.

Actual behavior

If responseMode is omitted, the runtime defaults to stream.

Evidence

In the published package:

  • dist/transports/http/types.js defines DEFAULT_HTTP_STREAM_CONFIG.responseMode = 'stream'
  • dist/transports/http/server.js enables JSON batch responses only when config.responseMode === 'batch'

So when responseMode is not explicitly set, the effective behavior is stream.

However, the README says the opposite:

  • the HTTP Stream example says responseMode: "batch" is the default
  • the “Response Modes” section says Batch Mode (Default)

Minimal reproduction

    import { MCPServer } from "mcp-framework";

    const server = new MCPServer({
      transport: {
        type: "http-stream",
        options: {
          port: 8080,
          endpoint: "/mcp",
          // responseMode intentionally omitted
        },
      },
    });

With this configuration, the runtime behaves as if responseMode were stream, not batch.

Why this matters

This is easy to miss because the configuration looks valid and matches the docs.

In our case, we omitted responseMode because the docs say the default is batch, but the server actually runs in stream mode. That can affect:

  • client compatibility
  • response handling expectations
  • debugging of HTTP transport behavior
  • rollout safety when upgrading or switching transport

Suggested fix

One of these should be done so docs and runtime match:

  1. Change the runtime default to batch
  2. Update the documentation everywhere to state that the default is stream

If stream is the intended default, it would also help to mention that explicitly in examples because the current docs strongly suggest that omitting responseMode is equivalent to batch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions