transport::stdio() runs every read and write on tokio's blocking pool, which caps stdio throughput
Maintainer antworten meist innerhalb von 3 Tagen
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 58/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- rust
- Bereich
- networking, performance
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Rust
- Sterne
- 4k
- Forks
- 654
- Ø Merge
- 4 T. 3 Std.
- Gemergte PRs (30 T.)
- 40
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus modelcontextprotocol/rust-sdk
-
P3 question T-documentation T-enhancement
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 86/100
modelcontextprotocol/rust-sdk#1155 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
LocalSessionManager session workers don't cancel in-flight tool calls on client disconnect (follow-up to #857)Evtl. vergeben @kkkhs hat das heute übernommen. Offenbug P1 ready for work T-transport
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
modelcontextprotocol/rust-sdk#1325 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
streamable-http server: client responses to server-initiated requests (sampling/elicitation/roots) are 202-accepted and silently discarded under the 2026-07-28 protocol — the pending request hangs foreverEvtl. vergeben @DaleSeo hat das vor 1 Tag übernommen. Offenbug P1 ready for work T-transport
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
modelcontextprotocol/rust-sdk#1321 · 1 Reaktion · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Bound pre-lifecycle bootstrap attempts in server initializationEvtl. vergeben @DaleSeo hat das vor 5 Tagen übernommen. Offenenhancement P2 T-service T-transport
modelcontextprotocol/rust-sdk#1315 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 3 Tagen
-
ProgressDispatcher: a slow progress subscriber blocks subscribe() and delivery for other tokensEvtl. vergeben @monody0007 hat das vor 9 Tagen übernommen. Offenbug P1 ready for work T-handler
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
modelcontextprotocol/rust-sdk#1312 ·
Maintainer antworten meist innerhalb von 3 Tagen
Alle Issues in modelcontextprotocol/rust-sdk
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
bmander/geomsolver#118 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Three Windows builds are keyed on a later release than their layoutEvtl. vergeben @ero-qt hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 95/100
Maintainer antworten meist innerhalb von 1 Tag
-
Markdown Preview Fonts Don't Show Selected OptionEvtl. vergeben @RadhiRasho hat das heute übernommen. Offenstate:needs triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 61/100
zed-industries/zed#65300 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 73/100
Maintainer antworten meist innerhalb von 1 Tag