12namespace mcp::client {
54 std::ostream* output_;
55 bool started_ =
false;
Client transport backed by std::istream and std::ostream.
Definition stdio_transport.hpp:24
StdioTransport(std::istream &input, std::ostream &output)
Creates a stdio transport using caller-owned streams.
core::Result< core::Unit > start(TransportRequestHandler request_handler, TransportNotificationHandler notification_handler={}) override
Starts receive-side dispatch for stream input.
core::Result< protocol::JsonRpcResponse > send(const protocol::JsonRpcRequest &request) override
Sends one JSON-RPC request over the output stream and waits for a response.
StdioTransport()
Creates a stdio transport using standard input and output streams.
core::Result< core::Unit > send_notification(const protocol::JsonRpcNotification ¬ification) override
Sends one JSON-RPC notification over the output stream.
Abstract client transport used by Client to exchange JSON-RPC messages.
Definition client.hpp:83
Core client compatibility API and transport interface for MCP clients.
std::function< core::Result< core::Unit >(const protocol::JsonRpcNotification &)> TransportNotificationHandler
Handles JSON-RPC notifications sent by the server to this client.
Definition client.hpp:75
std::function< core::Result< protocol::JsonRpcResponse >(const protocol::JsonRpcRequest &)> TransportRequestHandler
Handles JSON-RPC requests sent by the server to this client.
Definition client.hpp:68
tl::expected< T, Error > Result
Alias for the SDK result type.
Definition result.hpp:64
JSON-RPC notification envelope for one-way MCP messages.
Definition types.hpp:137
JSON-RPC request envelope carrying an MCP method invocation.
Definition types.hpp:99