How to Use Prisma MCP for Database Management
Manage your Prisma schema, run migrations, execute queries with Prisma Client, and interact with Prisma Postgres directly from Claude Code.
What is the Prisma MCP?
Prisma is the most popular TypeScript ORM, providing a type-safe query builder, a schema migration system, and Prisma Postgres — a serverless database with built-in connection pooling and a global cache. The Prisma MCP connects Claude Code to the Prisma platform API and your database, enabling it to manage schemas, run migrations, execute queries through Prisma Client, and interact with Prisma's cloud services.
Installation
mcpizy install prisma
Provide your database connection URL and, optionally, a Prisma Cloud API key for platform features. The MCP detects your existing schema.prisma file automatically.
Key Capabilities
- Schema management — update your Prisma schema and generate migration SQL.
- Run migrations — execute
prisma migrate devandprisma migrate deploywith full output. - Execute queries — run Prisma Client queries to inspect or manipulate data during development.
- Introspect databases — generate a Prisma schema from an existing database with
prisma db pull. - Manage Prisma Postgres — create projects and databases on Prisma's hosted platform.
Example Usage
Add a new model and migrate your development database:
// Claude will:
// 1. Edit schema.prisma to add the new model
// 2. Run "prisma migrate dev --name add_audit_log"
// 3. Show the generated SQL migration
// 4. Confirm the migration was applied successfully
// 5. Generate updated TypeScript types with "prisma generate"
Tips and Best Practices
- Always use
prisma migrate devin development — it creates named migration files in version control, unlikedb push. - Review generated SQL before applying to production — ask Claude to explain what each migration does.
- Use Prisma Accelerate (connection pooling) in serverless environments to avoid connection exhaustion.
- Combine with Supabase MCP if you use Supabase as your Postgres host — run Prisma migrations via the MCP and use Supabase's management API for storage and auth.