A comprehensive Cursor plugin for Prisma development, providing MCP server integration, AI rules, specialized skills, custom agents, and automation hooks.
- Direct integration with Prisma MCP server
- Database introspection and querying
- Schema management through AI
- Schema Conventions: Enforces Prisma naming conventions and best practices
- Migration Best Practices: Guidelines for safe database migrations
- Schema Designer: Design and modify Prisma schemas following best practices
- Migration Manager: Safely create, deploy, and manage database migrations
- Prisma Expert: Comprehensive Prisma development expertise
- Schema Reviewer: Specialized schema review and optimization
- Pre-commit: Validates Prisma schema before commits
- Post-save: Auto-formats Prisma schema files on save
- On-schema-change: Regenerates TypeScript types after schema changes
# Install via Cursor CLI
cursor plugin install prisma-cursor-plugin- Clone this repository
- Copy to your Cursor plugins directory
- Run setup script:
npm run setupCreate a .env file in your project root:
DATABASE_URL="postgresql://user:password@localhost:5432/mydb"The Prisma MCP server is automatically configured. Ensure your DATABASE_URL environment variable is set.
Rules are automatically applied to your Prisma schema files:
- Schema conventions enforce naming standards
- Migration best practices guide safe database changes
Invoke skills via Cursor AI:
/schema-designer- Design new schemas or modify existing ones/migration-manager- Create and manage migrations
Switch to custom agents in Cursor:
- Prisma Expert: For general Prisma development tasks
- Schema Reviewer: For schema reviews and optimization
Hooks run automatically on configured events:
- Schema validation before commits
- Auto-formatting on save
- Type generation after schema changes
prisma-cursor-plugin/
├── .cursor/
│ └── plugin.json # Plugin manifest
├── rules/
│ ├── schema-conventions.mdc
│ └── migration-best-practices.mdc
├── skills/
│ ├── schema-designer/
│ │ └── SKILL.md
│ └── migration-manager/
│ └── SKILL.md
├── agents/
│ ├── prisma-expert.md
│ └── schema-reviewer.md
├── scripts/
│ ├── setup.sh
│ ├── pre-commit.sh
│ ├── format-schema.js
│ └── generate-types.ts
├── hooks.json # Hook definitions
├── mcp.json # MCP server configuration
├── package.json
└── README.md
# Setup the plugin
npm run setup
# Build MCP server (when implemented)
npm run build
# Development mode (when implemented)
npm run dev
# Run code generation scripts
npm run generate- Node.js >= 18
- Prisma CLI (installed automatically by setup)
- Database connection (PostgreSQL, MySQL, SQLite, etc.)
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
posts Post[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([email])
}
model Post {
id Int @id @default(autoincrement())
title String
content String?
published Boolean @default(false)
authorId Int
author User @relation(fields: [authorId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([authorId])
@@index([published])
}# Create and apply migration
npx prisma migrate dev --name add_user_posts
# Deploy to production
npx prisma migrate deployContributions are welcome! Please follow Prisma's contribution guidelines.
MIT