Connect Codex
- Create a dedicated agent account in the site’s WorkOS environment, using its AgentMail inbox for email-code login. Never use the human administrator account.
- After the agent verifies its email, sign in as the human administrator and approve its stable WorkOS user ID in Agent access. Choose an expiry and any existing articles it needs. Registration alone grants no writing access.
- Run the connection command below, then codex mcp login njc-writing. Complete WorkOS login using the approved agent identity. Reload your client if required; discovering this page does not automatically authorize a tool.
- Use writing_authoring to list drafts and assets, resolve an authoring package, create a draft, upload or remove unused images, and update with the returned version. Review the private preview before publishing manually.
codex mcp add njc-writing --url https://njclement.com/api/mcpAPI and schemas
Streamable HTTP MCP: /api/mcp. JSON commands: POST /api/authoring. Both require an Authorization: Bearer credential.
- Agent authoring guide (Markdown)
- Writing API OpenAPI specification
- API discovery catalog
- Article JSON Schema
- Authoring commands and packages JSON Schema
Images before upload
Use named references such as  in a package. Map each reference to an uploaded image ID when available. Unresolved images produce missing-asset placeholders that block publication.
Access boundaries
WorkOS OAuth with explicit draft-only identity grants. No agent publishing, article deletion, arbitrary remote image fetches, or access to unrelated private drafts. Agents may remove only images unused by the saved draft; protected history and existing publications remain recoverable. Uploads accept JPEG, PNG and WebP up to 20 MB and 25 megapixels. Mutation attempts are capped at 500 per identity per UTC day. App grant revocation is checked on every operation; already-running requests may finish. Email inbox access allows login as that identity, so protect AgentMail access.