Skip to main content
Glama

Prisma MCP Server

Official
by prisma
Apache 2.0
4
44,192
  • Linux
  • Apple
cleanupCache.ts1.09 kB
import fs from 'node:fs' import path from 'node:path' import Debug from '@prisma/debug' import pMap from 'p-map' import { getRootCacheDir } from './utils' const debug = Debug('cleanupCache') export async function cleanupCache(n = 5): Promise<void> { try { const rootCacheDir = await getRootCacheDir() if (!rootCacheDir) { debug('no rootCacheDir found') return } const channel = 'master' const cacheDir = path.join(rootCacheDir, channel) const dirs = await fs.promises.readdir(cacheDir) const dirsWithMeta = await Promise.all( dirs.map(async (dirName) => { const dir = path.join(cacheDir, dirName) const statResult = await fs.promises.stat(dir) return { dir, created: statResult.birthtime, } }), ) dirsWithMeta.sort((a, b) => (a.created < b.created ? 1 : -1)) const dirsToRemove = dirsWithMeta.slice(n) await pMap(dirsToRemove, (dir) => fs.promises.rm(dir.dir, { force: true, recursive: true }), { concurrency: 20 }) } catch (e) { // fail silently } }

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/prisma/prisma'

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