Skip to main content
Glama

Prisma MCP Server

Official
by prisma
Apache 2.0
4
44,192
  • Linux
  • Apple
CompositeFilesResolver.ts1.59 kB
import { createFileNameToKeyMapper, FileNameToKeyMapper } from './caseSensitivity' import { CaseSensitivityOptions, FilesResolver, FsEntryType } from './types' /** * Files resolver that combines two other resolvers * together. Files existing in either one of those will be * reported. If content exist in both, primary resolver takes * precedence */ export class CompositeFilesResolver implements FilesResolver { private _fileNameToKey: FileNameToKeyMapper constructor( private primary: FilesResolver, private secondary: FilesResolver, options: CaseSensitivityOptions, ) { this._fileNameToKey = createFileNameToKeyMapper(options) } async listDirContents(path: string): Promise<string[]> { const primaryContent = await this.primary.listDirContents(path) const secondaryContent = await this.secondary.listDirContents(path) return uniqueWith([...primaryContent, ...secondaryContent], this._fileNameToKey) } async getEntryType(path: string): Promise<FsEntryType | undefined> { return (await this.primary.getEntryType(path)) ?? (await this.secondary.getEntryType(path)) } async getFileContents(path: string): Promise<string | undefined> { return (await this.primary.getFileContents(path)) ?? (await this.secondary.getFileContents(path)) } } function uniqueWith(fileNames: string[], toKey: FileNameToKeyMapper): string[] { const map = new Map<string, string>() for (const fileName of fileNames) { const key = toKey(fileName) if (!map.has(key)) { map.set(key, fileName) } } return Array.from(map.values()) }

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