McpStreamableHttpTransport class final
The streamable-HTTP MCP transport (one endpoint, POST per message).
- Implemented types
Constructors
- McpStreamableHttpTransport(McpHttpServerConfig server, {Client? client})
-
Creates a transport for
server.clientdefaults to a freshpackage:httpclient (owned and closed with the transport).
Properties
-
closed
→ Future<
void> -
Completes when the connection dies, expectedly or not.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
messages
→ Stream<
Map< String, dynamic> > -
Decoded JSON-RPC messages from the server. The stream closing (normally
or by error) means the connection is dead.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → Future< void> -
Closes the connection. Idempotent.
inherited
-
emit(
Object? decoded) → void -
Emits a decoded server message.
inherited
-
emitSseData(
String data) → void -
Decodes SSE
data:frames into messages.inherited -
emitTransportError(
Object? id, String message) → void -
Emits a synthetic JSON-RPC error response for the request
idafter a transport-level failure, so the pending call rejects promptly.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
send(
Map< String, dynamic> message) → Future<void> -
Sends one JSON-RPC message. For HTTP transports the returned future
settles once the message was POSTed (transport-level failures are
delivered as synthetic error responses on messages when the message
was a request).
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited