package com.smqjh.agent.mcp;

import java.nio.file.Path;
import java.util.concurrent.CountDownLatch;

public final class SmqjhMcpServerApplication {
    private SmqjhMcpServerApplication() {
    }

    public static void main(String[] args) throws Exception {
        Path baseDir = Path.of("").toAbsolutePath();
        AppConfig config = ConfigLoader.load(baseDir);
        ToolRegistry tools = new ToolRegistry(config);
        McpHttpServer server = new McpHttpServer(config, tools);
        server.start();
        Runtime.getRuntime().addShutdownHook(new Thread(server::stop, "smqjh-mcp-shutdown"));
        new CountDownLatch(1).await();
    }
}
