Connect Codex

Connect Codex to DocuWriter.ai with MCP so Codex can browse spaces, search documents, generate documentation, and create or update DocuWriter.ai pages from your coding workspace.

Prerequisites

  • A DocuWriter.ai account
  • Codex installed and available on your command line

Step 1 - Add the MCP server

Run:

codex mcp add docuwriter --url https://app.docuwriter.ai/mcp

This adds DocuWriter.ai as a streamable HTTP MCP server in Codex.

Step 2 - Authenticate

Run:

codex mcp login docuwriter --scopes mcp:use

Then:

  1. Sign in to DocuWriter.ai in the browser.
  2. Approve access.
  3. Return to Codex.

No manual API token is required.

Step 3 - Verify installation

Run:

codex mcp list

You should see docuwriter with URL:

https://app.docuwriter.ai/mcp

Step 4 - Validate the connection

In Codex, ask:

List my DocuWriter spaces with IDs.

If the connection is successful, Codex will return the spaces available to your DocuWriter.ai account.

Manual configuration

You can also add the server manually to ~/.codex/config.toml:

[mcp_servers.docuwriter]
url = "https://app.docuwriter.ai/mcp"

Then authenticate:

codex mcp login docuwriter --scopes mcp:use

Local development

For a local DocuWriter.ai app served by Laravel Herd:

codex mcp add docuwriter-local --url https://docs-ai.test/mcp
codex mcp login docuwriter-local --scopes mcp:use

Useful prompts

List my DocuWriter spaces with IDs.
Search all my DocuWriter spaces for "authentication".
Search space 22854 for "MCP".
Open document 118972 in space 22854.
Generate documentation for this file and save it to space 22854 as "API overview".
Create a document called "Deployment guide" in space 22854.
Update document 12345 in space 22854 with this Markdown content: ...
List pending repository sync suggestions for space 22854.
Apply suggestion 12345.

Troubleshooting

  • If docuwriter appears in codex mcp list but tools do not appear in a running Codex session, restart Codex.
  • If authentication fails, run codex mcp logout docuwriter and then codex mcp login docuwriter --scopes mcp:use.
  • Use the production URL unless you are testing a local DocuWriter.ai development app.