Fix MCP server startup for Claude Code compatibility
- Suppress stderr output (Claude Code rejects servers with stderr) - Make SyncEngine.start() non-blocking (blocking sync caused 15s+ timeout) - Skip Content-Length header lines gracefully (NDJSON transport) - Silently ignore malformed JSON lines instead of sending error responses
This commit is contained in:
parent
be9e6352c3
commit
a52afe050d
2 changed files with 8 additions and 18 deletions
|
|
@ -87,14 +87,7 @@ class SyncEngine:
|
|||
return self._last_sync_success
|
||||
|
||||
def start(self) -> None:
|
||||
"""Run initial sync (blocking), then start background thread."""
|
||||
try:
|
||||
self._sync_once()
|
||||
self._last_sync_success = True
|
||||
except Exception:
|
||||
logger.warning("Initial sync failed, starting in offline mode")
|
||||
self._last_sync_success = False
|
||||
|
||||
"""Start background sync thread (non-blocking)."""
|
||||
self._thread = threading.Thread(target=self._sync_loop, daemon=True)
|
||||
self._thread.start()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue