Connect the Codex CLI to your WordPress site
The Codex CLI stores MCP servers in config.toml. After adding the server, run codex mcp login to sign in to WordPress in your browser. The Codex desktop app is listed separately on the Connect screen and uses OAuth only.
What you need
- WPSays Free on WordPress 6.9 or later with PHP 8.0 or later.
- The Codex CLI installed.
Add your site to Codex CLI
- In WordPress admin, open the WPSays MCP server dashboard and make sure AI Abilities is on. Under Connect a client, choose OAuth, then Codex CLI. The screen fills in your own site address and a server name for you.
- Add the block below to
~/.codex/config.toml(macOS and Linux) or%USERPROFILE%\.codex\config.toml(Windows). Or run the two commands that follow it. - Sign in with
codex mcp login your-siteand approve access in the browser.
[mcp_servers.your-site]
url = "https://your-site.com/wp-json/mcp/flavors-engine-oauth"codex mcp add your-site --url https://your-site.com/wp-json/mcp/flavors-engine-oauth
codex mcp login your-siteCheck the connection with a safe read
Ask your client for something you can check in WordPress, such as: What is my site title? The client should call Get Site Settings and return the same value you see under Settings → General. A read like this changes nothing on the site. Get Site Settings reference
If it does not connect
- 401 or a sign-in loop. Sign in again from the client, and check that it uses the exact URL from Connect a client, including the full path.
- 403 or a firewall page. A security plugin, host firewall or Cloudflare rule is blocking
/wp-json/. WPSays Free has a Diagnostics screen with a Run Connection Doctor button that tests the route and, if needed, switches the Connect screen to the?rest_route=form of the address. - Tools are missing. The connection only lists the abilities its scope allows, and kits for other plugins load only when that plugin is active. Check the access you approved at sign-in, or the scope of the access token.
All client guides · What the AI can change and how to undo it