# MCP server (/docs/ai/tools/mcp-server)

> For the complete Prisma documentation index, see [llms.txt](https://www.prisma.io/docs/llms.txt). A markdown version of any docs page is available by appending `.md` to its URL.

Manage Prisma Postgres databases, Prisma Compute deployments, and Object Storage with the Prisma MCP server.

Location: AI > AI Tools > MCP server

## Overview [#overview]

The [Model Context Protocol](https://modelcontextprotocol.io/introduction) (MCP) lets AI tools connect to services such as Prisma.

Prisma provides an MCP server that lets AI tools manage [Prisma Postgres databases](https://www.prisma.io/docs/postgres), apps deployed on [Prisma Compute](https://www.prisma.io/docs/compute), and [Object Storage](https://www.prisma.io/docs/storage) buckets and access keys. Sign in with your Prisma account and select a workspace when you connect.

## Usage [#usage]

You need a Prisma account and access to a workspace, which groups your projects. If you don't have one, sign up at [Prisma Console](https://console.prisma.io/?utm_source=docs\&utm_medium=content\&utm_content=ai).

Add `https://mcp.prisma.io/mcp` as the server URL in your AI tool's MCP settings. If it asks for a transport, select **Streamable HTTP**. Follow the [setup instructions for your AI tool](#integrating-in-ai-tools) for its configuration format. Clients that use an `mcpServers` JSON entry accept:

```json title="MCP configuration"
{
  "mcpServers": {
    "Prisma": {
      "url": "https://mcp.prisma.io/mcp"
    }
  }
}
```

Connect and sign in with your Prisma account, then select a workspace and approve access. Ask "List my Prisma databases" to check that the connection works. See [Tools](#tools) for the full list of supported operations.

> [!WARNING]
> Tools that change or delete resources can cause data loss or interrupt live traffic. Check the target workspace and resources before approving an operation in your AI tool.

## Sample prompts [#sample-prompts]

* "Show me a list of all the databases in this workspace."
* "Create a new database in the US region for me."
* "Show me all available backups of my database."
* "Show me all customers and run an analysis over their orders."
* "List my Compute apps and show the latest failed builds."
* "Show the runtime logs for this deployment."
* "Show how this project's Composer services connect, and give me the Console links."
* "Set LOG_LEVEL to debug for this project's preview environment."
* "Search the Prisma docs and explain how to deploy a project to Prisma Compute."

## Integrating in AI tools [#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.

The sections below cover the config formats of common AI tools.

### VS Code [#vs-code]

Install the Prisma MCP server in VS Code with the link below:

<a
  href="vscode:mcp/install?%7B%22name%22%3A%22Prisma%22%2C%22gallery%22%3Atrue%2C%22url%22%3A%22https%3A%2F%2Fmcp.prisma.io%2Fmcp%22%7D"
  aria-label="Install Prisma MCP server in VS Code"
  style="{
  display: &#x22;inline-flex&#x22;,
  alignItems: &#x22;center&#x22;,
  borderRadius: &#x22;6px&#x22;,
  overflow: &#x22;hidden&#x22;,
  textDecoration: &#x22;none&#x22;,
  height: &#x22;2.0rem&#x22;,
}"
>
  <span
    style="{
    backgroundColor: &#x22;#2C2C2C&#x22;,
    color: &#x22;white&#x22;,
    padding: &#x22;0.6rem 0.8rem&#x22;,
  }"
  >
    VS CODE
  </span>

  <span
    style="{
    backgroundColor: &#x22;#0098FF&#x22;,
    color: &#x22;white&#x22;,
    padding: &#x22;0.6rem 1rem&#x22;,
  }"
  >
    INSTALL PRISMA MCP SERVER
  </span>
</a>

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](https://code.visualstudio.com/docs/copilot/chat/mcp-servers#_add-an-mcp-server-to-your-workspace) by creating a `.vscode/mcp.json` file in your workspace and adding:

```json title=".vscode/mcp.json"
{
  "servers": {
    "Prisma": {
      "url": "https://mcp.prisma.io/mcp"
    }
  }
}
```

Explore additional Prisma features and workflows for VS Code in [our docs](https://www.prisma.io/docs/guides/postgres/vscode).

### Codex [#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:

```bash title="Codex"
codex plugin marketplace add prisma/codex-plugin
```

Restart Codex, open its plugin directory in the app, 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](https://www.prisma.io/docs/ai/tools/codex).

### Cursor [#cursor]

To learn more about Cursor's MCP integration, check out the [Cursor MCP docs](https://docs.cursor.com/context/model-context-protocol#configuration-locations).

#### Add via one-click installation [#add-via-one-click-installation]

You can add the Prisma MCP server to Cursor using the [one-click installation](https://docs.cursor.com/context/model-context-protocol#one-click-installation) by clicking on the following link:

<a href="https://pris.ly/cursor-deeplink" target="_blank" rel="noopener noreferrer">
  <img src="https://cursor.com/deeplink/mcp-install-dark.svg" alt="Install MCP Server" />
</a>

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 [#add-via-cursor-settings-ui]

When opening the **Cursor Settings**, you can add the Prisma MCP Server as follows:

1. Select **MCP** in the settings sidenav
2. Click **+ Add new global MCP server**
3. Add the `Prisma` snippet to the `mcpServers` JSON object:
   ```json title="Cursor MCP configuration"
   {
     "mcpServers": {
       "Prisma": {
         "url": "https://mcp.prisma.io/mcp"
       }
     }
   }
   ```

#### Global configuration [#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:

```json title="~/.cursor/mcp.json"
{
  "mcpServers": {
    "Prisma": {
      "url": "https://mcp.prisma.io/mcp"
    }
    // other MCP servers
  }
}
```

#### Project configuration [#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:

```json title=".cursor/mcp.json"
{
  "mcpServers": {
    "Prisma": {
      "url": "https://mcp.prisma.io/mcp"
    }
    // other MCP servers
  }
}
```

### Windsurf [#windsurf]

To learn more about Windsurf's MCP integration, check out the [Windsurf MCP docs](https://docs.windsurf.com/windsurf/cascade/mcp).

#### Add via Windsurf MCP Plugin Store (Recommended) [#add-via-windsurf-mcp-plugin-store-recommended]

Use the Prisma MCP plugin from the [Windsurf MCP Plugin Store](https://docs.windsurf.com/windsurf/cascade/mcp#adding-a-new-mcp-plugin). Follow [the steps here](https://www.prisma.io/docs/ai/tools/windsurf#add-prisma-mcp-server-via-windsurf-plugins) to add the Prisma MCP plugin in Windsurf. This is the recommended way to add the Prisma MCP server to Windsurf.

#### Add via Windsurf Settings UI [#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:

1. Select **Cascade** in the settings sidenav
2. Click **Add Server**
3. Add the `Prisma` snippet to the `mcpServers` JSON object:
   ```json title="Windsurf MCP configuration"
   {
     "mcpServers": {
       "Prisma": {
         "url": "https://mcp.prisma.io/mcp"
       }
     }
   }
   ```

#### Global configuration [#global-configuration-1]

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:

```json title="~/.codeium/windsurf/mcp_config.json"
{
  "mcpServers": {
    "Prisma": {
      "url": "https://mcp.prisma.io/mcp"
    }
    // other MCP servers
  }
}
```

### Warp [#warp]

You can add the Prisma MCP to Warp as a globally available tool. First, [visit your MCP settings](https://docs.warp.dev/knowledge-and-collaboration/mcp#how-to-access-mcp-server-settings&#x29; and click **+ Add**. From here, you can configure the Prisma MCP server as JSON:

```json title="Warp MCP configuration"
{
  "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](https://docs.warp.dev/knowledge-and-collaboration/mcp).

### Claude Code [#claude-code]

Claude Code is a terminal-based AI tool where you can add MCP servers using the `claude mcp add` command:

```bash title="Claude Code"
claude mcp add --transport http prisma https://mcp.prisma.io/mcp
```

Learn more in the [Claude Code MCP docs](https://code.claude.com/docs/en/mcp).

### Claude Desktop only [#claude-desktop-only]

Follow the instructions in the [Claude Desktop MCP docs](https://modelcontextprotocol.io/quickstart/user#2-add-the-filesystem-mcp-server) 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:

```json title="Claude Desktop configuration"
{
  "mcpServers": {
    "Prisma": {
      "url": "https://mcp.prisma.io/mcp"
    }
    // other MCP servers
  }
}
```

### Claude Desktop & Web [#claude-desktop--web]

Alternatively, you can add the Prisma MCP server as an [integration](https://www.anthropic.com/news/integrations):

1. In a new chat, find the **Connect apps** field in the main Claude UI below the input prompt field
2. Click **+ Add integration**
3. Enter the following:

* **Integration name**: `Prisma`
* **Integration URL**: `https://mcp.prisma.io/mcp`

1. Click **Add**

### ChatGPT [#chatgpt]

You can add the Prisma MCP server to ChatGPT to manage your databases and Compute deployments using natural language. Learn more about setting it up in our [ChatGPT integration guide](https://www.prisma.io/docs/ai/tools/chatgpt).

### Gemini CLI [#gemini-cli]

Gemini CLI can add the Prisma MCP server using HTTP transport:

```bash title="Gemini CLI"
gemini mcp add --transport http Prisma https://mcp.prisma.io/mcp --scope user
```

You can also add the standard MCP configuration to your `~/.gemini/settings.json` file:

```json title="~/.gemini/settings.json"
{
  "mcpServers": {
    "Prisma": {
      "url": "https://mcp.prisma.io/mcp"
    }
  }
}
```

### fx [#fx]

[fx](https://fx.sh) is a terminal coding agent by [Vercel Labs](https://github.com/vercel-labs). It reads MCP servers from a single trusted file, `~/.fx/mcp.json`, and never loads MCP configuration from a repository. Remote servers are added by editing that file directly.

Install fx and sign in if you haven't already:

```bash title="fx"
curl -fsSL https://fx.sh/setup.sh | bash
fx login
```

Then add the Prisma MCP server to `~/.fx/mcp.json`. Note that fx uses an `mcp` key rather than `mcpServers`, and remote servers need `"type": "http"`:

```json title="~/.fx/mcp.json"
{
  "mcp": {
    "Prisma": {
      "type": "http",
      "url": "https://mcp.prisma.io/mcp"
    }
  }
}
```

Start `fx` (or run `/mcp reload` in an open session), then authenticate with Prisma Console:

```bash title="fx session"
/mcp auth Prisma --open
```

1. Complete the Prisma Console authorization flow in your browser.
2. Return to fx and run:
   ```bash title="fx session"
   /mcp list
   ```
3. Confirm that the server shows `state=ready`.
4. Ask fx to manage your database. For example:
   * "List the Prisma tools"
   * "Show me all databases in my workspace"
5. fx checks its permission policy before each MCP tool call, so saved rules or its automatic review may let a call through without asking. If fx shows an approval prompt, select **Allow once** or **Allow this MCP tool for this session**.

Learn more in the [fx MCP docs](https://fx.sh/docs/capabilities/mcp).

## Tools [#tools]

The server can manage databases, run SQL, restore automated backups, manage Object Storage, and search Prisma documentation. Compute tools manage existing deployments, read logs, and set environment variables; Composer tools show how project resources connect.

See the [MCP tools reference](https://www.prisma.io/docs/ai/mcp-tools) for the full catalog and each tool's limits. To deploy new source code, follow the [Prisma Compute guide](https://www.prisma.io/docs/compute).

## AI Safety guardrails for destructive commands [#ai-safety-guardrails-for-destructive-commands]

These safeguards apply to Prisma CLI commands, not MCP tool calls. For MCP operations, review approvals in your AI tool.

Prisma ORM includes built-in safety checks to prevent **accidental destructive commands** when run through AI coding assistants.

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:

```bash title="Destructive command guardrail"
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.

## Related pages

- [`Agent Skills`](https://www.prisma.io/docs/ai/tools/skills): Give your AI coding agent up-to-date Prisma knowledge with installable skills
- [`ChatGPT`](https://www.prisma.io/docs/ai/tools/chatgpt): Learn how to add the Prisma MCP server to ChatGPT to manage your databases and Compute deployments.
- [`Codex`](https://www.prisma.io/docs/ai/tools/codex): Learn how to install the Prisma Codex plugin and use Prisma MCP from Codex
- [`Cursor`](https://www.prisma.io/docs/ai/tools/cursor): Learn tips and best practices for using Prisma ORM with the Cursor AI code editor
- [`GitHub Copilot`](https://www.prisma.io/docs/ai/tools/github-copilot): Learn about the features available with GitHub Copilot and Prisma ORM, plus best practices and tips