const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
const require_tools_cli = require('../tools/cli.cjs');
const require_tools_docs = require('../tools/docs.cjs');
let node_fs = require("node:fs");
let node_path = require("node:path");
let node_url = require("node:url");
let __intlayer_config = require("@intlayer/config");
let __modelcontextprotocol_sdk_server_mcp_js = require("@modelcontextprotocol/sdk/server/mcp.js");

//#region src/server/server.ts
const dirname = __intlayer_config.isESModule ? (0, node_path.dirname)((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href)) : __dirname;
const packageJson = JSON.parse((0, node_fs.readFileSync)((0, node_path.resolve)(dirname, "../../../package.json"), "utf8"));
const loadServer = ({ isLocal }) => {
	const server = new __modelcontextprotocol_sdk_server_mcp_js.McpServer({
		name: "intlayer",
		version: packageJson.version,
		capabilities: { resources: {} }
	});
	if (isLocal) try {
		require_tools_cli.loadCLITools(server);
	} catch (error) {
		console.error("Error loading CLI tools:", error);
	}
	try {
		require_tools_docs.loadDocsTools(server);
	} catch (error) {
		console.error("Error loading docs tools:", error);
	}
	return server;
};

//#endregion
exports.dirname = dirname;
exports.loadServer = loadServer;
//# sourceMappingURL=server.cjs.map