"""Entry point for memory-nexus-mcp when installed as a package."""

import os
import sys


def main() -> None:
    api_key = os.environ.get("MEMORY_NEXUS_API_KEY", "")
    if not api_key:
        print(
            "Error: MEMORY_NEXUS_API_KEY environment variable is required.\n"
            "Get one at https://memory-nexus.org",
            file=sys.stderr,
        )
        sys.exit(1)

    from mcp_server.server import mcp
    mcp.run()


if __name__ == "__main__":
    main()
