Skip to content

[bug] mempalace mcp writes startup text to stdout instead of stderr, breaking Claude Desktop JSON parsing #225

@alexschneiderru

Description

@alexschneiderru

[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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/mcpMCP server and toolsarea/windowsWindows-specific bugs and compatibilitybugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions