Skip to main content
Glama

Browser Control MCP

by eyalzh
util.ts853 B
import * as net from 'net'; export function isPortInUse(port: number) { return new Promise((resolve) => { const server = net.createServer(); server.once('error', (err: NodeJS.ErrnoException) => { // If the error is because the port is already in use if (err.code === 'EADDRINUSE') { resolve(true); } else { // Some other error occurred console.error('Error checking port:', err); resolve(false); } }); server.once('listening', () => { // If we get here, the port is free // Close the server and resolve with false (port not in use) server.close(() => { resolve(false); }); }); // Try to listen on the port (bind to localhost) server.listen(port, 'localhost'); }); }

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/eyalzh/browser-control-mcp'

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