#!/usr/bin/env python3 """Start the Hermes CLI, but load the MCP SDK first. tools/mcp_tool._ensure_mcp_sdk() returns early as soon as ClientSession is set. The CLI sets that name during its own import, so by the time a transport runs the HTTP/stdio symbols were never computed and every MCP server - new or old - fails with "requires HTTP transport" or "SDK not installed". Calling the very same helper once, before the CLI is imported, lets it do its work. A failure here must never block the CLI: prime, then hand over regardless. """ import sys APP = "/home/stdio/kitt/app/hermes-agent" if APP not in sys.path: sys.path.insert(0, APP) try: import tools.mcp_tool as _mcp _mcp._ensure_mcp_sdk() except Exception: # noqa: BLE001 - CLI must start pass from hermes_cli.main import main # noqa: E402 if __name__ == "__main__": sys.exit(main())