Add a minimal runtime stdio MCP launcher that spawns configured server processes with piped stdin/stdout, applies transport env, and exposes async write/read/terminate/wait helpers for future JSON-RPC integration. The wrapper stays intentionally small: it does not yet implement protocol framing or connection lifecycle management, but it is real process orchestration rather than placeholder scaffolding. Tests use a temporary executable script to prove env propagation and bidirectional stdio round-tripping. Constraint: Keep the slice minimal and testable while using the real tokio process surface Constraint: Runtime verification must pass cleanly under fmt, clippy, and tests Rejected: Add full JSON-RPC framing and session orchestration in the same commit | too much scope for a clean launcher slice Rejected: Fake the process wrapper behind mocks only | would not validate spawning, env injection, or stdio wiring Confidence: high Scope-risk: narrow Reversibility: clean Directive: Layer future MCP protocol framing on top of McpStdioProcess rather than bypassing it with ad hoc process management Tested: cargo fmt --all; cargo clippy -p runtime --all-targets -- -D warnings; cargo test -p runtime Not-tested: live third-party MCP servers; long-running process supervision; stderr capture policy
Rust port foundation
This directory contains the first compatibility-first Rust foundation for a drop-in Claude Code CLI replacement.
Current milestone
This initial milestone focuses on harness-first scaffolding, not full feature parity:
- a Cargo workspace aligned to major upstream seams
- a placeholder CLI crate (
rusty-claude-cli) - runtime, command, and tool registry skeleton crates
- a
compat-harnesscrate that reads the upstream TypeScript sources in../src/ - tests that prove upstream manifests/bootstrap hints can be extracted from the leaked TypeScript codebase
Workspace layout
rust/
├── Cargo.toml
├── README.md
├── crates/
│ ├── rusty-claude-cli/
│ ├── runtime/
│ ├── commands/
│ ├── tools/
│ └── compat-harness/
└── tests/
How to use
From this directory:
cargo fmt --all
cargo check --workspace
cargo test --workspace
cargo run -p rusty-claude-cli -- --help
cargo run -p rusty-claude-cli -- dump-manifests
cargo run -p rusty-claude-cli -- bootstrap-plan
Design notes
The shape follows the PRD's harness-first recommendation:
- Extract observable upstream command/tool/bootstrap facts first.
- Keep Rust module boundaries recognizable.
- Grow runtime compatibility behind proof artifacts.
- Document explicit gaps instead of implying drop-in parity too early.
Relationship to the root README
The repository root README explains the leaked TypeScript codebase. This document tracks the Rust replacement effort that lives in rust/.