Connect an Agent

Codex

Add MoraWP to Codex CLI, approve its access, and verify the connection.

Codex connects to MoraWP over MCP using browser OAuth. You add the server URL, then approve a connection to a Workspace. You do not create or paste a MoraWP static Agent key.

This guide covers Codex CLI. The commands were checked against CLI 0.154.0 and OpenAI's documentation on October 4, 2026. Other Codex surfaces may place MCP setup in their settings.

Before you begin

Connect a WordPress website and make sure you can access its Workspace. On your computer, check that Codex is installed:

codex --version

If the command is unavailable, use OpenAI's CLI installation instructions.

Add MoraWP

Open Agents → Connect an Agent → Codex in the Dashboard. The dialog shows the MCP endpoint and the two setup commands.

Run the add command in your terminal:

codex mcp add morawp --url https://api.morawp.com/mcp

Expected result: Codex saves a server named morawp. Adding the URL alone does not approve access to your Workspace.

If you already configured that name, check its URL before changing anything:

codex mcp get morawp

Approve the connection

Start OAuth sign-in:

codex mcp login morawp

Use the browser page that opens to sign in to MoraWP and review the request. Confirm the intended app and Workspace, choose the websites and Ability access, then read and acknowledge the data-access notice.

An enabled Integration can expose its complete available data, including private fields and credentials. Read only restricts changes, not the sensitivity of the information returned. Review the access before approving.

Approve the request, then return to the terminal and the Dashboard setup dialog. Complete the dialog's prompts once authorization has succeeded.

Expected result: the terminal reports successful authorization and the connection appears in Agents in the selected Workspace.

Verify in Codex

Check the saved server configuration:

codex mcp list

Then start a Codex session and use /mcp to inspect the active servers. A configured entry is not proof that WordPress access works. Make a read request:

Use MoraWP to list the websites this Agent can access. Do not make changes.

Expected result: Codex returns the websites allowed for this connection. Continue with Quickstart to verify an actual WordPress read.

Troubleshooting

ProblemNext step
codex is not foundInstall the CLI, reopen your terminal, and run codex --version.
morawp is not configuredRun the add command in the same Codex environment you use for your session.
Authorization was cancelled or expiredRun codex mcp login morawp again and complete the new browser request.
Server is configured but requests require sign-inComplete OAuth login. Check that the Agent connection has not been removed in MoraWP.
Connected, but the expected website is missingCheck the selected Workspace and the Agent's website access in MoraWP.
An Ability is deniedReview the Agent's mode and the Workspace's enabled Abilities. Repeating the same call does not grant access.
WordPress returns an errorUse WordPress tool failed.

Remove access

Remove the connection in MoraWP when Codex should no longer reach the Workspace. For local cleanup, OpenAI also provides:

codex mcp logout morawp
codex mcp remove morawp

Local logout or removal is separate from removing the MoraWP Agent connection. Review Agent access when managing other authorized sessions.

See OpenAI's MCP documentation for current Codex configuration options.

MoraWP documentation