StreamableHttpClientTransport class

Streamable HTTP client transport for MCP

Implemented types

Properties

baseUrl String
Get the base URL
no setter
config → StreamableHttpTransportConfig
final
hashCode int
The hash code for this object.
no setterinherited
maxConcurrentRequests int
Get the maximum concurrent requests
no setter
oauthConfig OAuthConfig?
Get the OAuth configuration
no setter
onClose Future<void>
Future that completes when the transport is closed
no setteroverride
onMessage Stream
Stream of incoming messages
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sessionId String?
Get the current session ID
no setter
useHttp2 bool
Check if HTTP/2 is enabled
no setter

Methods

authenticateWithOAuth({required List<String> scopes, String? state}) Future<OAuthToken>
Initiate OAuth authentication flow
close() → void
Close the transport
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(dynamic message) → void
Send a JSON-RPC message
override
setOAuthToken(OAuthToken token) → void
Set OAuth token manually
setProtocolVersion(String version) → void
Spec 2025-06-18+: record the negotiated MCP protocol version so every post-handshake HTTP request carries MCP-Protocol-Version: <version>.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

create({required String baseUrl, OAuthConfig? oauthConfig, Map<String, String>? headers, Duration? timeout, int? maxConcurrentRequests, bool? useHttp2, Client? httpClient, bool terminateOnClose = true}) Future<StreamableHttpClientTransport>
Create a new Streamable HTTP transport