Codex

Learn how to install the Prisma Codex plugin and use Prisma MCP from 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

Add the Prisma plugin marketplace to Codex:

Terminal
codex plugin marketplace add prisma/codex-plugin

Then restart Codex and install the plugin:

  1. Open the Codex plugin directory.
  2. Select the Prisma marketplace.
  3. 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:

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:

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

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.

On this page