How to connect Codex to n8n
Connect Codex to n8n’s instance-level MCP server with OAuth and discover the workflows available to your account.
Free guide · Updated
Based on official documentation · Checked
Ask your agent
Copy the prompt and paste it into your assistant.
Quick answer
Enable n8n’s instance-level MCP server, add its HTTP endpoint to Codex and complete OAuth. Use the endpoint shown by n8n, which ends in /mcp-server/http; the editor homepage is a different URL.
1. Prepare the n8n instance
In n8n, open Settings → Instance-level MCP and enable access with an owner or admin account. In Connection details, select Connect and copy the Server URL. The newer Connect a client dialog is available from n8n 2.33.0; older installations may show a simpler screen.
2. Add the server
Replace YOUR_N8N_DOMAIN with the host serving your n8n instance. For n8n Cloud, this is normally your instance’s app.n8n.cloud host. Copying the exact Server URL from settings is the safest way to preserve the correct hostname and protocol.
codex mcp add n8n --url "https://YOUR_N8N_DOMAIN/mcp-server/http"3. Complete OAuth
Use the CLI command rather than pasting JSON into Codex’s TOML configuration. Start Codex from the environment where the server was added, then inspect /mcp.
Approve access to the intended n8n instance and review the requested permissions. This OAuth route does not require putting an MCP access token into a prompt.
codex mcp login n8n4. Make the intended workflow available
Workflow search may show previews for workflows your n8n account can access. Full workflow access and operations require explicitly enabling MCP for that workflow, plus the permissions granted to the client. In the workflow’s Settings, use Available in MCP, or manage it from the instance MCP settings.
Practice
Check the connection
- Ask Codex to find one explicitly named workflow and explain its triggers and inputs using n8n MCP. Do not execute it yet.
Output: The client returns details matching the workflow in your n8n instance. Discovery, full access and permission to execute are checked separately.
Troubleshooting
Wrong endpoint: use the full Server URL rather than the editor address. OAuth denied: check account permissions and allowed callback settings. A workflow found in search but unavailable for operations may need MCP access enabled. On self-hosted n8n, check that a reverse proxy forwards the MCP endpoint correctly.
Disconnect and execution limits
Remove the n8n entry from Codex and revoke that client’s access under n8n Connected clients. Avoid disabling instance-wide MCP just to disconnect one client. Before asking the assistant to execute a workflow, review its side effects; n8n documents production execution as the default for execute_workflow.
Sources