# Codex (/docs/ai/tools/codex)

Location: AI > AI Tools > 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 [#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.
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 [#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 [#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 [#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

- [`Agent Skills`](https://www.prisma.io/docs/ai/tools/skills): Give your AI coding agent up-to-date Prisma knowledge with installable skills
- [`ChatGPT`](https://www.prisma.io/docs/ai/tools/chatgpt): Learn how to add the Prisma MCP server to ChatGPT to manage your Prisma Postgres databases
- [`Cursor`](https://www.prisma.io/docs/ai/tools/cursor): Learn tips and best practices for using Prisma ORM with the Cursor AI code editor
- [`GitHub Copilot`](https://www.prisma.io/docs/ai/tools/github-copilot): Learn about the features available with GitHub Copilot and Prisma ORM, plus best practices and tips
- [`MCP server`](https://www.prisma.io/docs/ai/tools/mcp-server): Manage Prisma Postgres databases using LLMs with the Prisma Model-Context-Protocol (MCP) Server