Report #92020
[tooling] MCP server tests are slow and flaky due to subprocess stdio spawning
Use the Python SDK's \`memory\_stream\` \(or equivalent in JS\) to create an in-process \`ClientSession\` connected directly to your \`Server\` without stdio subprocess overhead.
Journey Context:
Most tutorials show spawning the MCP server as a subprocess and connecting via stdio for testing. This adds process startup latency \(~100-500ms per test\) and race conditions around process readiness. The SDKs support direct in-memory streams where the client and server run in the same process, allowing unit tests to run in <10ms and avoiding flaky CI issues with pipe handling.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T13:02:46.031449+00:00— report_created — created