Prisma MCP Server logo

Prisma MCP Server

by CADCAMFUN

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 server 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?

Install the package and Prisma Client in your consuming project. 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 (e.g., Claude Desktop) to connect to the server 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.

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

  • Configurable Transport: Supports both stdio and sse transport modes.

Use cases of Prisma MCP Server

  • Connecting AI assistants to a database.

  • Enabling MCP clients to query and manipulate data in a Prisma-managed database.

  • Building custom tools and resources for interacting with application services.

  • Providing a standardized interface for accessing data across different applications.

FAQ from Prisma MCP Server

What is the purpose of the Prisma MCP Server?

It provides an interface for MCP-compatible clients to interact with a database managed by Prisma ORM.

What are the prerequisites for using this server?

Node.js, Yarn or npm, Prisma Client, and a running database instance supported by Prisma.

How do I configure the transport type?

Set the TRANSPORT_TYPE environment variable to either stdio or sse.

How do I connect Claude Desktop to the server?

Configure Claude Desktop to either launch the server process directly (stdio) or connect to the HTTP endpoint (sse).

Can I add custom resources and tools?

Yes, you can extend the server by modifying src/resources.ts and src/tools.ts.