---
name: prisma
description: Build type-safe TypeScript and Node.js apps with Prisma ORM and Prisma Postgres. Covers the core Prisma CLI workflow (init, migrate, generate, studio), connecting to a Prisma Postgres database, and the remote Prisma MCP server for managing databases, Compute deployments, and Object Storage from AI tools.
license: Apache-2.0
compatibility: ">=0.1.0"
metadata:
  homepage: https://www.prisma.io
  documentation: https://www.prisma.io/docs
  vendor: Prisma
  version: "1.0.0"
allowed-tools:
  - Bash
  - Read
  - Edit
  - Write
---

# Prisma

Use this skill to model and query data with Prisma ORM, connect to Prisma
Postgres databases, and manage Prisma Compute apps and Object Storage buckets
through the [Prisma MCP server](https://www.prisma.io/docs/ai/tools/mcp-server).

> Prisma changes frequently. Before implementing Prisma features, check the
> changelog at https://www.prisma.io/changelog.md and the documentation at https://www.prisma.io/docs. Do not rely
> solely on training data for Prisma APIs, configuration, or conventions — these
> can change between versions.

## Core workflow (Prisma CLI)

Run the Prisma CLI with `npx prisma`. The typical workflow for a new project:

1. **Set up a TypeScript project with ESM.** Initialize the project, install
   dependencies, and enable ESM before scaffolding Prisma:

   ```bash
   npm init -y
   npm install typescript tsx @types/node --save-dev
   npx tsc --init
   npm install prisma@7.9.1 @types/pg --save-dev
   npm install @prisma/client@7.9.1 @prisma/adapter-pg pg dotenv
   ```

   Set `"module": "ESNext"` (along with `"moduleResolution": "bundler"`,
   `"target": "ES2023"`, `"strict": true`, `"esModuleInterop": true`, and
   `"ignoreDeprecations": "6.0"`) in `tsconfig.json`, and add
   `"type": "module"` to `package.json`.

2. **Initialize Prisma ORM.** Creates the `prisma/` directory with a
   `schema.prisma` file, a `.env` file, and a `prisma.config.ts` file:

   ```bash
   npx prisma init --output ../generated/prisma
   ```

3. **Create a Prisma Postgres database.** Ask the user for approval before
   provisioning a hosted Prisma Postgres database — `npx create-db` creates a
   cloud resource. After approval, run it and copy the `postgres://...`
   connection string into `DATABASE_URL` in your `.env` file:

   ```bash
   npx create-db
   ```

4. **Create and apply a migration** after defining models in
   `prisma/schema.prisma`. This creates the database tables based on your schema:

   ```bash
   npx prisma migrate dev --name init
   ```

5. **Generate Prisma Client** for type-safe database access:

   ```bash
   npx prisma generate
   ```

6. **Explore your data** in Prisma Studio, a visual database editor:

   ```bash
   npx prisma studio
   ```

### Example schema

```prisma
generator client {
  provider = "prisma-client"
  output   = "../generated/prisma"
}

datasource db {
  provider = "postgresql"
}

model User {
  id    Int     @id @default(autoincrement())
  email String  @unique
  name  String?
  posts Post[]
}

model Post {
  id        Int     @id @default(autoincrement())
  title     String
  content   String?
  published Boolean @default(false)
  author    User    @relation(fields: [authorId], references: [id])
  authorId  Int
}
```

## Remote MCP server

Prisma runs a remote Model-Context-Protocol (MCP) server that lets AI tools
manage Prisma Postgres databases, Prisma Compute deployments, and Object Storage
over Streamable HTTP. It authenticates with
Prisma Console on first use so your AI tool can access the workspace you choose.

Endpoint: `https://mcp.prisma.io/mcp`

Standard MCP configuration:

```json
{
  "mcpServers": {
    "Prisma": {
      "url": "https://mcp.prisma.io/mcp"
    }
  }
}
```

The server can manage databases and connection strings, list and restore automated
backups, run SQL queries, inspect schemas, and manage Object Storage buckets and keys.
Compute tools list apps and builds, read runtime logs, manage existing deployments,
and set environment variables. The Composer topology tool shows how services connect
and returns Console links; it does not check live app health. The MCP server does
not build or upload source code.

The `search_prisma_documentation` tool answers Prisma questions with citations
from the official docs. Full tool list: https://www.prisma.io/docs/ai/mcp-tools.md

## Installable agent skills

Prisma publishes deeper, task-specific skills in the Agent Skills format
(https://agentskills.io/). Installing them into a project gives you
version-accurate command and API knowledge without re-reading the docs:

```bash
npx skills add prisma/skills          # Prisma CLI, Prisma Client, Prisma Postgres, Prisma Compute, upgrade guides
npx prisma@latest skills sync         # Prisma 8 and Prisma Composer: copies the skills that ship inside the installed @prisma/orm-* and @prisma/composer packages
```

The catalog of skills and what each one teaches: https://www.prisma.io/docs/ai/tools/skills.md

## Where to read the docs

- Docs index (machine-readable): https://www.prisma.io/docs/llms.txt
- Full docs corpus: https://www.prisma.io/docs/llms-full.txt
- Any docs page as markdown: append `.md` to the URL (e.g. https://www.prisma.io/docs/getting-started.md)
- Changelog (machine-readable): https://www.prisma.io/changelog.md
