Prerequisites
- Codex installed
- Node.js installed on your system
- n8n instance (optional, for full workflow management)
Installation
Add n8n-MCP Configuration
Add the following configuration to your
config.toml file:- Basic Configuration
- Full Configuration
Documentation tools only - No n8n API connection required.
~/.codex/config.toml
Set Up Project Instructions
For optimal results, create an Copy the project instructions into this file.
AGENTS.md file in your project root with the instructions from the Claude Project Setup section.Configuration Format
TOML Configuration Structure
Codex uses TOML format for MCP server configuration:Environment Variables
Mode for MCP communication. Use “stdio” for Codex.
Logging level. Set to “error” to reduce noise.
Set to “true” to disable console output.
Your n8n instance URL (e.g.,
https://your-n8n-instance.com or http://localhost:5678)Your n8n API key for workflow management operations
Managing Your MCP Server
Check Server Status
Enter the Codex CLI and use the/mcp command to see server status and available tools:
View Available Tools
List all available n8n-MCP tools:Remove the Server
To remove the MCP server, edit~/.codex/config.toml and remove the [mcp_servers.n8n] section, then restart Codex.
Verification
To verify your setup is working:Usage Examples
Building a Workflow
Node Search
Configuration Validation
Tips
- Use the
/mcpcommand frequently to check server status - Always validate node configurations before building workflows
- Use
AGENTS.mdto maintain consistent AI behavior - Test workflows with basic configuration before adding API credentials
Troubleshooting
MCP server not appearing
MCP server not appearing
- Verify the TOML syntax in
~/.codex/config.tomlis correct - Check that Node.js and npx are installed:
npx --version - Restart Codex completely
- Review Codex logs for error messages
TOML syntax errors
TOML syntax errors
- Ensure all strings are in quotes
- Check that environment variables use the
{ "KEY" = "value" }format - Verify array syntax:
["item1", "item2"] - Use a TOML validator to check syntax
npx command not found
npx command not found
- Install Node.js: Visit nodejs.org
- Verify installation:
node --version && npm --version - Ensure npm is in your PATH
- Try using the full path to npx in the configuration
Connection to n8n fails
Connection to n8n fails
- Verify your n8n instance is running
- Check the
N8N_API_URLis correct and accessible - Verify your
N8N_API_KEYis valid - Test the connection:
curl -H "X-N8N-API-KEY: your-key" https://your-n8n-instance.com/api/v1/workflows
Tools not working as expected
Tools not working as expected
- Verify
AGENTS.mdexists in your project root - Check that the file content follows the recommended format
- Use
/mcp list n8nto see available tools - Review Codex output for specific error messages
Advanced Configuration
Multiple Environments
You can configure multiple n8n instances:~/.codex/config.toml
Custom Logging
Adjust logging levels for debugging:Next Steps
Claude Project Setup
Configure optimal project instructions
Available Tools
Explore all n8n-MCP tools
Building Workflows
Learn workflow best practices
AGENTS.md Template
Get the recommended instructions