MCPcopy Create free account
hub / github.com/cursor/community-plugins / getMCPs

Function getMCPs

apps/cursor/src/data/queries.ts:265–296  ·  view source on GitHub ↗
({
  page = 1,
  limit = 36,
  fetchAll = false,
}: {
  page?: number;
  limit?: number;
  fetchAll?: boolean;
} = {})

Source from the content-addressed store, hash-verified

263}
264
265export async function getMCPs({
266 page = 1,
267 limit = 36,
268 fetchAll = false,
269}: {
270 page?: number;
271 limit?: number;
272 fetchAll?: boolean;
273} = {}) {
274 "use cache";
275 cacheLife("hours");
276 cacheTag("mcps");
277
278 const supabase = await createClient();
279
280 const baseQuery = () =>
281 supabase
282 .from("mcps")
283 .select("*")
284 .eq("active", true)
285 .order("company_id", { ascending: true, nullsFirst: false });
286
287 if (fetchAll) {
288 return fetchAllPages((from, to) => baseQuery().range(from, to), 100);
289 }
290
291 const { data, error } = await baseQuery()
292 .limit(limit)
293 .range((page - 1) * limit, page * limit - 1);
294
295 return { data, error };
296}
297
298export async function getRecentMCPs({ limit = 8 }: { limit?: number } = {}) {
299 "use cache";

Callers

nothing calls this directly

Calls 3

createClientFunction · 0.90
fetchAllPagesFunction · 0.90
baseQueryFunction · 0.70

Tested by

no test coverage detected