Prisma MCP Server logo

Prisma MCP Server

by nikomatt69

This package provides a Model Context Protocol (MCP) server that acts as an interface to a database managed by Prisma ORM. It allows MCP-compatible clients to interact with your database by querying resources and executing tools.

View on GitHub

Last updated: N/A

What is Prisma MCP Server?

The Prisma MCP Server is a package that exposes Prisma models and operations as MCP resources and tools, allowing MCP-compatible clients to interact with a database managed by Prisma ORM.

How to use Prisma MCP Server?

To use the server, install it as a dependency in your project alongside @prisma/client. Configure your Prisma schema and environment variables, generate the Prisma client, and then use the createPrismaMcpServer function to create and start the server. Configure your MCP client (like Claude Desktop) to connect using either stdio or sse transport.

Key features of Prisma MCP Server

  • Resource Loading: Exposes Prisma models as readable MCP resources

  • Tool Execution: Provides MCP tools for common CRUD operations on Prisma models

  • Database Interaction: Handles the translation between MCP requests and Prisma Client database queries

  • Configurable Transport: Supports both stdio and sse transport modes

Use cases of Prisma MCP Server

  • Connecting AI assistants to a database

  • Exposing database functionality to other applications

  • Providing a standardized interface for database interactions

  • Enabling CRUD operations on Prisma models via MCP

FAQ from Prisma MCP Server

What is MCP?

MCP stands for Model Context Protocol, a standard for communication between applications and AI assistants.

What databases are supported?

Any database supported by Prisma ORM can be used with this server (e.g., PostgreSQL, MySQL, SQLite).

How do I configure the database connection?

The database connection is configured using the DATABASE_URL environment variable.

What are the transport options?

The server supports stdio (standard input/output) and sse (Server-Sent Events over HTTP) transport modes.

How do I add custom resources or tools?

You can modify src/resources.ts and src/tools.ts to add your own custom resources and tools.