#ipc #mcp #transport #unix-socket

turbomcp-unix

Unix domain socket transport implementation for the TurboMCP SDK

24 releases (stable)

Uses new Rust 2024

new 3.1.0 Apr 20, 2026
3.0.14 Apr 15, 2026
3.0.10 Mar 27, 2026
3.0.0-exp.2 Jan 13, 2026
3.0.0-beta.5 Feb 24, 2026

#58 in #unix-socket

Download history 4/week @ 2026-01-28 1/week @ 2026-02-04 10/week @ 2026-02-18 1/week @ 2026-02-25 80/week @ 2026-03-04 39/week @ 2026-03-11 8/week @ 2026-03-18 23/week @ 2026-03-25 9/week @ 2026-04-01 17/week @ 2026-04-08

62 downloads per month
Used in 8 crates (via turbomcp-transport)

MIT license

1MB
19K SLoC

turbomcp-unix

Unix domain socket transport implementation for the TurboMCP SDK.

Overview

This crate provides Unix domain socket transport with:

  • Server Mode: Accept multiple client connections with automatic handling
  • Client Mode: Connect to a Unix socket server
  • Bidirectional Communication: Full-duplex message exchange
  • Backpressure Handling: Bounded channels prevent memory exhaustion
  • Graceful Shutdown: Clean task termination and socket cleanup
  • Message Framing: Uses LinesCodec for reliable newline-delimited JSON
  • Security: Configurable file permissions (default 0o600)

Installation

[dependencies]
turbomcp-unix = "3.0"

Or use through the main transport crate:

[dependencies]
turbomcp-transport = { version = "3.0.2", features = ["unix"] }

Quick Start

Server Mode

use turbomcp_unix::{UnixTransport, UnixTransportBuilder};
use turbomcp_transport_traits::Transport;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let transport = UnixTransportBuilder::new_server()
        .socket_path("/tmp/my-mcp.sock")
        .permissions(0o600)
        .build();

    transport.connect().await?; // Starts listening
    Ok(())
}

Client Mode

use turbomcp_unix::{UnixTransport, UnixTransportBuilder};
use turbomcp_transport_traits::Transport;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let transport = UnixTransportBuilder::new_client()
        .socket_path("/tmp/my-mcp.sock")
        .build();

    transport.connect().await?;
    Ok(())
}

v3.0 Modular Architecture

This crate is part of TurboMCP v3.0's modular transport architecture:

  • Foundation: turbomcp-transport-traits provides core abstractions
  • Individual Transports: Each transport (stdio, http, websocket, tcp, unix) is a separate crate
  • Backward Compatibility: turbomcp-transport re-exports all transports

License

MIT

Dependencies

~17–26MB
~365K SLoC