|
| 1 | +--- |
| 2 | +description: "Host setup for OpenAI Codex" |
| 3 | +--- |
| 4 | + |
| 5 | +# OpenAI Codex Setup |
| 6 | + |
| 7 | +[OpenAI Codex](https://openai.com/blog/openai-codex) is OpenAI's terminal-first workspace that pairs a shell, editor, and conversational developer agent. With Model Context Protocol (MCP) support, you can connect Codex directly to Umbraco's tools and data so the assistant can work inside your projects. |
| 8 | + |
| 9 | +## Getting started |
| 10 | + |
| 11 | +Install the Codex CLI with npm: |
| 12 | + |
| 13 | +```bash |
| 14 | +npm install -g @openai/codex |
| 15 | +``` |
| 16 | + |
| 17 | +Or install the Codex CLI with brew: |
| 18 | + |
| 19 | +```bash |
| 20 | +brew install codex |
| 21 | +``` |
| 22 | + |
| 23 | +### Configure using the Codex CLI |
| 24 | + |
| 25 | +Add the Umbraco MCP server with the Codex CLI: |
| 26 | + |
| 27 | +```bash |
| 28 | +codex mcp add umbraco-mcp -- npx -y @umbraco-cms/mcp-dev@beta |
| 29 | +``` |
| 30 | + |
| 31 | +#### Define configuration values directly |
| 32 | + |
| 33 | +If you prefer to keep secrets in your shell session, pass them as environment variables during registration: |
| 34 | + |
| 35 | +```bash |
| 36 | +codex mcp add umbraco-mcp \ |
| 37 | + --env UMBRACO_CLIENT_ID="your-id" \ |
| 38 | + --env UMBRACO_CLIENT_SECRET="your-secret" \ |
| 39 | + --env UMBRACO_BASE_URL="https://your-domain.com" \ |
| 40 | + --env NODE_TLS_REJECT_UNAUTHORIZED="0" \ |
| 41 | + --env UMBRACO_INCLUDE_TOOL_COLLECTIONS="document,media,document-type,data-type" \ |
| 42 | + -- npx -y @umbraco-cms/mcp-dev@beta |
| 43 | +``` |
| 44 | + |
| 45 | +Replace the `UMBRACO_CLIENT_ID`, `UMBRACO_CLIENT_SECRET`, `UMBRACO_BASE_URL`, and `UMBRACO_INCLUDE_TOOL_COLLECTIONS` values with your local connection details. |
| 46 | + |
| 47 | +This command stores the MCP server as `umbraco-mcp` in your Codex configuration file (typically `~/.codex/config.toml`). |
| 48 | + |
| 49 | +{% hint style="info" %} |
| 50 | +Use the command below at any time to see which MCP servers Codex is currently loading: |
| 51 | + |
| 52 | +``` |
| 53 | +codex mcp list |
| 54 | +``` |
| 55 | +{% endhint %} |
| 56 | + |
| 57 | +## Managing tools and tool collections |
| 58 | + |
| 59 | +When you change the tool set: |
| 60 | + |
| 61 | +- Update your `.env` file with the tool collections you want (for example `document,media`). |
| 62 | +- Repeat the `codex mcp list` command to confirm that the server is healthy. |
0 commit comments