[bug] mempalace mcp writes startup text to stdout instead of stderr, breaking Claude Desktop JSON parsing
Labels: bug
Version: 3.0.0
Environment
- OS: Windows 11 Pro 64-bit
- Python: 3.10
- mempalace: 3.0.0
- Client: Claude Desktop 1.1062.0
Describe the bug
When Claude Desktop launches mempalace mcp as an MCP subprocess, it receives repeated JSON parse errors because MemPalace writes human-readable startup text to stdout instead of stderr. The MCP protocol communicates over stdio, so any non-JSON text on stdout corrupts the message stream.
Errors shown in Claude Desktop UI
MCP mempalace: Unexpected token '*', "**********"... is not valid JSON
MCP mempalace: Unexpected token 'E', "EP Error D"... is not valid JSON
MCP mempalace: Unexpected token 'w', " when using"... is not valid JSON
MCP mempalace: Unexpected token 'F', "Falling ba"... is not valid JSON
Steps to reproduce
mempalace status 2>nul # all output goes to stdout — confirmed
mempalace status 1>nul # stderr is empty — confirmed
Expected behavior
All startup messages, banners, warnings, and status text should be written to stderr. Stdout must carry only valid JSON-RPC messages when running in MCP mode (mempalace mcp). Ideally, MCP mode should suppress all non-protocol output entirely.
Suggested fix
if mode == "mcp":
# redirect all print/logging to stderr
sys.stdout = sys.stderr # or use logging.basicConfig(stream=sys.stderr)
# suppress decorative banners entirely
[bug] mempalace mcp writes startup text to stdout instead of stderr, breaking Claude Desktop JSON parsing
Labels: bug
Version: 3.0.0
Environment
Describe the bug
When Claude Desktop launches
mempalace mcpas an MCP subprocess, it receives repeated JSON parse errors because MemPalace writes human-readable startup text to stdout instead of stderr. The MCP protocol communicates over stdio, so any non-JSON text on stdout corrupts the message stream.Errors shown in Claude Desktop UI
Steps to reproduce
Expected behavior
All startup messages, banners, warnings, and status text should be written to stderr. Stdout must carry only valid JSON-RPC messages when running in MCP mode (
mempalace mcp). Ideally, MCP mode should suppress all non-protocol output entirely.Suggested fix