Learning Timeline
Key Insights
API Key Security
Never share your n8n API key with anyone. Anyone with access to this key can gain full control over your n8n account.
Mandatory Restart Step
Claude Desktop does not automatically detect changes to the configuration file. You must fully 'Quit' the application (not just close the window) and reopen it.
Full Configuration vs Basic
Use the 'Full Configuration' if you want Claude to assist in debugging executions or creating workflows directly within your n8n instance, rather than just generating code snippets.
Step by Step
Initial Setup: Claude Desktop & Node.js
- Download and install Claude Desktop from the official Claude website.
- Log in using your existing account or create a new free account.
- Visit the Node.js website and select the version compatible with your operating system (Windows or Mac).
- Download the Node.js installer and follow the installation prompts until completion.
- Ensure Node.js is correctly installed before proceeding to the next step.
Running the n8n MCP Server
- Open 'Terminal' if you are on a Mac, or 'Command Prompt' if you are using Windows.
- Copy and paste the following command: `npx n8n-mcp` into the terminal.
- Press 'Enter' to execute the command.
- If this is your first time running it, the terminal will ask if you want to install the package. Press 'y' and then 'Enter' to confirm.
- Verify that the terminal indicates the n8n MCP server is running.
Configuring the Claude Desktop Config File
- Open the Claude Desktop application.
- Click on your profile or settings icon, then locate the 'Local MCP Servers' section.
- Click the 'Edit Config' button. This will open the folder on your computer containing the `claude_desktop_config.json` file.
- Open the `claude_desktop_config.json` file using a code editor (like VS Code) or a standard text editor (like Notepad/TextEdit).
- Copy the MCP configuration block (Full Configuration) and paste it into the JSON file.
Connecting n8n API to Claude
- Open your n8n instance in your browser.
- Copy your n8n URL starting from 'https://' up to '.cloud' (or your specific host domain) and paste it into the URL field in the config file.
- In n8n, click the 'Settings' menu at the bottom near your account name.
- Select 'n8n API' from the left sidebar.
- Click 'Create a new API key', name it (e.g., 'n8n MCP Demo'), and click 'Create'.
- Copy the generated API key and paste it into the API Key section of your `claude_desktop_config.json` file.
- Save the configuration file.
- Fully 'Quit' Claude Desktop and restart it to allow Claude to load the new configuration.
- Click the 'Search and tools' icon (the hammer/search icon) in Claude to ensure the MCP server is active.