|
cxxmcp 1.1.6
C++ MCP SDK
|
Client transport that owns a child process and exchanges JSON-RPC over stdio. More...
#include <process_stdio_transport.hpp>
Public Member Functions | |
| ProcessStdioTransport (ProcessStdioTransportOptions options) | |
| Creates a child-process stdio transport. | |
| ProcessStdioTransport (const ProcessStdioTransport &)=delete | |
| ProcessStdioTransport & | operator= (const ProcessStdioTransport &)=delete |
| core::Result< protocol::JsonRpcResponse > | send (const protocol::JsonRpcRequest &request) override |
| Sends one JSON-RPC request to the child process and waits for a response. | |
| core::Result< core::Unit > | send_notification (const protocol::JsonRpcNotification ¬ification) override |
| Sends one JSON-RPC notification to the child process. | |
| core::Result< core::Unit > | start (TransportRequestHandler request_handler, TransportNotificationHandler notification_handler={}) override |
| Starts the child process and receive loop when needed. | |
| void | stop () noexcept override |
| Stops the child process and receive loop. | |
Client transport that owns a child process and exchanges JSON-RPC over stdio.
The transport is move-only through unique ownership by Client. It starts the child process on demand and routes server-initiated requests and notifications through callbacks registered with start().
|
explicit |
Creates a child-process stdio transport.
| options | Command, arguments, working directory, and environment. |
|
overridevirtual |
Sends one JSON-RPC request to the child process and waits for a response.
Implements mcp::client::Transport.
|
overridevirtual |
Sends one JSON-RPC notification to the child process.
Reimplemented from mcp::client::Transport.
|
overridevirtual |
Starts the child process and receive loop when needed.
| request_handler | Handler for server-to-client requests. |
| notification_handler | Handler for server-to-client notifications. |
Reimplemented from mcp::client::Transport.
|
overridevirtualnoexcept |
Stops the child process and receive loop.
Reimplemented from mcp::client::Transport.