# Codex CLI + Render: Deploy and manage your Render apps from Codex CLI.

[Codex CLI](https://developers.openai.com/codex/) can combine local code changes with live Render service, deploy, log, metric, and database data from your terminal.

## Setup contract

- Preferred setup method: Codex plugin
- Preferred setup command: `In Codex: /plugins → install Render`
- MCP provided by: Render plugin
- Config file: `~/.codex/config.toml`
- Manual OAuth command: `codex mcp add render --url https://mcp.render.com/mcp --oauth-client-id codex`
- API key fallback command: `codex mcp add render --url https://mcp.render.com/mcp --bearer-token-env-var RENDER_API_KEY`
- OAuth client ID: `codex`
- API key environment variable: `RENDER_API_KEY`
- Skills supported: Yes
- Skills command: `In Codex: /plugins → install Render`
- Skills fallback command: `npx skills add render-oss/skills`
- Skills directory: `Plugin-managed; ~/.codex/skills/ for standalone skills`
- Auth: OAuth
- Restart required: No
- Verify: `list_workspaces`
- Fallback reference: [Full setup details](https://render.com/docs/mcp-server.md#codex-desktop-and-cli-setup)

## Quick start

1. *Install and start Codex CLI.*

   ```shell
   npm install -g @openai/codex
   codex
   ```

2. *Install the Render plugin.* Run `/plugins`, search for *Render*, and install it. The plugin includes Render skills and the hosted Render MCP server.

3. *Connect with OAuth.* Start a new Codex thread, use a Render MCP tool, and approve the browser prompt. No Render API key is required.

4. *Verify the connection.* Ask Codex to run `list_workspaces`, choose a workspace if needed, then try *"Deploy this project to Render."*

## MCP and authentication

- MCP install command: `Install Render from /plugins`
- MCP config file: `~/.codex/config.toml`
- OAuth: Supported

The plugin provides the Render MCP server with OAuth. Without the plugin, add the server manually:

```shell
codex mcp add render --url https://mcp.render.com/mcp --oauth-client-id codex
```

For CI, set `RENDER_API_KEY` and use `--bearer-token-env-var RENDER_API_KEY` instead. See the [MCP server docs](/docs/mcp-server) for the full configuration reference and the [Render plugin](https://github.com/render-oss/render-codex-plugin) for plugin details.

## Example prompts

- *Deploy:* Deploy this project to Render and explain the Blueprint before applying it.
- *Debug:* Check the latest failed deploy, fix the cause, and verify the next deploy.
- *Database:* Create a Render Postgres database and connect it to this service with DATABASE_URL.
- *Status:* Summarize the health, recent deploys, and error logs for my Render services.

## Common workflows

### Deploy from a Blueprint

- Ask Codex to inspect the repository and propose a `render.yaml` Blueprint.
- Review the services, databases, and environment variables.
- Apply the plan, then check the first deploy.

### Debug a failed deploy

- Ask Codex to fetch the latest failed deploy logs.
- Let it identify and fix the code, configuration, or environment issue.
- Verify the next deploy reaches a healthy state.

### Add a database

- Ask Codex to create a Render Postgres database.
- Store its internal connection string as `DATABASE_URL`.
- Add migrations to the service's pre-deploy command.