- Capture a baseline with
time bin/mcp-bash < sample.json(or the compatibility fixture intest/compatibility/) before making concurrency or timeout changes. - Run
test/integration/test_capabilities.shto exercise discovery, pagination, and registry notifications under load. - Use
MCPBASH_DEBUG_PAYLOADS=truesparingly while debugging to avoid skewing timings with disk I/O.
- Static registry mode: Bundles use static registry mode by default for optimal cold start - no configuration needed. For non-bundle production deployments, set
MCPBASH_STATIC_REGISTRY=1to skip runtime discovery and load pre-generated.registry/*.jsoncaches directly. This eliminates cold-start overhead from filesystem scans. To opt out of static mode in bundles, setMCPB_STATIC=falseinmcpb.conf. - Concurrency:
MCPBASH_MAX_CONCURRENT_REQUESTS(default 16) sets worker slots. Increase gradually and watch CPU steal/memory pressure; decrease on small hosts. - Timeouts: Set per-tool
timeoutSecsin<tool>.meta.json; global default comes fromMCPBASH_DEFAULT_TOOL_TIMEOUT(30s by default). - Registry scans: Adjust TTLs (
MCP_TOOLS_TTL,MCP_RESOURCES_TTL,MCP_PROMPTS_TTL) and scope (MCPBASH_REGISTRY_REFRESH_PATH) to reduce filesystem churn on large trees. - Very large registries: If you have hundreds/thousands of tools/resources/prompts, prefer manual registration hooks over auto-discovery to avoid
find/statoverhead across huge trees. - Resource polling:
MCPBASH_RESOURCES_POLL_INTERVAL_SECScontrols subscription polling (poller starts after the firstresources/subscribe); use0to disable when live updates are unnecessary. - Progress streaming:
MCPBASH_ENABLE_LIVE_PROGRESS=truestreams progress/log updates mid-flight (starts a background flusher); tuneMCPBASH_PROGRESS_FLUSH_INTERVAL(seconds) to balance responsiveness vs overhead.
- Enable
MCPBASH_LOG_LEVEL=debugto log registry fast-path decisions, path resolution, and worker lifecycle events. AddMCPBASH_LOG_VERBOSE=trueto include full paths in debug output (increases log volume; disable after troubleshooting). - Inspect
.registry/*.jsonsizes and counts when pagination feels slow; large registries may warrant manual registration or narrower scan roots. - Use
ps/top/htopto spot runaway tools; aligntimeoutSecsand watchdogs inlib/timeout.shwith observed runtimes. - On Windows/MSYS, prefer shorter TTLs and smaller payloads to offset filesystem overhead; watch for
MSYS2_ARG_CONV_EXCLquirks in provider scripts.