From c5482422dc961ec1f9cb5492cf26d31fe6060a2a Mon Sep 17 00:00:00 2001 From: Craig Jellick Date: Tue, 6 Oct 2026 09:59:21 -0700 Subject: [PATCH] fix: write startup errors to stderr nanobot reads the server's stdout as the MCP stdio channel, so the startup error printed there was dropped as an unparseable message and logged only as: failed to unmarshal message: invalid character 'E'. On stderr, nanobot logs the actual error. --- main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index dba563d..e237a72 100644 --- a/main.py +++ b/main.py @@ -1,5 +1,7 @@ """WordPress MCP Server main entry point.""" +import sys + from src.server import mcp @@ -10,9 +12,9 @@ def main(): from src.tools import posts, users, media, categories, tags, site mcp.run() except KeyboardInterrupt: - print("\nWordPress MCP Server shutting down...") + print("\nWordPress MCP Server shutting down...", file=sys.stderr) except Exception as e: - print(f"Error starting WordPress MCP Server: {e}") + print(f"Error starting WordPress MCP Server: {e}", file=sys.stderr) if __name__ == "__main__":