Skip to main content
Glama

MCP Auth

by rubenpenap
fix-watch.js1.48 kB
import path from 'node:path' import { fileURLToPath } from 'node:url' import chokidar from 'chokidar' import { $ } from 'execa' const __dirname = path.dirname(fileURLToPath(import.meta.url)) const here = (...p) => path.join(__dirname, ...p) const workshopRoot = here('..') // Watch the exercises directory const watcher = chokidar.watch(path.join(workshopRoot, 'exercises'), { ignored: [ /(^|[\/\\])\../, // ignore dotfiles (path) => { // Only watch directories up to depth 2 const relativePath = path.slice(workshopRoot.length + 1) return relativePath.split('/').length > 4 }, ], persistent: true, ignoreInitial: true, }) const debouncedRun = debounce(run, 200) // Add event listeners. watcher .on('addDir', (path) => { debouncedRun() }) .on('unlinkDir', (path) => { debouncedRun() }) .on('error', (error) => console.log(`Watcher error: ${error}`)) /** * Simple debounce implementation */ function debounce(fn, delay) { let timer = null return (...args) => { if (timer) clearTimeout(timer) timer = setTimeout(() => { fn(...args) }, delay) } } let running = false async function run() { if (running) { console.log('still running...') return } running = true try { await $({ stdio: 'inherit', cwd: workshopRoot, })`node ./epicshop/fix.js` } catch (error) { throw error } finally { running = false } } console.log('Watching exercises directory for changes...') console.log('running fix to start...') run()

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/rubenpenap/mcp-auth'

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