StreamableHttpServerConfig class
Configuration for StreamableHTTP server transport
- Annotations
-
- @immutable
Constructors
-
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}) -
const
Properties
- authToken → String?
-
Authentication token for Bearer token validation (optional)
final
- corsConfig → CorsConfig
-
CORS configuration
final
- enableGetStream → bool
-
Enable GET stream for out-of-band server-initiated messages (per MCP 2025-03-26)
When false, server returns 405 Method Not Allowed for GET requests
final
- endpoint → String
-
The endpoint path for StreamableHTTP requests
final
-
fallbackPorts
→ List<
int> -
Fallback ports to try if the primary port is unavailable
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- host → String
-
The host to bind to
final
- isJsonResponseEnabled → bool
-
Enable JSON response mode instead of SSE (default: false for streaming)
final
- jsonResponseMode → String
-
Response mode for JSON: 'sync' or 'async'
final
- maxRequestSize → int
-
Maximum request body size in bytes
final
- port → int
-
The port to listen on
final
- requestTimeout → Duration
-
Request timeout
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited