Documentation
¶
Overview ¶
Package stdio provides a standard I/O implementation of the MCP transport.
This package implements the Transport interface using standard input and output, suitable for CLI applications and direct LLM integration.
Index ¶
- type Transport
- func (t *Transport) DisableProcessMonitoring()
- func (t *Transport) Initialize() error
- func (t *Transport) Receive() ([]byte, error)
- func (t *Transport) Send(message []byte) error
- func (t *Transport) SetLogger(logger *slog.Logger)
- func (t *Transport) SetNewline(newline bool)
- func (t *Transport) Start() error
- func (t *Transport) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Transport ¶ added in v1.2.0
type Transport struct {
transport.BaseTransport
// contains filtered or unexported fields
}
Transport implements the transport.Transport interface for Standard I/O.
func NewTransport ¶ added in v1.2.0
func NewTransport() *Transport
NewTransport creates a new Standard I/O transport. By default, it uses os.Stdin and os.Stdout.
func NewTransportWithIO ¶ added in v1.2.0
NewTransportWithIO creates a new Standard I/O transport with custom io.Reader and io.Writer. This is particularly useful for testing or custom I/O streams.
func (*Transport) DisableProcessMonitoring ¶ added in v1.6.2
func (t *Transport) DisableProcessMonitoring()
DisableProcessMonitoring disables process monitoring (useful for testing). This prevents the transport from calling os.Exit() during tests.
func (*Transport) Initialize ¶ added in v1.2.0
Initialize initializes the transport.
func (*Transport) Receive ¶ added in v1.2.0
Receive is not implemented for stdio transport as it uses the readLoop.
func (*Transport) SetLogger ¶ added in v1.6.2
SetLogger sets the logger for this transport. This should be called before Start() to enable process monitoring logs.
func (*Transport) SetNewline ¶ added in v1.2.0
SetNewline configures whether to append a newline to each sent message.