cxxmcp 1.1.6
C++ MCP SDK
Loading...
Searching...
No Matches
mcp::transport::ProcessStdioClientTransport Class Referencefinal

Native transport-contract client for a child MCP server over stdio. More...

#include <process_stdio_transport.hpp>

Inheritance diagram for mcp::transport::ProcessStdioClientTransport:
mcp::transport::Transport< Role >

Public Member Functions

 ProcessStdioClientTransport (ProcessStdioClientTransportOptions options)
 
 ProcessStdioClientTransport (const ProcessStdioClientTransport &)=delete
 
ProcessStdioClientTransportoperator= (const ProcessStdioClientTransport &)=delete
 
std::string_view name () const noexcept override
 Human-readable transport name for diagnostics.
 
protocol::Json diagnostics () const override
 Structured implementation diagnostics.
 
core::Result< core::Unitsend (TxMessage message) override
 Sends one JSON-RPC message to the peer.
 
core::Result< std::optional< RxMessage > > receive () override
 Receives the next JSON-RPC message from the peer.
 
core::Result< core::Unitclose () override
 Closes the transport and unblocks receive() where possible.
 
- Public Member Functions inherited from mcp::transport::Transport< Role >
virtual void wait_until_ready ()
 Blocks until the transport is ready to process messages.
 

Additional Inherited Members

- Public Types inherited from mcp::transport::Transport< Role >
using TxMessage = typename MessageTraits< Role >::TxMessage
 
using RxMessage = typename MessageTraits< Role >::RxMessage
 

Detailed Description

Native transport-contract client for a child MCP server over stdio.

This class exposes process stdio through transport::ClientTransport while reusing the established client process implementation. send() serializes outbound writes. Sending a request waits for the matching response and queues it for receive(); sending a response completes an inbound server-to-client request previously returned by receive(). receive() blocks until a queued message is available or close() completes. Concurrent receive() calls are not supported.

Member Function Documentation

◆ close()

core::Result< core::Unit > mcp::transport::ProcessStdioClientTransport::close ( )
overridevirtual

Closes the transport and unblocks receive() where possible.

Implements mcp::transport::Transport< Role >.

◆ diagnostics()

protocol::Json mcp::transport::ProcessStdioClientTransport::diagnostics ( ) const
overridevirtual

Structured implementation diagnostics.

The default keeps the core contract narrow. Transports with useful state may return keys such as "name", "closed", "inflight", or backend-specific counters. Diagnostics are not part of the wire protocol.

Reimplemented from mcp::transport::Transport< Role >.

◆ name()

std::string_view mcp::transport::ProcessStdioClientTransport::name ( ) const
overridevirtualnoexcept

Human-readable transport name for diagnostics.

Implements mcp::transport::Transport< Role >.

◆ receive()

core::Result< std::optional< RxMessage > > mcp::transport::ProcessStdioClientTransport::receive ( )
overridevirtual

Receives the next JSON-RPC message from the peer.

receive() is the sequential inbound side. A successful std::nullopt return is an orderly end-of-stream signal, not a parse or transport error.

Implements mcp::transport::Transport< Role >.

◆ send()

core::Result< core::Unit > mcp::transport::ProcessStdioClientTransport::send ( TxMessage  message)
overridevirtual

Sends one JSON-RPC message to the peer.

Concurrency safety is implementation-specific and must be documented by the concrete transport.

Implements mcp::transport::Transport< Role >.


The documentation for this class was generated from the following file: