"""入口：启动 MCP 协议网关，把算法型工具注册到 NATS。"""

from __future__ import annotations

import asyncio
import logging

from .mcp_gateway import McpGateway

logging.basicConfig(level=logging.INFO)
log = logging.getLogger("mcp_py")


async def _run() -> None:
    gateway = McpGateway()
    await gateway.register_tools()  # secure_sandbox / parse_document / run_code
    log.info("[mcp_py] serving MCP over sundynix.tools.py.*")
    await gateway.serve()


def main() -> None:
    asyncio.run(_run())


if __name__ == "__main__":
    main()
