StreamableHttpServerConfig constructor
const
StreamableHttpServerConfig({
- String endpoint = '/mcp',
- String host = 'localhost',
- int port = 8080,
- List<
int> fallbackPorts = const [8081, 8082, 8083], - CorsConfig corsConfig = const CorsConfig(),
- int maxRequestSize = 4 * 1024 * 1024,
- Duration requestTimeout = const Duration(seconds: 30),
- bool isJsonResponseEnabled = false,
- String jsonResponseMode = 'sync',
- String? authToken,
- bool enableGetStream = true,
Implementation
const StreamableHttpServerConfig({
this.endpoint = '/mcp',
this.host = 'localhost',
this.port = 8080,
this.fallbackPorts = const [8081, 8082, 8083],
this.corsConfig = const CorsConfig(),
this.maxRequestSize = 4 * 1024 * 1024, // 4MB
this.requestTimeout = const Duration(seconds: 30),
this.isJsonResponseEnabled = false, // StreamableHTTP uses SSE by default
this.jsonResponseMode = 'sync', // Default to synchronous JSON responses
this.authToken, // Optional Bearer token for authentication
this.enableGetStream = true, // Default: enabled per MCP 2025-03-26
});