Codex (/docs/ai/tools/codex)
For the complete Prisma documentation index, see llms.txt. A markdown version of any docs page is available by appending
.mdto its URL.
Learn how to install the Prisma Codex plugin and use Prisma MCP from Codex
Location: AI > AI Tools > Codex
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
Section titled “Install the Prisma Codex plugin”Add the Prisma plugin marketplace to Codex:
codex plugin marketplace add prisma/codex-pluginThen restart Codex and install the plugin:
- Open the Codex plugin directory.
- Select the
Prismamarketplace. - Install the
Prismaplugin.
If your Codex CLI does not recognize the plugin marketplace add command, update Codex and try again.
Prisma MCP server
Section titled “Prisma MCP server”The plugin configures the official remote 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.
- List automated backups and restore them into new databases.
- Create and manage connection strings.
- Execute SQL queries.
- Introspect database schemas.
- Manage Prisma Compute deployments, read app logs, and set environment variables.
- Manage Object Storage buckets and access keys.
Example prompts
Section titled “Example prompts”After installing the plugin, try prompts like:
Set up Prisma ORM in this project with the right database adapter.Use Prisma MCP to list my Prisma Postgres databases.Inspect this project and upgrade it to Prisma ORM 7.Use Prisma MCP to inspect my database schema and plan a migration.Safety
Section titled “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.
Related pages
Section titled “Related pages”Agent Skills: Give your AI coding agent up-to-date Prisma knowledge with installable skillsChatGPT: Learn how to add the Prisma MCP server to ChatGPT to manage your databases and Compute deployments.Cursor: Learn tips and best practices for using Prisma ORM with the Cursor AI code editorGitHub Copilot: Learn about the features available with GitHub Copilot and Prisma ORM, plus best practices and tipsMCP server: Manage Prisma Postgres databases, Prisma Compute deployments, and Object Storage with the Prisma MCP server.