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

Function getFeaturedMCPs

apps/cursor/src/data/queries.ts:208–232  ·  view source on GitHub ↗
({
  onlyPremium,
}: {
  onlyPremium?: boolean;
} = {})

Source from the content-addressed store, hash-verified

206}
207
208export async function getFeaturedMCPs({
209 onlyPremium,
210}: {
211 onlyPremium?: boolean;
212} = {}) {
213 "use cache";
214 cacheLife("hours");
215 cacheTag("mcps");
216
217 const supabase = await createClient();
218 const { data, error } = await supabase
219 .from("mcps")
220 .select("*")
221 .limit(100)
222 .order("created_at", { ascending: false })
223 .order("order", { ascending: false })
224 .eq("active", true)
225 .or(onlyPremium ? "plan.eq.premium" : "plan.eq.featured,plan.eq.premium");
226
227 return {
228 // Shuffle so featured placement rotates between cache revalidations.
229 data: data?.sort(() => Math.random() - 0.5),
230 error,
231 };
232}
233
234export async function getTotalUsers() {
235 "use cache";

Callers

nothing calls this directly

Calls 1

createClientFunction · 0.90

Tested by

no test coverage detected