Skip to main content
Glama

Ultimate MCP Coding Platform

http.js681 B
import fetch from 'node-fetch'; export async function waitForEndpoint(url, { timeoutMs = 120000, intervalMs = 3000, expectedStatus = 200 } = {}) { const start = Date.now(); let lastError; while (Date.now() - start < timeoutMs) { try { const response = await fetch(url, { timeout: intervalMs }); if (response.status === expectedStatus) { return true; } lastError = new Error(`Unexpected status ${response.status}`); } catch (error) { lastError = error; } await new Promise((resolve) => setTimeout(resolve, intervalMs)); } if (lastError) { throw lastError; } throw new Error(`Timed out waiting for ${url}`); }

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/Senpai-Sama7/Ultimate_MCP'

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