"""MENTORR — Unified MCP server for lutherie workflows.

Entry point for the `mentorr-server` CLI command.
Consolidates all 4 domain modules (Physics, Inventory, Logic, Guide)
into a single FastMCP instance.
"""

from mcp.server.fastmcp import FastMCP


def create_server() -> FastMCP:
    """Create and configure the unified MENTORR MCP server."""
    mcp = FastMCP("MENTORR")

    from mentorr import physics, inventory, logic, guide

    physics.register(mcp)
    inventory.register(mcp)
    logic.register(mcp)
    guide.register(mcp)

    return mcp


def main():
    """CLI entry point — starts the MENTORR MCP server over stdio."""
    from dotenv import load_dotenv

    load_dotenv()

    server = create_server()
    server.run(transport="stdio")


if __name__ == "__main__":
    main()
