Files
dev/codex-rs/stdio-to-uds/README.md
zeekayandHanzo Dev 54a8eed885 port: adopt latest openai/codex codex-rs base (2026-06-16, 33d5023)
Wholesale-adopt latest upstream codex-rs (97 crates, new architecture:
model-provider-info crate, app-server-daemon/transport, code-mode-host,
thread-store, file-watcher, etc.). Hanzo-only crates (browser, debug-client,
instructions, tui2) preserved on disk (not yet re-added to workspace). Builds
clean as upstream (codex bin). Hanzo overlay (dev bin, api.hanzo.ai default,
hanzo.id/Claude login, branding) re-applied in following commits.

Co-authored-by: Hanzo Dev <[email protected]>
2026-06-16 21:24:01 -07:00

1.0 KiB

codex-stdio-to-uds

Traditionally, there are two transport mechanisms for an MCP server: stdio and HTTP.

This crate helps enable a third, which is UNIX domain socket, because it has the advantages that:

  • The UDS can be attached to long-running process, like an HTTP server.
  • The UDS can leverage UNIX file permissions to restrict access.

To that end, this crate provides an adapter between a UDS and stdio. The idea is that someone could start an MCP server that communicates over /tmp/mcp.sock. Then the user could specify this on the fly like so:

codex --config mcp_servers.example={command="codex-stdio-to-uds",args=["/tmp/mcp.sock"]}

Unfortunately, the Rust standard library does not provide support for UNIX domain sockets on Windows today even though support was added in October 2018 in Windows 10:

https://github.com/rust-lang/rust/issues/56533

As a workaround, this crate uses codex-uds, which provides a cross-platform async UDS API backed by https://crates.io/crates/uds_windows on Windows.