- Implemented MCP server with 8 n8n tools - Added n8n API client for workflow operations - Configured VS Code settings with API authentication - Added comprehensive documentation and setup guides - Tested and verified connection to n8n instance
2.5 KiB
2.5 KiB
Quick Setup Guide
Step 1: Get Your n8n API Key
- Open your n8n instance at
http://srvdocker02:8098 - Go to Settings → API
- Click Create API Key
- Copy the generated API key
Step 2: Configure the API Key
Option A: Create .env file (Recommended for local testing)
Create a .env file in this directory:
N8N_BASE_URL=http://srvdocker02:8098
N8N_API_KEY=your-api-key-here
Option B: Update VS Code Settings
Edit .vscode/settings.json and add your API key:
{
"mcpServers": {
"n8n": {
"command": "node",
"args": [
"/home/rwiegand/Nextcloud/entwicklung/Werkzeuge/n8n_vscode_integration/dist/index.js"
],
"env": {
"N8N_BASE_URL": "http://srvdocker02:8098",
"N8N_API_KEY": "your-api-key-here"
}
}
}
}
Option C: Global VS Code Settings
For use across all workspaces, add to your User Settings JSON:
- Press
Cmd/Ctrl + Shift + P - Type "Preferences: Open User Settings (JSON)"
- Add:
{
"github.copilot.chat.mcp.servers": {
"n8n": {
"command": "node",
"args": [
"/home/rwiegand/Nextcloud/entwicklung/Werkzeuge/n8n_vscode_integration/dist/index.js"
],
"env": {
"N8N_BASE_URL": "http://srvdocker02:8098",
"N8N_API_KEY": "your-api-key-here"
}
}
}
}
Step 3: Test the Connection
Run the test script:
N8N_API_KEY=your-api-key-here node test-connection.js
You should see:
✓ Successfully connected to n8n!
✓ Found X workflow(s)
Step 4: Restart VS Code
After updating the configuration, restart VS Code to load the MCP server.
Step 5: Use in Copilot Chat
Open Copilot Chat and try:
@workspace List all my n8n workflows
Troubleshooting
"401 Unauthorized" Error
- Your API key is missing or incorrect
- Make sure you've added
N8N_API_KEYto the environment variables - Generate a new API key in n8n if needed
"Connection Refused" Error
- Verify n8n is running:
curl http://srvdocker02:8098/healthz - Check if the URL is correct
- Verify network connectivity to the server
MCP Server Not Found in Copilot
- Make sure you've run
npm run build - Verify the path in settings.json is correct
- Restart VS Code
- Check VS Code Output panel for errors (View → Output → GitHub Copilot Chat)
Changes Not Taking Effect
- Run
npm run buildafter code changes - Restart VS Code to reload the MCP server
- Check that your settings.json is valid JSON