23 releases (7 breaking)
| 0.9.0 | Mar 13, 2026 |
|---|---|
| 0.6.3 | Nov 23, 2025 |
| 0.4.0 | Jul 3, 2025 |
| 0.1.1 | Mar 30, 2025 |
#741 in Network programming
16,991 downloads per month
Used in 43 crates
(2 directly)
195KB
3.5K
SLoC
rust-mcp-transport.
rust-mcp-transport is a part of the rust-mcp-sdk ecosystem, offering transport implementations for the MCP (Model Context Protocol). It enables asynchronous data exchange and efficient MCP message handling between MCP Clients and Servers.
Usage Example
For MCP Server
use rust_mcp_transport::{StdioTransport, TransportOptions};
// create a stdio transport to be used in a MCP Server
let transport = StdioTransport::new(TransportOptions { timeout: 60_000 })?;
Refer to the Hello World MCP Server example for a complete demonstration.
For MCP Client
use rust_mcp_transport::{StdioTransport, TransportOptions};
// create a stdio transport that launches `server-everything` MCP Server
let transport = StdioTransport::create_with_server_launch(
"npx",
vec!["-y".to_string(), "@modelcontextprotocol/server-everything"],
None,
TransportOptions { timeout: 60_000 }
)?;
With environment variables:
use rust_mcp_transport::{StdioTransport, TransportOptions};
// environment variables will be available to the MCP server at launch time
let environment_value = HashMap::from([(
"API_KEY".to_string(),
"A1B2C3D4E5F6G7H8I9J0K1L2M3N4O5P6".to_string(),
)]);
// configure an arbitrary MCP Server to launch with argument and environment variables
let transport = StdioTransport::create_with_server_launch(
"your-mcp-server",
vec!["argument".to_string()],
Some(environment_value),
TransportOptions::default(),
)?;
Refer to the Simple MCP Client example for a complete demonstration.
Check out rust-mcp-sdk , a high-performance, asynchronous toolkit for building MCP servers and clients. Focus on your app's logic while rust-mcp-sdk takes care of the rest!
Dependencies
~11–20MB
~258K SLoC