This commit is contained in:
Taylor Wilsdon
2026-03-17 10:42:32 -04:00
parent 96df53c5e9
commit ffcea58fdc

View File

@@ -7,11 +7,12 @@ import sys
from importlib import metadata, import_module
from dotenv import load_dotenv
# Prevent any stray output (e.g. platform identifiers like "darwin" on macOS)
# from corrupting the MCP JSON-RPC handshake on stdout. We capture anything
# written to stdout during module-level initialisation and replay it to stderr
# so that diagnostic information is not lost.
# Prevent any stray startup output on macOS (e.g. platform identifiers) from
# corrupting the MCP JSON-RPC handshake on stdout. We capture anything written
# to stdout during module-level initialisation and replay it to stderr so that
# diagnostic information is not lost.
_original_stdout = sys.stdout
if sys.platform == "darwin":
sys.stdout = io.StringIO()
# Check for CLI mode early - before loading oauth_config