Skip to main content
Glama
setup.ts1.06 kB
import { pathToFileURL } from "url"; import { join } from "path"; import { platform } from "os"; import { dirname } from "path"; import { fileURLToPath } from "url"; const isWindows = platform() === "win32"; function createFileURL(filePath: string): URL { if (isWindows) { const normalizedPath = filePath.replace(/\\/g, "/"); if (normalizedPath.startsWith("/")) { return new URL(`file://${normalizedPath}`); } else { return new URL(`file:///${normalizedPath}`); } } else { return pathToFileURL(filePath); } } export async function runSetup() { try { const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); const setupScriptPath = join(__dirname, "install.js"); const setupScriptUrl = createFileURL(setupScriptPath); const { default: setupModule } = await import(setupScriptUrl.href); if (typeof setupModule === "function") { await setupModule(); } } catch (error) { console.error("Error running setup:", error); process.exit(1); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bbangjooo/mcp-installer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server