# Connecting Claude Desktop to Self-Hosted n8n MCP Server
**Using mcp-remote with Token Authentication**
—
## Overview
This guide explains how to connect Claude Desktop to a self-hosted n8n instance using the MCP (Model Context Protocol) server.
The standard method via **Settings → Connectors → Add Custom Connector** often fails with OAuth authentication errors on self-hosted n8n instances. This guide provides a workaround using `mcp-remote` with Access Token authentication.
—
## Prerequisites
Before you begin, ensure you have:
– **Claude Desktop** installed (with a paid subscription: Pro, Max, Team, or Enterprise)
– **Node.js** installed (v18 or higher recommended)
– **Self-hosted n8n instance** with MCP enabled
– **Admin access** to your n8n instance
### Verify Node.js Installation
Open Command Prompt (Windows) or Terminal (Mac/Linux) and run:
“`bash
node –version
npm –version
npx –version
“`
If Node.js is not installed, download it from [nodejs.org](https://nodejs.org/).
—
## Step 1: Enable MCP in n8n
1. Log into your n8n instance as an admin
2. Go to **Settings → Instance-level MCP**
3. Enable MCP access
4. Note your MCP Server URL (it will look like `https://your-n8n-domain.com/mcp-server/http`)
### Enable Workflows for MCP Access
For Claude to access your workflows, you need to enable MCP on each workflow:
1. Open a workflow you want to expose
2. Click the **workflow menu** (three dots in the top-right corner)
3. Select **Settings**
4. Toggle **”Available in MCP”** to ON
5. Save the workflow
Repeat for any workflows you want Claude to access.
—
## Step 2: Get Your n8n MCP Access Token
Since OAuth often fails with self-hosted instances, we’ll use Access Token authentication:
1. In n8n, go to **Settings → Instance-level MCP**
2. Click **Connection details**
3. Switch to the **Access Token** tab
4. **Copy the token immediately** — you can only see it once!
> ⚠️ **Important:** If you’ve already generated a token and can’t see it, you’ll need to regenerate a new one.
—
## Step 3: Install mcp-remote
`mcp-remote` is a bridge that allows Claude Desktop to connect to remote MCP servers.
Open Command Prompt (Windows) or Terminal (Mac/Linux) and run:
“`bash
npm install -g mcp-remote
“`
### Verify Installation
“`bash
where mcp-remote # Windows
which mcp-remote # Mac/Linux
“`
You should see the path to the mcp-remote executable.
—
## Step 4: Test the Connection
Before configuring Claude Desktop, test that `mcp-remote` can connect to your n8n instance:
“`bash
mcp-remote https://your-n8n-domain.com/mcp-server/http –header “Authorization: Bearer YOUR_TOKEN_HERE”
“`
Replace:
– `your-n8n-domain.com` with your actual n8n domain
– `YOUR_TOKEN_HERE` with your actual Access Token
### Expected Output
If successful, you’ll see:
“`
[XXXX] Connecting to remote server: https://your-n8n-domain.com/mcp-server/http
[XXXX] Connected to remote server using StreamableHTTPClientTransport
[XXXX] Local STDIO server running
[XXXX] Proxy established successfully between local STDIO and remote StreamableHTTPClientTransport
[XXXX] Press Ctrl+C to exit
“`
Press `Ctrl+C` to stop the test.
### Troubleshooting Connection Issues
| Error | Solution |
|——-|———-|
| `HTTP 404` | Check the MCP URL – try `/mcp-server/http` instead of `/mcp-server/sse` |
| `HTTP 401` | Token is invalid or expired – regenerate it in n8n |
| `ENOTFOUND` | Domain not found – verify your n8n URL is correct |
| `Connection refused` | n8n is not running or firewall is blocking |
—
## Step 5: Configure Claude Desktop
### Locate the Config File
**Windows:**
“`
%APPDATA%\Claude\claude_desktop_config.json
“`
**Mac:**
“`
~/Library/Application Support/Claude/claude_desktop_config.json
“`
**Linux:**
“`
~/.config/Claude/claude_desktop_config.json
“`
### Open the Config File
**Windows (Command Prompt):**
“`bash
notepad %APPDATA%\Claude\claude_desktop_config.json
“`
**Mac (Terminal):**
“`bash
open -a TextEdit ~/Library/Application\ Support/Claude/claude_desktop_config.json
“`
If the file doesn’t exist, create it.
### Add the n8n MCP Server Configuration
Replace the entire contents of the file with (or merge if you have existing servers):
“`json
{
“mcpServers”: {
“n8n”: {
“command”: “mcp-remote”,
“args”: [
“https://your-n8n-domain.com/mcp-server/http”,
“–header”,
“Authorization: Bearer YOUR_TOKEN_HERE”
]
}
}
}
“`
Replace:
– `your-n8n-domain.com` with your actual n8n domain
– `YOUR_TOKEN_HERE` with your actual Access Token
### Example with Real Values
“`json
{
“mcpServers”: {
“n8n”: {
“command”: “mcp-remote”,
“args”: [
“https://n8n.example.com/mcp-server/http”,
“–header”,
“Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…”
]
}
}
}
“`
### Adding Multiple MCP Servers
If you have other MCP servers, add them as separate entries:
“`json
{
“mcpServers”: {
“n8n”: {
“command”: “mcp-remote”,
“args”: [
“https://n8n.example.com/mcp-server/http”,
“–header”,
“Authorization: Bearer YOUR_N8N_TOKEN”
]
},
“another-server”: {
“command”: “npx”,
“args”: [“another-mcp-server”]
}
}
}
“`
> ⚠️ **Important:** JSON does not allow trailing commas. Make sure there’s no comma after the last entry in each object.
—
## Step 6: Restart Claude Desktop
1. **Completely quit Claude Desktop**
– Windows: Check the system tray (bottom right), right-click Claude icon → Exit
– Mac: Click Claude in menu bar → Quit Claude
2. **Verify it’s fully closed**
– Windows: Open Task Manager and ensure no Claude processes are running
– Mac: Use Activity Monitor to check
3. **Reopen Claude Desktop**
—
## Step 7: Verify the Connection
### Check Developer Settings
1. Open Claude Desktop
2. Go to **Settings → Developer**
3. Look for **”n8n”** in the Local MCP Servers section
4. Status should show **”running”**
### Check Available Tools
1. In a chat window, click the **”+”** button at the bottom
2. Look for **Connectors** or a hammer icon (🔨)
3. You should see your n8n tools listed
### Test with a Prompt
Ask Claude:
“`
What n8n workflows do I have available?
“`
or
“`
List my n8n MCP tools
“`
Claude should respond with information about your available workflows.
—
## Troubleshooting
### Server Not Appearing in Developer Settings
1. Check the config file for JSON syntax errors (use a JSON validator)
2. Ensure `mcp-remote` is installed globally and in your PATH
3. Verify the token hasn’t expired
4. Check Claude Desktop logs:
– Windows: `%APPDATA%\Claude\logs\mcp-server-n8n.log`
– Mac: `~/Library/Logs/Claude/mcp-server-n8n.log`
### “Command not found” Error
If Claude can’t find `mcp-remote`:
1. Find the full path:
“`bash
where mcp-remote # Windows
which mcp-remote # Mac/Linux
“`
2. Use the full path in your config:
“`json
{
“mcpServers”: {
“n8n”: {
“command”: “C:\\Users\\YourUsername\\AppData\\Roaming\\npm\\mcp-remote.cmd”,
“args”: [
“https://your-n8n-domain.com/mcp-server/http”,
“–header”,
“Authorization: Bearer YOUR_TOKEN_HERE”
]
}
}
}
“`
### Connection Times Out
– Ensure your n8n instance is publicly accessible (or accessible from your network)
– Check if a firewall is blocking the connection
– Verify the MCP endpoint is correct (`/mcp-server/http` not `/mcp-server/sse`)
### Token Expired
1. Go to n8n **Settings → Instance-level MCP**
2. Generate a new Access Token
3. Update your `claude_desktop_config.json` with the new token
4. Restart Claude Desktop
—
## Security Best Practices
1. **Keep your token secret** — never share it publicly or commit it to version control
2. **Use environment variables** (for advanced users with wrapper scripts):
Create a batch file (Windows) `n8n-mcp.bat`:
“`batch
@echo off
mcp-remote https://your-n8n-domain.com/mcp-server/http –header “Authorization: Bearer %N8N_MCP_TOKEN%”
“`
Then set the environment variable and reference the script in config.
3. **Regenerate tokens periodically** — especially if you suspect they may have been compromised
4. **Limit MCP-enabled workflows** — only enable MCP on workflows that Claude needs to access
—
## Quick Reference
| Item | Location/Value |
|——|—————-|
| Claude Desktop Config (Windows) | `%APPDATA%\Claude\claude_desktop_config.json` |
| Claude Desktop Config (Mac) | `~/Library/Application Support/Claude/claude_desktop_config.json` |
| Claude Desktop Logs (Windows) | `%APPDATA%\Claude\logs\` |
| Claude Desktop Logs (Mac) | `~/Library/Logs/Claude/` |
| n8n MCP Settings | Settings → Instance-level MCP |
| n8n MCP URL Format | `https://your-domain.com/mcp-server/http` |
| Install mcp-remote | `npm install -g mcp-remote` |
—
## Summary
To connect Claude Desktop to a self-hosted n8n MCP server:
1. Enable MCP in n8n and get your Access Token
2. Install `mcp-remote` via npm
3. Test the connection from command line
4. Add the configuration to `claude_desktop_config.json`
5. Restart Claude Desktop
6. Verify connection in Settings → Developer
This workaround bypasses the OAuth issues that commonly occur with self-hosted n8n instances when using the standard Connectors UI.
—
*Last updated: January 2026*

