diff --git a/apps/docs/content/docs/ai/index.mdx b/apps/docs/content/docs/ai/index.mdx index 6bf8c98902..4099f57c23 100644 --- a/apps/docs/content/docs/ai/index.mdx +++ b/apps/docs/content/docs/ai/index.mdx @@ -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 @@ -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. diff --git a/apps/docs/content/docs/ai/tools/codex.mdx b/apps/docs/content/docs/ai/tools/codex.mdx new file mode 100644 index 0000000000..0cf3fcb557 --- /dev/null +++ b/apps/docs/content/docs/ai/tools/codex.mdx @@ -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. diff --git a/apps/docs/content/docs/ai/tools/mcp-server.mdx b/apps/docs/content/docs/ai/tools/mcp-server.mdx index 7bf4df0438..da9892a819 100644 --- a/apps/docs/content/docs/ai/tools/mcp-server.mdx +++ b/apps/docs/content/docs/ai/tools/mcp-server.mdx @@ -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). diff --git a/apps/docs/content/docs/ai/tools/meta.json b/apps/docs/content/docs/ai/tools/meta.json index 9dde859d65..2109775638 100644 --- a/apps/docs/content/docs/ai/tools/meta.json +++ b/apps/docs/content/docs/ai/tools/meta.json @@ -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" + ] }