- Restructure main() to accept (transport, port) params so argparse
moves into the __name__ guard block, not the function body.
- Replace the fragile __spec__.name check with a reliable basename
comparison: os.path.basename(sys.argv[0]) == os.path.basename(__spec__.origin).
Fires for `python a2a_mcp_server.py` and `python -m
molecule_runtime.a2a_mcp_server`, but NOT for test imports where
sys.argv[0] is the outer runner (pytest, python -c, etc.).
- Add missing `import uvicorn` inside _run_http_server() so the HTTP
transport actually starts (was a pre-existing bug — uvicorn was used
but never imported).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>