What You'll Build
A complete database development workflow that uses Continue CLI with Prisma MCP to design schemas, generate migrations, seed data, and manage your PostgreSQL database - all through natural language prompts.
What Youโll Learn
This cookbook teaches you to:- Use Prisma Remote MCP to build database workflows
- Design database schemas with AI assistance
- Generate and apply migrations automatically
- Create realistic seed data for development
- Launch Prisma Studio for visual database management
- Set up automated database health checks
Prerequisites
Before starting, ensure you have:- Node.js 18+ installed locally
- Continue CLI with active credits (required for API usage)
- Basic understanding of SQL and database concepts
- A project directory where you want to set up your database
1
Install Continue CLI
2
Set up Continue CLI Account & API Key
- Visit Continue Organizations
- Sign up or log in to your Continue account
- Navigate to your organization settings
- Click โAPI Keysโ and then โ+ New API Keyโ
- Copy the API key immediately (you wonโt see it again!)
- Login to the CLI:
cn login
3
Add Prisma Secrets to Continue Hub
For the Prisma Remote MCP to work, you need to authenticate with Prisma:
- Visit Continue Hub Secrets
- Click โ+ Add Secretโ
- Add your Prisma authentication token:
- Key:
prisma/prisma-remote-mcp/PRISMA_AUTH_TOKEN - Value: Your Prisma auth token (get from Prisma Console)
- Key:
The Prisma Remote MCP runs on Prismaโs hosted infrastructure and requires authentication to access your databases and projects.
Continue CLI with Prisma Remote MCP can generate complete database schemas, write migrations, and even create realistic seed data - you just describe what you need!
Step 1: Set Up Your Database
- Prisma Postgres Setup
- Local PostgreSQL
Prisma MCP works with any PostgreSQL database, including Prisma Postgres:
-
Create a Prisma Account (optional, for hosted databases)
- Visit Prisma Console
- Sign up or log in
-
Authenticate via Continue CLI
Prompt:
The AI will use the
Prisma-Logintool to authenticate. -
Create a Database
Prompt:
You can also use any PostgreSQL database by configuring your connection string in
.env:Prisma Database Workflow Options
Fastest Path to Success
Skip the manual setup and use our pre-built Prisma Continuous AI agent that includes
optimized prompts, rules, and the Prisma MCP for consistent database development.
How Prisma Remote MCP Works:
- Connects to Prismaโs hosted MCP server via
mcp-remote - Runs on Prismaโs infrastructure (no local installation required)
- Provides tools for migrations, schema management, and database operations
- Integrates with Prisma Studio for visual database exploration
- Includes AI safety guardrails to prevent accidental data loss
migrate-status- Check migration statusmigrate-dev- Create and execute migrationsmigrate-reset- Reset the databasePrisma-Postgres-account-status- Check authenticationCreate-Prisma-Postgres-Database- Provision new databasesPrisma-Login- Authenticate with PrismaPrisma-Studio- Launch the data explorer
- โก Quick Start (Recommended)
- ๐ ๏ธ Manual Setup
Perfect for: Rapid database development with AI-powered schema design and migration generation
1
Add the Pre-Built Agent
Visit the Prisma Continuous AI Agent on Continue Hub and click โInstall Agentโ or run:This agent includes:
- Optimized prompts for schema design and migration workflows
- Built-in rules for database best practices
- Prisma Remote MCP for reliable database operations
- Automatic schema validation and safety checks
2
Run Schema Design
Navigate to your project directory and enter this prompt in the Continue CLI TUI:Thatโs it! The agent handles everything automatically.
Why Use the Agent? Get consistent results with pre-tested prompts and built-in database design best practices.
Agent Requirements
Agent Requirements
To use the pre-built agent, you need either:
- Continue CLI Pro Plan with the models add-on, OR
- Your own API keys added to Continue Hub secrets
- Prisma authentication token added to Continue Hub secrets
- PostgreSQL database (local or hosted via Prisma Postgres)
- Prisma Remote MCP connects to Prismaโs hosted infrastructure (no local installation required)
AI Safety Guardrails: Prisma detects when destructive commands like
prisma migrate reset --force are invoked through AI agents and requires explicit user consent before proceeding.Step 2: Design Your Database Schema with AI
Use Continue CLI to design your database schema through natural language prompts.- E-commerce Schema
- SaaS Application Schema
- Blog Platform Schema
Prompt:
Prisma Remote MCP Capabilities for Schema Design:
- Validates schema syntax automatically
- Suggests optimal data types and relationships
- Recommends indexes based on query patterns
- Warns about potential performance issues
- Leverages Prismaโs hosted AI models for enhanced schema recommendations
Step 3: Generate and Apply Migrations
Create database migrations from your schema design and apply them safely. Example: Complete Migration Workflow- Run
prisma migrate statusto check current state - Generate migration with
prisma migrate dev --name initial_schema - Show you the SQL file contents for review
- Apply the migration automatically
- Verify tables exist using database inspection
Best Practice: Always review AI-generated migrations before applying to production. Test in development first!
Step 4: Seed Your Database with Realistic Data
Generate realistic seed data for development and testing.- E-commerce Seed Data
- SaaS Seed Data
Prompt:
Prisma Seed Best Practices:
- Use
fakeror similar libraries for realistic data - Run seeds in transactions for consistency
- Make seeds idempotent (safe to run multiple times)
- Include edge cases and test scenarios
Step 5: Launch Prisma Studio for Visual Management
Use Prisma Studio to visually explore and manage your database. Prompt:- Run
prisma studiocommand - Open Studio in your browser (usually http://localhost:5555)
- Show you how to navigate the interface
Prisma Studio Features:
- Browse all tables and relationships
- Edit records directly
- Filter and search data
- View relationship connections visually
Step 6: Automate Database Health Checks
Set up automated database monitoring with Continue CLI and GitHub Actions:Required GitHub Secrets:
CONTINUE_API_KEY: Your Continue API key from hub.continue.dev/settings/api-keysDATABASE_URL: PostgreSQL connection string for your test database
What Youโve Built
After completing this guide, you have a complete AI-powered database development workflow that:- Designs schemas - AI generates complete database schemas from natural language descriptions
- Creates migrations - Automatically generates and applies database migrations
- Seeds data - Generates realistic test data for development
- Monitors health - Runs automated checks for schema issues and performance problems
- Visual management - Provides GUI access via Prisma Studio
Continuous AI Database Development
Your system now operates at Level 2 Continuous AI - AI handles schema design and migration generation with human oversight for production deployments.
Advanced Database Development Prompts
Enhance your workflow with these advanced Continue CLI prompts:Schema Evolution
Analyze existing schema and suggest improvements for scalability, including partitioning strategies and denormalization opportunities
Query Optimization
Review slow queries and generate optimized indexes, explain plans, and query rewrites
Data Migration
Generate data transformation scripts when changing schema structure (e.g., splitting tables, normalizing data)
Backup & Recovery
Create backup strategies and generate recovery scripts for disaster scenarios
Real-World Use Cases
Use Case 1: Adding Multi-Tenancy to Existing Schema
Prompt:Use Case 2: Adding Full-Text Search
Prompt:Use Case 3: Implementing Audit Logging
Prompt:Security Best Practices
Database Security Guidelines:
- Never commit
.envfiles with database credentials - Use environment variables for all sensitive configuration
- Implement row-level security (RLS) for multi-tenant apps
- Review all AI-generated SQL before running in production
- Use read replicas for analytics queries
- Enable SSL/TLS for database connections
- Regularly rotate database passwords
- Use least-privilege database users for applications
Troubleshooting
Prisma Remote MCP Connection Issues
If you encounter issues with Prisma Remote MCP:- Verify your
PRISMA_AUTH_TOKENis correctly set in Continue Hub Secrets - Check that the secret key is exactly:
prisma/prisma-remote-mcp/PRISMA_AUTH_TOKEN - Ensure you have network connectivity to
https://mcp.prisma.io - Verify your Prisma account has access to the database at Prisma Console
- Check your DATABASE_URL is correctly set in
.env(for local Prisma CLI operations)
Common Migration Issues
| Issue | Solution |
|---|---|
| Migration conflicts | Reset development database with prisma migrate reset |
| Schema drift detected | Run prisma migrate dev to sync schema with database |
| Connection refused | Verify DATABASE_URL and database is running |
| Permission denied | Check database user has CREATE/ALTER privileges |
AI Safety Guardrails
When Prisma Remote MCP detects destructive operations (likemigrate reset):
- Youโll see a confirmation prompt
- Review what will be deleted
- Type โyesโ to confirm or โnoโ to cancel
- The AI will wait for your response before proceeding
This safety feature prevents accidental data loss when AI agents run database commands. The Prisma Remote MCP enforces these guardrails on the server side for enhanced security.
Next Steps
- Explore Prisma Client for type-safe database queries
- Set up Prisma Accelerate for connection pooling
- Configure Prisma Pulse for real-time database events
- Learn about Prisma Optimize for query performance insights
- Join the Continue Discord for support