MCPEx.Transport (MCPEx v0.1.0)
Defines the behavior for MCP transport implementations.
The transport layer handles the communication between the client and server, providing abstraction over different transport mechanisms (stdio, HTTP, etc.).
Summary
Functions
Closes the transport connection.
Creates a new transport instance.
Sends a message to the server.
Functions
Closes the transport connection.
Parameters
transport
- The transport to close
Returns
:ok
- The connection was closed successfully{:error, reason}
- Failed to close the connection
Creates a new transport instance.
Parameters
transport_type
- The type of transport to create (:stdio, :http, :test)options
- Options specific to the transport type
Returns
{:ok, pid}
- The transport was created successfully{:error, reason}
- Failed to create the transport
Sends a message to the server.
Parameters
transport
- The transport processmessage
- The message to send
Returns
:ok
- The message was sent successfully{:error, reason}
- Failed to send the message