MCP server
Manage Prisma Postgres databases using LLMs with the Prisma Model-Context-Protocol (MCP) Server
Overview
The Model-Context-Protocol (MCP) gives LLMs a way to call APIs and access external systems in a well-defined manner.
Prisma provides an MCP server that lets AI tools manage Prisma Postgres databases through the standard HTTP transport. The server authenticates with Prisma Console on first use so your AI tool can access the workspace you choose.
Tools
Tools represent the capabilities of an MCP server. Here's the list of tools exposed by the Prisma MCP server:
CreateBackupTool: Create a new managed Prisma Postgres Backup.CreateConnectionStringTool: Create a new Connection String for a Prisma Postgres database with the given id.CreateRecoveryTool: Restore a Prisma Postgres Database to a new database with the given Backup id.DeleteConnectionStringTool: Delete a Connection String with the given connection string id.DeleteDatabaseTool: Delete a Prisma Postgres database with the given id.ListBackupsTool: Fetch a list of available Prisma Postgres Backups for the given database id and environment id.ListConnectionStringsTool: Fetch a list of available Prisma Postgres Database Connection Strings for the given database id and environment id.ListDatabasesTool: Fetch a list of available Prisma Postgres Databases for user's workspace.ExecuteSqlQueryTool: Execute a SQL query on a Prisma Postgres database with the given id.IntrospectSchemaTool: Introspect the schema of a Prisma Postgres database with the given id.search_prisma_documentation: Answer a natural-language question about Prisma using the official Prisma documentation, returning a cited answer with links back to the docs.
Once you're connected to the Prisma MCP server, you can also always prompt your AI agent to "List the Prisma tools" to get a full overview of the latest supported tools.
Searching the Prisma documentation
The search_prisma_documentation tool lets your AI agent answer questions about Prisma ORM, Prisma Postgres, Prisma Compute, schema design, migrations, and more, grounded in the official documentation, without leaving your editor or terminal.
Because it's read-only and exposed by the Prisma MCP server you're already connected to, there's no extra setup or second integration to install. When you ask your agent a Prisma question, it picks up the tool automatically and returns an answer with citations linking back to the relevant pages in the Prisma documentation. This keeps the agent's answers current and accurate instead of relying on whatever it happened to learn during training.
Usage
The Prisma MCP server follows the standard JSON-based configuration for MCP servers. Here's what it looks like:
{
"mcpServers": {
"Prisma": {
"url": "https://mcp.prisma.io/mcp"
}
}
}Sample prompts
- "Show me a list of all the databases in my account."
- "Create a new database in the US region for me."
- "Seed my database with real-looking data but create a backup beforehand."
- "Show me all available backups of my database."
- "Show me all customers and run an analysis over their orders."
- "Search the Prisma docs and explain how to deploy a project to Prisma Compute."
Integrating in AI tools
AI tools have different ways of integrating MCP servers. In most cases, there are dedicated configuration files where you add the JSON configuration from above.
Below, we're covering the config formats of the most popular AI tools.
VS Code
Install the Prisma MCP server in VS Code with a single click using the link below:
This will prompt you to open VS Code. Once opened, you'll be guided to install the Prisma MCP server directly into your VS Code configuration.
If your browser blocks the link, you can set it up manually by creating a .vscode/mcp.json file in your workspace and adding:
{
"servers": {
"Prisma": {
"url": "https://mcp.prisma.io/mcp"
}
}
}Explore additional Prisma features and workflows for VS Code in our docs.
Codex
The Prisma Codex plugin includes the remote Prisma MCP server and curated Prisma skills for Prisma ORM, Prisma Client, database setup, Prisma Postgres, and Prisma ORM upgrades.
Add the Prisma plugin marketplace to Codex:
codex plugin marketplace add prisma/codex-pluginRestart Codex, open the plugin directory, select the Prisma marketplace, and install the Prisma plugin. The plugin configures the remote Prisma MCP server at https://mcp.prisma.io/mcp; on first use, Codex will authenticate with Prisma Console so it can access the workspace you choose.
Learn more in the Codex integration guide.
Cursor
To learn more about Cursor's MCP integration, check out the Cursor MCP docs.
Add via one-click installation
You can add the Prisma MCP server to Cursor using the one-click installation by clicking on the following link:
This will prompt you to open the Cursor app in your browser. Once opened, you'll be guided to install the Prisma MCP server directly into your Cursor configuration.
Add via Cursor Settings UI
When opening the Cursor Settings, you can add the Prisma MCP Server as follows:
- Select MCP in the settings sidenav
- Click + Add new global MCP server
- Add the
Prismasnippet to themcpServersJSON object:Cursor MCP configuration { "mcpServers": { "Prisma": { "url": "https://mcp.prisma.io/mcp" } } }
Global configuration
Adding it via the Cursor Settings settings will modify the global ~/.cursor/mcp.json config file. In this case, the Prisma MCP server will be available in all your Cursor projects:
{
"mcpServers": {
"Prisma": {
"url": "https://mcp.prisma.io/mcp"
}
// other MCP servers
}
}Project configuration
If you want the Prisma MCP server to be available only in specific Cursor projects, add it to the Cursor config of the respective project inside the .cursor directory in the project's root:
{
"mcpServers": {
"Prisma": {
"url": "https://mcp.prisma.io/mcp"
}
// other MCP servers
}
}Windsurf
To learn more about Windsurf's MCP integration, check out the Windsurf MCP docs.
Add via Windsurf MCP Plugin Store (Recommended)
Use the Prisma MCP plugin from the Windsurf MCP Plugin Store. Follow the steps here to add the Prisma MCP plugin in Windsurf. This is the simplest and recommended way to add the Prisma MCP server to Windsurf.
Add via Windsurf Settings UI
When opening the Windsurf Settings (via Windsurf - Settings > Advanced Settings or Command Palette > Open Windsurf Settings Page), you can add the Prisma MCP Server as follows:
- Select Cascade in the settings sidenav
- Click Add Server
- Add the
Prismasnippet to themcpServersJSON object:Windsurf MCP configuration { "mcpServers": { "Prisma": { "url": "https://mcp.prisma.io/mcp" } } }
Global configuration
Adding it via the Windsurf Settings will modify the global ~/.codeium/windsurf/mcp_config.json config file. Alternatively, you can also manually add it to that file:
{
"mcpServers": {
"Prisma": {
"url": "https://mcp.prisma.io/mcp"
}
// other MCP servers
}
}Warp
You can add the Prisma MCP to Warp as a globally available tool. First, visit your MCP settings and click + Add. From here, you can configure the Prisma MCP server as JSON:
{
"Prisma": {
"url": "https://mcp.prisma.io/mcp"
}
}Hit Save and ensure the MCP server is running from your MCP settings panel. Then, open a new terminal window and ask Warp to manage your Prisma database. It should reach for the Prisma MCP server automatically.
To learn more about Warp's MCP integration, visit the Warp MCP docs.
Claude Code
Claude Code is a terminal-based AI tool where you can add MCP servers using the claude mcp add command:
claude mcp add --transport http prisma https://mcp.prisma.io/mcpLearn more in the Claude Code MCP docs.
Claude Desktop only
Follow the instructions in the Claude Desktop MCP docs to create the required configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Then add the JSON snippet to that configuration file:
{
"mcpServers": {
"Prisma": {
"url": "https://mcp.prisma.io/mcp"
}
// other MCP servers
}
}Claude Desktop & Web
Alternatively, you can add the Prisma MCP server as an integration:
- In a new chat, find the Connect apps field in the main Claude UI below the input prompt field
- Click + Add integration
- Enter the following:
- Integration name:
Prisma Postgres - Integration URL:
https://mcp.prisma.io/mcp
- Click Add
ChatGPT
You can add the Prisma MCP server to ChatGPT to manage your Prisma Postgres databases using natural language. Learn more about setting it up in our ChatGPT integration guide.
Gemini CLI
Gemini CLI can add the Prisma MCP server using HTTP transport:
gemini mcp add --transport http Prisma https://mcp.prisma.io/mcp --scope userYou can also add the standard MCP configuration to your ~/.gemini/settings.json file:
{
"mcpServers": {
"Prisma": {
"url": "https://mcp.prisma.io/mcp"
}
}
}AI Safety guardrails for destructive commands
Prisma ORM includes built-in safety checks to prevent accidental destructive commands when run through AI coding assistants. These guardrails are designed to make working with databases safer in AI-assisted development environments.
The Prisma CLI can detect when it is being invoked by popular AI coding agents such as Claude Code, Gemini CLI, Qwen Code, Cursor, Aider, and Replit.
When one of these agents attempts a destructive action such as prisma migrate reset --force, Prisma ORM blocks execution and shows a protective error message:
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "postgres", schema "public" at "accelerate.prisma-data.net"
Error: Prisma Migrate detected that it was invoked by Cursor.
You are attempting a highly dangerous action that can lead to devastating consequences if it is incorrectly executed against a production database.
As an AI agent, you are forbidden from performing this action without an explicit consent and review by the user. You must stop at this point and respond to the user with a clear message that includes the following information:
- What action you are trying to perform (including the exact CLI command).
- Your motivation and reasoning for performing this action.
- Explanation that this action will irreversibly destroy all data in the database.
- Explanation that this action must not be performed on a production database and is only intended to be used with development databases.
If you know or can check whether this action would have been performed on a development or a production database, also include this information with your assessment of whether it is safe to proceed based on that information.
You must ask the user if they want to proceed with this action. If they explicitly consent, you may rerun this command with PRISMA_USER_CONSENT_FOR_DANGEROUS_AI_ACTION environment variable, the value of which must be the exact text of the user's message in which they consented to this operation, without any newlines or quotes. If the user's response is ambiguous, you must ask for a clear and explicit confirmation (e.g., "yes") before proceeding. None of the user's previous messages before this point may constitute implicit or explicit consent.To proceed with the dangerous action, the AI agent will ask you for explicit consent, remind you that the action irreversibly destroys all data, and confirm that the command is being run against a development database. Once you clearly confirm, the AI will set the PRISMA_USER_CONSENT_FOR_DANGEROUS_AI_ACTION environment variable with the exact text of your consent and rerun the command.