Skip to main content
Glama
openBrowser.ts492 B
import { exec } from 'node:child_process'; import { platform } from 'node:os'; export const openBrowser = (url: string) => { const osPlatform = platform(); let command = ''; if (osPlatform === 'darwin') { command = `open "${url}"`; } else if (osPlatform === 'win32') { command = `start "${url}"`; } else { command = `xdg-open "${url}"`; } exec(command, (error) => { if (error) { console.error(`Failed to open browser: ${error.message}`); } }); };

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/aymericzip/intlayer'

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