Skip to main content
Glama
prisma

Prisma MCP Server

Official
by prisma
Telemetry.ts1.72 kB
import { PrismaConfigInternal } from '@prisma/config' import { arg, Command, createSchemaPathInput, 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, baseDir: string = process.cwd(), ): 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 = getProjectHash( createSchemaPathInput({ schemaPathFromArgs: args['--schema'], schemaPathFromConfig: config.schema, baseDir, }), ) // 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, ) } }

Latest Blog Posts

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