import { build } from "esbuild"; import { resolve, dirname } from "node:path"; import { fileURLToPath } from "node:url"; const __dirname = dirname(fileURLToPath(import.meta.url)); await build({ entryPoints: [resolve(__dirname, "../src/mcp-server.ts")], bundle: true, platform: "node", target: "node20", format: "esm", outfile: resolve(__dirname, "../dist/mcp-server.mjs"), external: [], banner: { js: "#!/usr/bin/env node" }, // Inline all deps — the output is a self-contained script }); console.log("Built dist/mcp-server.mjs");