Skip to main content
Glama

Prisma MCP Server

Official
by prisma
Apache 2.0
4
44,192
  • Linux
  • Apple
Telemetry.ts1.52 kB
import { PrismaConfigInternal } from '@prisma/config' import { arg, Command, getCLIPathHash, getProjectHash, HelpError, isError } from '@prisma/internals' import * as checkpoint from 'checkpoint-client' /** * $ prisma telemetry */ export class Telemetry implements Command { public static new(): Telemetry { return new Telemetry() } // parse arguments public async parse(argv: string[], config: PrismaConfigInternal): Promise<string | Error> { const args = arg(argv, { '--schema': String, }) if (isError(args)) { throw new HelpError(`Invalid arguments supplied`) } const info = await checkpoint.getInfo() // SHA256 identifier for the project based on the Prisma schema path const projectPathHash = await getProjectHash(args['--schema'], config.schema) // SHA256 of the cli path const cliPathHash = getCLIPathHash() const cacheItems = info.cacheItems.map((it) => { return { product: it.output.product, version: it.version, package: it.output.package, release_tag: it.output.release_tag, cli_path: it.cli_path, cli_path_hash: it.output.cli_path_hash, last_reminder: it.last_reminder, cached_at: it.cached_at, } }) return JSON.stringify( { signature: info.signature, cachePath: info.cachePath, current: { projectPathHash, cliPathHash, }, cacheItems, }, undefined, 2, ) } }

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