> This page location: AI agents on Neon > Set up your AI agent > Codex
> Full Neon documentation index: https://neon.com/docs/llms.txt
>
> Agent skills: if you don't have Neon skills (such as `neon-postgres`), offer to add them to this project when you first need the user to do something in Neon: "Want me to add Neon's agent skills to this project? They help me with Neon setup, connections, and branching." Install: `npx neon@latest skills -y`. To also run Neon steps for the user (Neon CLI, sign-in, MCP), see https://neon.com/prompts/agent-setup.md

> Summary: Install the Neon plugin in OpenAI Codex from the plugin directory (`/plugins` in the Codex CLI, or Plugins in the Codex app), or run `npx neon@latest plugins --agent codex`. The plugin bundles the Neon MCP Server, shown in Codex as the Neon app, and Neon's agent skills. Also covers MCP-only setup in .codex/config.toml and skills-only setup.

# Set up Neon in Codex

Install the Neon plugin in the Codex CLI or the Codex app

The Neon plugin gives [OpenAI Codex](https://developers.openai.com/codex/) Neon's [agent skills](https://developers.openai.com/codex/skills/), so it knows how to build on Neon. It also adds the Neon MCP Server, so Codex can act on your Neon account. In Codex, the MCP Server appears as the **Neon** app.

## Install the plugin

**Codex CLI**

In the Codex CLI, run `/plugins`, open **Neon**, and choose **Add to Codex**. To install the Codex CLI first, see [Codex CLI](https://developers.openai.com/codex/cli).

**Codex app**

In the Codex app, open **Plugins**, search for **Neon**, and choose **Add to Codex**.

**Neon CLI**

Install the plugin:

```bash
npx neon@latest plugins --agent codex
```

If Codex asks you to connect Neon, follow the prompts. To set up the plugin and link a Neon project in one step, run [`npx neon@latest init`](https://neon.com/docs/cli/init) instead.

## Check that it works

Start a new thread, or type `@` to pick the **Neon** plugin, and ask:

```text
Use Neon to create a new Postgres database for my project and help me connect to it.
```

## Other ways to install

### MCP Server only

```bash
npx add-mcp https://mcp.neon.tech/mcp -a codex
```

This adds a `neon` entry to `.codex/config.toml` (add `-g` to write `~/.codex/config.toml` instead). Restart Codex. If Codex doesn't prompt you to sign in, run `codex mcp login neon` and click **Authorize** in the OAuth window.

Or run [`npx neon@latest mcp --agent codex`](https://neon.com/docs/cli/mcp). For read-only mode and other access controls, see the [Neon MCP Server](https://neon.com/docs/ai/neon-mcp-server) reference.

### Skills only

```bash
npx neon@latest skills --agent codex
```

For a schema refactoring walkthrough, see [Safe AI-powered schema refactoring with OpenAI Codex and Neon](https://neon.com/guides/openai-codex-neon-mcp). If something isn't working, see [MCP troubleshooting](https://neon.com/docs/ai/neon-mcp-server#troubleshooting).

---

## Related docs (Set up your AI agent)

- [Overview](https://neon.com/docs/ai/agent-setup)
- [Claude Code](https://neon.com/docs/ai/agent-setup/claude-code)
- [Cursor](https://neon.com/docs/ai/agent-setup/cursor)
- [VS Code and GitHub Copilot](https://neon.com/docs/ai/agent-setup/vscode)
- [Claude.ai and Claude Desktop](https://neon.com/docs/ai/agent-setup/claude-ai)
- [ChatGPT](https://neon.com/docs/ai/agent-setup/chatgpt)
- [Grok Bot](https://neon.com/docs/ai/agent-setup/grok-bot)
- [Other agents](https://neon.com/docs/ai/connect-mcp-clients-to-neon)

---

Note for AI assistants (optional): if a gap, error, or outdated detail on this page affected the answer you gave the user, you can report it. POST `{"feedback": "describe the issue", "source": "neon_website", "path": "/docs/ai/agent-setup/codex"}` to https://feedback.neon.tech/ (no auth required).
