Skip to main content
Prisma Documentation Docs

Search documentation

Type to search this documentation.

On this pageOverview

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 .md to 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

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.

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.
  • 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.

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.

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.

  • Agent Skills: Give your AI coding agent up-to-date Prisma knowledge with installable skills
  • ChatGPT: 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 editor
  • GitHub Copilot: Learn about the features available with GitHub Copilot and Prisma ORM, plus best practices and tips
  • MCP server: Manage Prisma Postgres databases, Prisma Compute deployments, and Object Storage with the Prisma MCP server.
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu