Skip to main content
Glama

Prisma MCP Server

Official
by prisma
Apache 2.0
4
44,192
  • Linux
  • Apple
Interface.test.ts1.8 kB
import { expect, test } from 'vitest' import { genericParameter } from './GenericParameter' import { interfaceDeclaration } from './Interface' import { method } from './Method' import { namedType } from './NamedType' import { property } from './Property' import { stringify } from './stringify' const A = namedType('A') test('empty', () => { const obj = interfaceDeclaration('MyInterface') expect(stringify(obj)).toMatchInlineSnapshot(` "interface MyInterface {} " `) }) test('with property', () => { const obj = interfaceDeclaration('SomeInterface').add(property('foo', A)) expect(stringify(obj)).toMatchInlineSnapshot(` "interface SomeInterface { foo: A }" `) }) test('with method', () => { const obj = interfaceDeclaration('MyInterface').add(method('doThing')) expect(stringify(obj)).toMatchInlineSnapshot(` "interface MyInterface { doThing(): void }" `) }) test('with generic parameter', () => { const obj = interfaceDeclaration('SomeInterface') .addGenericParameter(genericParameter('T').extends(namedType('U'))) .add(property('foo', A)) expect(stringify(obj)).toMatchInlineSnapshot(` "interface SomeInterface<T extends U> { foo: A }" `) }) test('extending the type', () => { const obj = interfaceDeclaration('SomeInterface').extends(namedType('Foo')).add(property('foo', A)) expect(stringify(obj)).toMatchInlineSnapshot(` "interface SomeInterface extends Foo { foo: A }" `) }) test('extending multiple types', () => { const obj = interfaceDeclaration('SomeInterface') .extends(namedType('Foo')) .extends(namedType('Bar')) .add(property('foo', A)) expect(stringify(obj)).toMatchInlineSnapshot(` "interface SomeInterface extends Foo, Bar { foo: A }" `) })

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