Connecting Codex to WordPress.com from Termux on Android, debugging MCP and OAuth errors, and keeping publishing under human control.
You can run Codex from an Android terminal and connect it to WordPress.com through the Model Context Protocol (MCP). This guide documents not only the successful setup, but also the connection failures encountered along the way: an incorrect endpoint that returned HTTP 404, an OAuth callback that depended on Termux remaining open, credentials that did not persist into a fresh process, and WordPress sites whose plans or connection states limited the available tools.
The example device is a Samsung Galaxy S26 Ultra, although the workflow applies to other Android phones capable of running a maintained Termux build. The important parts are the Codex CLI, the exact MCP endpoint, a working OAuth credential store, and a deliberate draft-first publishing workflow.
Using Claude instead? See Publishing to WordPress with Claude and the WordPress MCP Connector for the corresponding browser-based Claude workflow, WordPress HTML constraints, and reusable-skill approach.
🔐 Keep Termux running during OAuth, and never paste an access token into a prompt.
Start authentication with codex mcp login wpcom-mcp. The browser redirects to a temporary callback on 127.0.0.1, so the Codex process in Termux must remain alive to receive it.
After approval, start a fresh Codex session and verify the server again. Treat ~/.codex as private configuration and never commit it to a public repository.
Once the connection works, keep the workflow conservative: let Codex research and draft first, create or update the WordPress draft second, review it in the editor, and publish only after the exact site and post have been confirmed.
AI Workflows · 2026
✦ This article was assembled with the assistance of OpenAI Codex and checked against current official Codex documentation ✦
