Performance
- Cap concurrent HTTP sessions with
MCP_MAX_SESSIONS(overflow → HTTP 429). - Set
MCP_SESSION_TIMEOUT_MSso idle stateful sessions die. - Prefer
MCP_STATELESS=truefor Inspector and horizontally scaled HTTP. dualtransport runs stdio + HTTP as asyncio tasks in one event loop (sharedDIContainer).- Logging to stdout under
stdiocan corrupt the protocol stream — useNITROSTACK_LOG_FILEorNITROSTACK_LOG_TO_STDOUT=trueonly when you know it is safe. NITROSTACK_HTTP_DEBUG=1logs method, path, headers, and body to stderr for client connect failures (uvicorn access logs omit this).
See Configuration and Dual Transport.