"""Sentinel MCP 서버 — FastMCP stdio 기반.

Usage:
    sentinel-mcp          # stdio 모드 (Claude Desktop / Cursor)
"""

import logging

from fastmcp import FastMCP

from sentinel.mcp.read_tools import register_read_tools
from sentinel.mcp.analyze_tools import register_analyze_tools
from sentinel.mcp.draft_tools import register_draft_tools
from sentinel.mcp.governance_tools import register_governance_tools

logger = logging.getLogger("sentinel.mcp")

mcp = FastMCP(
    "Sentinel",
    instructions="Governable AI Operations Control Plane — LLMOps 관리 MCP 서버",
)

# Tool 등록
register_read_tools(mcp)
register_analyze_tools(mcp)
register_draft_tools(mcp)
register_governance_tools(mcp)


def main():
    """CLI 진입점."""
    import dotenv

    dotenv.load_dotenv()
    logging.basicConfig(level=logging.INFO)
    logger.info("Sentinel MCP 서버 시작 (stdio)")
    mcp.run()


if __name__ == "__main__":
    main()
