Documentation
¶
Overview ¶
Package transport provides the transport layer implementations for the MCP protocol.
This package contains the Transport interface and implementations for different communication methods.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseTransport ¶
type BaseTransport struct {
// contains filtered or unexported fields
}
BaseTransport provides common transport functionality
func (*BaseTransport) GetDebugHandler ¶ added in v1.2.2
func (t *BaseTransport) GetDebugHandler() DebugHandler
GetDebugHandler returns the current debug handler
func (*BaseTransport) HandleMessage ¶
func (t *BaseTransport) HandleMessage(message []byte) ([]byte, error)
HandleMessage handles an incoming message
func (*BaseTransport) SetDebugHandler ¶ added in v1.2.2
func (t *BaseTransport) SetDebugHandler(handler DebugHandler)
SetDebugHandler sets the debug handler
func (*BaseTransport) SetMessageHandler ¶
func (t *BaseTransport) SetMessageHandler(handler MessageHandler)
SetMessageHandler sets the message handler
type DebugHandler ¶ added in v1.2.2
type DebugHandler func(message string)
DebugHandler represents a function that receives debug messages from the transport
type MessageHandler ¶
MessageHandler represents a function that handles incoming messages
type Transport ¶
type Transport interface {
// Initialize initializes the transport
Initialize() error
// Start starts the transport
Start() error
// Stop stops the transport
Stop() error
// Send sends a message over the transport.
Send(message []byte) error
// Receive receives a message from the transport.
Receive() ([]byte, error)
// SetMessageHandler sets the message handler
SetMessageHandler(handler MessageHandler)
// SetDebugHandler sets a handler for debug messages
SetDebugHandler(handler DebugHandler)
}
Transport represents a communication transport for MCP messages.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package grpc provides a gRPC transport implementation for the MCP protocol.
|
Package grpc provides a gRPC transport implementation for the MCP protocol. |
|
Package http provides an HTTP implementation of the MCP transport.
|
Package http provides an HTTP implementation of the MCP transport. |
|
Package mqtt provides a MQTT implementation of the MCP transport.
|
Package mqtt provides a MQTT implementation of the MCP transport. |
|
Package nats provides a NATS implementation of the MCP transport.
|
Package nats provides a NATS implementation of the MCP transport. |
|
Package sse provides a Server-Sent Events implementation of the MCP transport.
|
Package sse provides a Server-Sent Events implementation of the MCP transport. |
|
Package stdio provides a standard I/O implementation of the MCP transport.
|
Package stdio provides a standard I/O implementation of the MCP transport. |
|
Package udp provides a UDP implementation of the MCP transport.
|
Package udp provides a UDP implementation of the MCP transport. |
|
Package unix provides a Unix Domain Socket implementation of the MCP transport.
|
Package unix provides a Unix Domain Socket implementation of the MCP transport. |
|
Package ws provides a WebSocket implementation of the MCP transport.
|
Package ws provides a WebSocket implementation of the MCP transport. |