| Crates.io | turbomcp-stdio |
| lib.rs | turbomcp-stdio |
| version | 3.0.0-beta.3 |
| created_at | 2026-01-12 20:04:16.565648+00 |
| updated_at | 2026-01-22 16:44:30.812724+00 |
| description | Standard I/O transport implementation for TurboMCP - newline-delimited JSON over stdin/stdout |
| homepage | https://turbomcp.org |
| repository | https://github.com/Epistates/turbomcp |
| max_upload_size | |
| id | 2038742 |
| size | 86,850 |
Standard I/O transport implementation for the TurboMCP Model Context Protocol SDK.
This crate provides the StdioTransport implementation for MCP communication over stdin/stdout, which is the standard way MCP servers communicate with clients. It supports JSON-RPC over newline-delimited JSON.
This implementation is fully compliant with the MCP stdio transport specification (2025-06-18):
LinesCodec for proper message framing\n or \r characterstracing crate which outputs to stderr by defaultuse turbomcp_stdio::{StdioTransport, Transport};
#[tokio::main]
async fn main() {
let transport = StdioTransport::new();
transport.connect().await.unwrap();
// Send and receive messages...
}
BytesThe transport follows the hybrid mutex pattern for optimal async performance:
std::sync::Mutex for state/config (short-lived locks, never cross .await)AtomicMetrics for lock-free counter updatestokio::sync::Mutex for I/O streams (necessary for async I/O)MIT