File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -599,12 +599,21 @@ async def get_stealth_cdp_endpoint() -> dict:
599599
600600def main () -> None :
601601 """Console entry point (``tilion-mcp`` / ``python -m tilion.mcp``)."""
602+ # Windows consoles default to cp1252, so any non-latin1 glyph in a log line raises
603+ # UnicodeEncodeError and can kill the server. Force UTF-8 on the streams (JSON-RPC is
604+ # UTF-8 anyway) so no banner/log character can ever crash it. The banner itself is
605+ # kept ASCII as belt-and-suspenders.
606+ for _stream in (sys .stdout , sys .stderr ):
607+ try :
608+ _stream .reconfigure (encoding = "utf-8" , errors = "backslashreplace" )
609+ except Exception :
610+ pass
602611 # Banner to STDERR only — stdout is the MCP stdio transport and must stay clean.
603612 print (
604- "Tilion · Fortress Stealth-Browser MCP [Beta]\n "
605- " 26 tools · local & free · hosted cloud (residential egress) coming soon\n "
606- " docs: DOCUMENTATION.md more coming — benchmarks in the README\n "
607- " listening on stdio… " ,
613+ "Tilion Fortress Stealth-Browser MCP [Beta]\n "
614+ " 26 tools | local & free | hosted cloud (residential egress) coming soon\n "
615+ " docs: DOCUMENTATION.md - more coming; benchmarks in the README\n "
616+ " listening on stdio... " ,
608617 file = sys .stderr , flush = True ,
609618 )
610619 mcp .run ()
You can’t perform that action at this time.
0 commit comments