Skip to main content
Glama

Convex MCP server

Official
by get-convex
useRefresh.ts708 B
import { useEffect, useReducer } from "react"; let oncePerSecondTimer: ReturnType<typeof setInterval>; let nextId = 1; const callbacks = new Map<number, () => void>(); function callCallbacks() { for (const cb of callbacks.values()) { cb(); } } export function useRefresh(timeout = 1000) { const [, forceUpdate] = useReducer((x) => x + 1, 0); useEffect(() => { const id = nextId++; if (callbacks.size === 0) { oncePerSecondTimer = setInterval(callCallbacks, timeout); } callbacks.set(id, forceUpdate); return () => { callbacks.delete(id); if (callbacks.size === 0) { clearInterval(oncePerSecondTimer); } }; }, [forceUpdate, timeout]); }

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/get-convex/convex-backend'

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