Currently, the debug flag for each MCP server is determined solely by its respective config.mjs file. To enhance flexibility and ease of debugging, it should be possible to override this debug setting via a command-line argument when launching the MCP server (e.g., gemini --debug).
This feature allows developers to enable or disable verbose logging on the fly without modifying configuration files, which is particularly useful in development and testing environments.
Resolution
Instead of modifying each server's mcp-stdio.mjs entry point, the solution was implemented by directly modifying each logger.mjs file. Each logger now checks process.argv for the presence of a --debug command-line flag. If the flag is found, it overrides the debug setting from aiConfig.debug locally within the logger's scope.
This approach is clean, avoids neo.mjs dependency, and ensures the debug flag is correctly set for each logger based on its own config and the command-line override.
Acceptance Criteria
- Each MCP server's
logger.mjs file (ai/mcp/server/github-workflow/logger.mjs, ai/mcp/server/knowledge-base/logger.mjs, ai/mcp/server/memory-core/logger.mjs) is modified.
- Within these
logger.mjs files, process.argv is parsed to detect the presence of a --debug command-line flag.
- If the
--debug flag is present, the logger's output is enabled regardless of the aiConfig.debug setting.
- The logger correctly reflects this overridden
debug state.
Currently, the
debugflag for each MCP server is determined solely by its respectiveconfig.mjsfile. To enhance flexibility and ease of debugging, it should be possible to override thisdebugsetting via a command-line argument when launching the MCP server (e.g.,gemini --debug).This feature allows developers to enable or disable verbose logging on the fly without modifying configuration files, which is particularly useful in development and testing environments.
Resolution
Instead of modifying each server's
mcp-stdio.mjsentry point, the solution was implemented by directly modifying eachlogger.mjsfile. Each logger now checksprocess.argvfor the presence of a--debugcommand-line flag. If the flag is found, it overrides thedebugsetting fromaiConfig.debuglocally within the logger's scope.This approach is clean, avoids
neo.mjsdependency, and ensures thedebugflag is correctly set for each logger based on its own config and the command-line override.Acceptance Criteria
logger.mjsfile (ai/mcp/server/github-workflow/logger.mjs,ai/mcp/server/knowledge-base/logger.mjs,ai/mcp/server/memory-core/logger.mjs) is modified.logger.mjsfiles,process.argvis parsed to detect the presence of a--debugcommand-line flag.--debugflag is present, the logger's output is enabled regardless of theaiConfig.debugsetting.debugstate.