Alcyone-Labs/simple-mcp-logger
MCP-compliant, bundling friendly, drop-in replacement for any logger with a minimal set of features. Works in Node.js and browsers.
Platform-specific configuration:
{
"mcpServers": {
"simple-mcp-logger": {
"command": "npx",
"args": [
"-y",
"simple-mcp-logger"
]
}
}
}Add the config above to .claude/settings.json under the mcpServers key.
The logging solution for MCP (Model Context Protocol) servers
SimpleMcpLogger solves a critical problem in MCP development: preventing console output from breaking MCP communication. When building MCP servers, any stray console.log() or logging output to STDOUT can corrupt the JSON-RPC protocol, causing client communication failures.
This library provides a drop-in replacement for console and popular loggers (Winston, Pino) that automatically suppresses output in MCP mode while preserving full logging functionality during development and testing.
MCP servers communicate via JSON-RPC over STDOUT/STDIN. Any non-MCP output to STDOUT breaks the protocol, but STDERR is perfectly safe for debugging:
// ❌ This breaks MCP communication (writes to STDOUT)
console.log("Debug info"); // Corrupts STDOUT → Protocol failure
logger.info("Processing request"); // Invalid MCP message → Connection lost
// ✅ This works perfectly (suppressed STDOUT, safe STDERR)
mcpLogger.info("Processing request"); // Suppressed in MCP mode
mcpLogger.mcpError("Debug info", data); // Safe: writes to STDERRKey insight: STDOUT is reserved for MCP protocol messages, but STDERR is available for debugging and logging without breaking communication.
SimpleMcpLogger ensures your MCP servers work reliably by preventing accidental STDOUT output while providing safe STDERR channels for debugging.
Loading reviews...