#!/usr/bin/env python3
"""
Claude/ChatGPT Desktop MCP bridge wrapper.

Sets the default MCP HTTP URL for ChatGPT Desktop and forwards execution to
the shared bridge script.
"""
from __future__ import annotations

import os
import sys
from pathlib import Path


def main() -> int:
    os.environ.setdefault("MCP_HTTP_URL", "http://localhost:8000/api/v1/mcp/chatgpt")
    bridge_path = Path(__file__).resolve().parent / "mcp_http_bridge.py"
    if not bridge_path.exists():
        print("Bridge script not found at scripts/mcp_http_bridge.py", file=sys.stderr)
        return 1
    os.execv(sys.executable, [sys.executable, str(bridge_path), *sys.argv[1:]])
    return 0


if __name__ == "__main__":
    raise SystemExit(main())
