colmugx/mcp/transport does not have a README file
pub(open) trait Transport {
fn receive(Self) -> String? raise TransportError
fn send(Self, String) -> Unit raise TransportError
fn send_notification(Self, Notification) -> Unit raise TransportError
fn close(Self) -> Unit
}pub(all) enum AnyTransport {
Stdio(StdioTransport)
StdioClient(StdioClientTransport)
Http(HttpTransport)
HttpClient(HttpClientTransport)
}fn AuthConfig::AuthConfig(authenticate~ : (String) -> Principal?, resource_metadata_url~ : String, authorization_servers? : Array[String], required_scopes? : String, allowed_origins? : Array[String]) -> AuthConfigpub(all) struct AuthenticatedRequest {
message : String
reply : Queue[String]
principal : Principal?
cancellation_token : CancellationToken
}fn HttpClientTransport::HttpClientTransport(base_url : String, auth_token? : String, extra_headers? : Array[(String, String)]) -> HttpClientTransportasync fn HttpClientTransport::send_notification(self : HttpClientTransport, notification : Notification) -> Unitfn HttpClientTransport::set_tool_header_schemas(self : HttpClientTransport, schemas : Map[String, Array[(Array[String], String)]]) -> Unitpub struct HttpTransport {
port : Int
endpoint_path : String
auth : AuthConfig?
keepalive_interval_ms : Int
tool_schema_resolver : Ref[(String) -> Json?]
pending_requests : Queue[AuthenticatedRequest]
pending_reply_queues : Map[String, Queue[String]]
}fn HttpTransport::HttpTransport(port? : Int, endpoint_path? : String, keepalive_interval_ms? : Int) -> HttpTransportasync fn HttpTransport::receive_authenticated_request(self : HttpTransport) -> AuthenticatedRequest? raise TransportErrorasync fn HttpTransport::receive_request(self : HttpTransport) -> (String, Queue[String])? raise TransportErrorfn HttpTransport::set_tool_schema_resolver(self : HttpTransport, resolver : (String) -> Json?) -> Unitpub struct StdioClientTransport {
cmd : String
args : Array[String]
extra_env : Map[String, String]
closed : Bool
reader : ReadFromProcess?
raw_writer : WriteToProcess?
writer : BufferedWriter[WriteToProcess]?
send_mutex : Mutex
}fn StdioClientTransport::StdioClientTransport(cmd~ : String, args? : Array[String], extra_env? : Map[String, String]) -> StdioClientTransportasync fn StdioClientTransport::send_notification(self : StdioClientTransport, notification : Notification) -> Unitasync fn StdioClientTransport::start(self : StdioClientTransport, group : TaskGroup[Unit]) -> Unit raise TransportErrorasync fn StdioTransport::send_notification(self : StdioTransport, notification : Notification) -> Unit raise TransportErrorfn decode_base64(s : String) -> Bytes?fn decode_base64_sentinel(value : String) -> String?fn encode_base64(bytes : Bytes) -> Stringfn encode_base64_sentinel(value : String) -> Stringfn encode_header_value(value : String) -> Stringfn header_mismatch_error(detail : String, body~ : String) -> Stringfn invalid_params_error(detail : String, body~ : String) -> Stringfn is_header_safe(value : String) -> Boolfn is_valid_header_characters(value : String) -> Boolfn jsonrpc_error_code(message : String) -> Int?fn looks_like_sentinel(value : String) -> Boolfn sse_event_line(json : String) -> Stringfn unsupported_protocol_version_error(requested : String, body~ : String) -> StringInstall
Download zipType-safe MCP SDK in MoonBit with server/client support and dual transport (STDIO/HTTP)