# Codex + GitCMS — Connect Codex to Your Website CMS

> Use Codex to prepare your repository and set up GitCMS, then connect Codex over MCP so its content changes arrive as reviewable drafts.

Canonical: https://gitcms.dev/agents/codex/

Use Codex to prepare your repository and set up GitCMS, then connect Codex over MCP so its content changes arrive as reviewable drafts.

## What is Codex?

Codex is OpenAI’s coding agent. It works in your terminal, editor, and the cloud, reads and changes code across a repository, and can use MCP servers for external tools.

## Why connect it to GitCMS?

Codex makes building and changing a site fast. GitCMS makes it runnable by everyone else. Codex sets up GitCMS on the repo, clients and marketers edit through the GitCMS editor, and when Codex drafts content through GitCMS, it goes through review instead of straight to production.

## Setup

### 1. Make the site client-editable

Ask Codex to move hardcoded copy into content collections without changing the rendered site. See the “Make a site client-editable” prompt.

### 2. Set up GitCMS on the repository

Add the site in GitCMS, choose Set up with your coding agent, and paste the prompt into Codex. It runs the setup CLI and pushes the .gitcms configuration.

```text
npx create-gitcms@latest --yes
```

### 3. Connect Codex to GitCMS

Add the GitCMS MCP server, then sign in to GitCMS in the browser.

```text
codex mcp add gitcms --url https://mcp.gitcms.dev
codex mcp login gitcms
```

### 4. Check the connection

Start Codex and ask it to list your GitCMS sites.

## Example prompts

### Release post from a pull request

```text
Read the pull request I just merged. Using GitCMS, draft a short blog post for [site] announcing the feature for customers, and submit it for review.
```

### Keep docs in sync

```text
Compare our docs on [site] with the current CLI flags in this repo. Using GitCMS, fix outdated docs entries in one content task and submit it for review.
```

### Prepare a client handoff

```text
Move all client-editable copy into content collections, keep the design identical, then run the GitCMS setup and summarize what the client will be able to edit.
```

## FAQ

### Can I configure GitCMS in Codex’s config file instead?

Yes. Add an mcp_servers.gitcms entry with url = "https://mcp.gitcms.dev" to your Codex config.toml, then run codex mcp login gitcms to sign in.

### Is this the same as connecting ChatGPT?

No. ChatGPT connects as an app in the chat, with the GitCMS editor inside the conversation. Codex connects as an MCP server in your coding environment and works through tool calls.

### Can the agent publish to my live site?

Not on sites that use review before publish. Agents can create content tasks, draft, edit, and submit for review; publishing is a human action in GitCMS. Sites that use direct publish commit saves straight to the default branch, for agents too.

### Does the agent get access to my repository?

No. The agent works through GitCMS’s content tools with the scopes you grant. It never receives your Git credentials.

### Do I need a paid GitCMS plan?

Agent access through MCP requires a licensed site. In preview mode you can explore the site in the web app, but MCP stays locked.
