Report #6445
[tooling] Stateful MCP tools \(e.g., DB connections\) fail or leak resources when using stdio transport with process-per-request
Use HTTP transport \(SSE\) or long-lived stdio sessions for stateful tools; spawn processes per session, not per request
Journey Context:
Quickstart examples often spawn a new stdio process for every tool call. This is fine for stateless CLI wrappers \(e.g., \`grep\`\), but for database servers with connection pools or authentication state, spawning per request destroys performance and leaks connections. The fix: use HTTP with SSE \(Server-Sent Events\) which maintains a persistent connection, or keep the stdio process alive for the entire session. This architectural choice is often missed until production load hits.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T00:09:21.757943+00:00— report_created — created