- 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
n8n MCP Server for VS Code
A Model Context Protocol (MCP) server that integrates n8n workflow automation directly into VS Code through GitHub Copilot Chat.
Features
- List Workflows: Browse all workflows in your n8n instance
- Get Workflow Details: View complete workflow configuration, nodes, and connections
- Update Workflows: Modify workflow settings, nodes, and connections
- Activate/Deactivate: Control workflow activation state
- Execute Workflows: Manually trigger workflow execution
- View Executions: Check execution history and results
Prerequisites
- Node.js (v18 or higher)
- VS Code with GitHub Copilot Chat extension
- Access to an n8n instance (running at
http://srvdocker02:8098by default)
Installation
- Clone or navigate to this repository:
cd /home/rwiegand/Nextcloud/entwicklung/Werkzeuge/n8n_vscode_integration
- Install dependencies:
npm install
- Build the project:
npm run build
- Configure your n8n instance URL (if different from default):
- Copy
.env.exampleto.env - Update
N8N_BASE_URLwith your n8n instance URL - If your n8n instance requires authentication, add your API key:
N8N_API_KEY=your-api-key-here
- Copy
Configuration
For VS Code
The .vscode/settings.json file is already configured to use this MCP server. The configuration looks like:
{
"mcpServers": {
"n8n": {
"command": "node",
"args": [
"/home/rwiegand/Nextcloud/entwicklung/Werkzeuge/n8n_vscode_integration/dist/index.js"
],
"env": {
"N8N_BASE_URL": "http://srvdocker02:8098"
}
}
}
}
For GitHub Copilot Chat (Global Configuration)
To use this MCP server across all VS Code workspaces, add it to your global VS Code settings:
- Open VS Code Settings (JSON) with
Cmd/Ctrl + Shift + P→ "Preferences: Open User Settings (JSON)" - Add the MCP server configuration:
{
"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"
}
}
}
}
If your n8n instance requires an API key, add it to the env section:
"env": {
"N8N_BASE_URL": "http://srvdocker02:8098",
"N8N_API_KEY": "your-api-key-here"
}
Usage
After installation and configuration, you can interact with your n8n instance through GitHub Copilot Chat in VS Code using natural language:
Example Commands
List all workflows:
@workspace List all my n8n workflows
Get workflow details:
@workspace Show me the details of workflow ID 123
Update a workflow:
@workspace Update workflow 123 to change its name to "New Name"
Activate/Deactivate workflows:
@workspace Activate workflow 123
@workspace Deactivate workflow 456
Execute a workflow:
@workspace Execute workflow 123
View execution history:
@workspace Show me the recent executions for workflow 123
@workspace Show me the last 10 executions
Get execution details:
@workspace Show me details of execution abc-123
Available MCP Tools
The server exposes the following tools:
- list_workflows - List all workflows
- get_workflow - Get detailed workflow information
- update_workflow - Update workflow configuration
- activate_workflow - Activate a workflow
- deactivate_workflow - Deactivate a workflow
- execute_workflow - Execute a workflow manually
- get_execution - Get execution details
- list_executions - List workflow executions
Development
Watch Mode
npm run watch
Build
npm run build
Run Directly
npm run dev
Troubleshooting
Server Not Connecting
- Verify the build is up to date:
npm run build - Check that the path in settings.json is correct
- Restart VS Code after making configuration changes
- Check the Output panel in VS Code for error messages
Authentication Issues
If your n8n instance requires authentication:
- Generate an API key in your n8n instance (Settings → API)
- Add the
N8N_API_KEYenvironment variable to your configuration
Network Issues
If you can't connect to your n8n instance:
- Verify the n8n instance is running:
curl http://srvdocker02:8098/healthz - Check firewall settings
- Verify the URL in your configuration is correct
API Reference
n8n API Endpoints Used
GET /api/v1/workflows- List workflowsGET /api/v1/workflows/:id- Get workflowPATCH /api/v1/workflows/:id- Update workflowPOST /api/v1/workflows/:id/execute- Execute workflowGET /api/v1/executions- List executionsGET /api/v1/executions/:id- Get execution
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.