LearnNewsExamplesServices
Frontmatter
id7534
titleImplement Centralized Logger for MCP Servers
stateClosed
labels
enhancementai
assigneestobiu
createdAtOct 18, 2025, 11:11 AM
updatedAtOct 18, 2025, 11:18 AM
githubUrlhttps://github.com/neomjs/neo/issues/7534
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtOct 18, 2025, 11:18 AM

Implement Centralized Logger for MCP Servers

Closed v11.0.0 enhancementai
tobiu
tobiu commented on Oct 18, 2025, 11:11 AM

The Model Context Protocol (MCP) servers are designed to communicate over stdio using JSON-RPC. Direct logging to stdout with console.log corrupts the message stream and breaks the server. While stderr is safe for error logging, standard diagnostic logs need to be conditional.

This ticket is to implement a centralized, debug-flag-aware logger to manage stdout logging across all MCP servers and refactor existing code to use it.

Acceptance Criteria

  1. A global debug flag is added to ai/mcp/server/config.mjs, defaulting to false.
  2. A new logger module is created at ai/mcp/server/logger.mjs.
  3. The logger module only outputs to console.log when the debug flag in aiConfig is true.
  4. All existing console.log statements in the knowledge-base and memory-core MCP server files are refactored to use the new logger module.
  5. console.error statements are not affected and should remain as they are for logging to stderr.
tobiu assigned to @tobiu on Oct 18, 2025, 11:11 AM
tobiu added the enhancement label on Oct 18, 2025, 11:11 AM
tobiu added the ai label on Oct 18, 2025, 11:11 AM
tobiu referenced in commit e477a8c - "Implement Centralized Logger for MCP Servers #7534" on Oct 18, 2025, 11:12 AM
tobiu closed this issue on Oct 18, 2025, 11:18 AM
tobiu referenced in commit e272eb7 - "Implement Centralized Logger for MCP Servers #7534" on Oct 18, 2025, 11:40 AM