Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/docs/content/docs/ai/index.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Build faster with Prisma + AI
description: Build faster with Prisma and AI coding tools like Cursor and ChatGPT
description: Build faster with Prisma and AI coding tools like Cursor, Codex, and ChatGPT
url: /ai
metaTitle: AI
metaDescription: AI
Expand All @@ -21,6 +21,7 @@ npx prisma init --prompt "Create a habit tracker application"
Prisma ORM and Prisma Postgres integrate seamlessly with your AI coding tools. Check out our documentation with tips and tricks for working with Prisma in various AI editors.

- [Cursor](/ai/tools/cursor) - Define project-specific rules and use your schema as context to generate accurate queries and code.
- [Codex](/ai/tools/codex) - Install the Prisma Codex plugin with Prisma ORM skills and the remote Prisma MCP server.
- [Windsurf](/ai/tools/windsurf) - Automate your database workflows by generating schemas, queries, and seed data in this AI-powered editor.
- [Github Copilot](/ai/tools/github-copilot) - Get Prisma-aware code suggestions, run CLI commands from chat, and query the Prisma docs.
- [ChatGPT](/ai/tools/chatgpt) - Learn how to connect the Prisma MCP server to ChatGPT to manage your databases with natural language.
Expand Down
86 changes: 86 additions & 0 deletions apps/docs/content/docs/ai/tools/codex.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
title: Codex
description: Learn how to install the Prisma Codex plugin and use Prisma MCP from Codex
url: /ai/tools/codex
metaTitle: Using Prisma with Codex
metaDescription: Install the Prisma Codex plugin to add Prisma ORM skills and the remote Prisma MCP server to Codex.
---

[Codex](https://developers.openai.com/codex/) is an AI coding agent from OpenAI. You can use the Prisma Codex plugin to give Codex Prisma-specific guidance and connect it to the Prisma MCP server for Prisma Postgres workflows.

The Prisma Codex plugin includes:

- Prisma CLI guidance
- Prisma Client API guidance
- Database setup guidance
- Prisma Postgres guidance
- Prisma ORM upgrade guidance
- The remote Prisma MCP server configuration

## Install the Prisma Codex plugin

Add the Prisma plugin marketplace to Codex:

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

Then restart Codex and install the plugin:

1. Open the Codex plugin directory.
1. Select the `Prisma` marketplace.
1. Install the `Prisma` plugin.

If your Codex CLI does not recognize the `plugin marketplace add` command, update Codex and try again.

## Prisma MCP server

The plugin configures the official remote Prisma MCP server:

```json title="Prisma MCP server"
{
"mcpServers": {
"prisma": {
"type": "http",
"url": "https://mcp.prisma.io/mcp"
}
}
}
```

When Codex first uses the Prisma MCP server, it authenticates with Prisma Console and asks you to choose the workspace Codex can access.

With the Prisma MCP server, Codex can help you:

- List Prisma Postgres databases in your workspace.
- Create Prisma Postgres databases.
- Create backups and recovery databases.
- Create and manage connection strings.
- Execute SQL queries.
- Introspect database schemas.

## Example prompts

After installing the plugin, try prompts like:

```text
Set up Prisma ORM in this project with the right database adapter.
```

```text
Use Prisma MCP to list my Prisma Postgres databases.
```

```text
Inspect this project and upgrade it to Prisma ORM 7.
```

```text
Use Prisma MCP to inspect my database schema and plan a migration.
```

## Safety

Prisma ORM includes safety checks for destructive commands run through AI coding agents. For example, Prisma blocks destructive commands such as `prisma migrate reset --force` unless the AI agent asks for explicit user consent and passes that consent back to Prisma.

This helps prevent accidental data loss when using Codex or another AI agent with Prisma projects.
14 changes: 14 additions & 0 deletions apps/docs/content/docs/ai/tools/mcp-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,20 @@ If your browser blocks the link, [you can set it up manually](https://code.visua

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

### 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 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](/ai/tools/codex).

### 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).
Expand Down
11 changes: 10 additions & 1 deletion apps/docs/content/docs/ai/tools/meta.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
{
"title": "AI Tools",
"pages": ["cursor", "windsurf", "github-copilot", "chatgpt", "tabnine", "mcp-server", "skills"]
"pages": [
"cursor",
"codex",
"windsurf",
"github-copilot",
"chatgpt",
"tabnine",
"mcp-server",
"skills"
]
}
Loading