| Crates.io | mcpkit-transport |
| lib.rs | mcpkit-transport |
| version | 0.5.0 |
| created_at | 2025-12-11 17:02:17.911233+00 |
| updated_at | 2025-12-26 00:53:06.354245+00 |
| description | Transport abstractions for mcpkit |
| homepage | |
| repository | https://github.com/praxiomlabs/mcpkit |
| max_upload_size | |
| id | 1980137 |
| size | 515,466 |
Transport abstractions for the Model Context Protocol (MCP).
This crate provides transport layer implementations that handle the low-level details of sending and receiving JSON-RPC messages between MCP clients and servers.
The transport layer is responsible for:
| Transport | Description |
|---|---|
StdioTransport |
Standard I/O for subprocess communication |
SpawnedTransport |
Spawn and connect to a subprocess |
MemoryTransport |
In-memory transport for testing |
HttpTransport |
HTTP/SSE transport (with http feature) |
WebSocketTransport |
WebSocket transport (with websocket feature) |
UnixTransport |
Unix domain sockets (Unix only) |
use mcpkit_transport::{Transport, SpawnedTransport};
#[tokio::main]
async fn main() -> Result<(), mcpkit_transport::TransportError> {
// Spawn an MCP server as a subprocess
let transport = SpawnedTransport::spawn("my-mcp-server", &[] as &[&str]).await?;
// Receive messages
while let Some(msg) = transport.recv().await? {
// Handle the message
}
transport.close().await?;
Ok(())
}
| Feature | Description |
|---|---|
tokio-runtime (default) |
Use Tokio for async I/O |
smol-runtime |
Use smol for async I/O |
http |
Enable HTTP/SSE transport |
websocket |
Enable WebSocket transport |
The transport layer supports middleware for:
This crate is part of the mcpkit SDK. For most use cases, depend on mcpkit directly rather than this crate.
Licensed under either of Apache License, Version 2.0 or MIT license at your option.