Astral's Charlie Marsh: lazy-started, cross-thread cached MCP servers cut 30 processes to 3

charliermarsh · x · 2026-12-01

Charlie Marsh (Ruff/Astral) shares an MCP engineering optimization: cache the server list across threads and start servers lazily, only when the model first invokes one of their tools.

With three sharing-capable MCP servers and ten threads, this cuts spawned processes from 30 to 3. Even stateful MCPs without sharing support benefit — e.g., an installed Playwright MCP is no longer eagerly spawned on every thread; a single cached copy starts, with subsequent copies created lazily.

Related event: Codex Cuts MCP Processes from 30 to 3 with Caching and Lazy Startup(2 posts)→

Original post →

More from coding & agent

coding & agent channel →