Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

transport::stdio() runs every read and write on tokio's blocking pool, which caps stdio throughput

オープン
#1,301 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

@itsmunzir がすでに取り組んでいます。

2026年9月27日 から。

  • #1304 @itsmunzir による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
58/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust

調査の方向性

Start by locating the implementation of rmcp::transport::stdio() and review how its Tokio stdin and stdout handles perform reads and writes. Run the Carmy comparison harness linked in the issue, then verify that a pipe-based path improves throughput while retaining the current fallback for TTYs, files, and Windows.

索引モデルが issue の本文から書いたものです。

説明

enhancement P2 T-transport

rmcp::transport::stdio() returns (tokio::io::Stdin, tokio::io::Stdout). In tokio, each read
from and write to these handles goes through the blocking thread pool, so every message pays a
cross-thread hand-off. Under concurrent tools/call, a profile of an rmcp stdio server
shows most of its time in __psynch_mutexwait / cvsignal, not in actual work.

When the server's stdin and stdout are pipes, which is how MCP clients launch servers,
readiness-driven pipes avoid the hand-off:

use std::os::fd::AsFd;
use tokio::net::unix::pipe;

let stdin = std::io::stdin().as_fd().try_clone_to_owned()?;
let stdout = std::io::stdout().as_fd().try_clone_to_owned()?;
// Both fail unless the descriptors are FIFOs; fall back to transport::stdio() then.
let transport = (pipe::Receiver::from_owned_fd(stdin)?, pipe::Sender::from_owned_fd(stdout)?);

The fallback keeps TTYs, files and Windows on the current path.

Numbers: the same trivial tool, 32 concurrent callers over one stdio connection, on an
Apple M3 Pro. Reproducible harness:
https://github.com/igorvieira/Carmy/tree/main/benches/compare

server throughput
rmcp 3.4 with transport::stdio() ~41k req/s
the same rmcp server over tokio::net::unix::pipe ~86k req/s
@modelcontextprotocol/sdk (TypeScript), for reference ~73k req/s

Would a pipe-based fast path in transport::stdio(), or a separate stdio_pipes()
constructor, be welcome? I'm happy to send a PR.

主要言語
Rust
スター
4k
フォーク
654
平均マージ
4日 2時間
マージ済み PR(30日)
40

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

modelcontextprotocol/rust-sdk のほかの issue

modelcontextprotocol/rust-sdk の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。