- 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
158 lines
4.3 KiB
Markdown
158 lines
4.3 KiB
Markdown
# 🎉 n8n VS Code Integration - Ready to Use!
|
|
|
|
Your n8n MCP (Model Context Protocol) server has been successfully set up and configured!
|
|
|
|
## ✅ What's Been Installed
|
|
|
|
1. **MCP Server** - TypeScript-based server that connects VS Code to n8n
|
|
2. **n8n API Client** - Handles all communication with your n8n instance
|
|
3. **Configuration Files** - Pre-configured with your n8n instance and API key
|
|
4. **Documentation** - Complete setup and usage guides
|
|
|
|
## 🔧 Current Configuration
|
|
|
|
- **n8n Instance**: `http://srvdocker02:8098`
|
|
- **API Key**: Configured ✓
|
|
- **Connection Status**: ✅ Successfully connected
|
|
- **Workflows Found**: 1 workflow ("My workflow")
|
|
|
|
## 🚀 Next Steps
|
|
|
|
### 1. Restart VS Code
|
|
For the MCP server to be available in GitHub Copilot Chat, you need to restart VS Code:
|
|
- Close and reopen VS Code
|
|
- Or use `Cmd/Ctrl + Shift + P` → "Developer: Reload Window"
|
|
|
|
### 2. Start Using It!
|
|
|
|
Open GitHub Copilot Chat and try these commands:
|
|
|
|
#### List Workflows
|
|
```
|
|
@workspace List all my n8n workflows
|
|
```
|
|
|
|
#### Get Workflow Details
|
|
```
|
|
@workspace Show me the details of the workflow "My workflow"
|
|
```
|
|
|
|
#### Execute a Workflow
|
|
```
|
|
@workspace Execute the workflow with ID Zk4gbBzjxVppHiCB
|
|
```
|
|
|
|
#### View Executions
|
|
```
|
|
@workspace Show me recent executions
|
|
```
|
|
|
|
#### Update a Workflow
|
|
```
|
|
@workspace Update workflow Zk4gbBzjxVppHiCB to deactivate it
|
|
```
|
|
|
|
## 📋 Available Operations
|
|
|
|
The MCP server provides these tools to GitHub Copilot:
|
|
|
|
| Tool | Description |
|
|
|------|-------------|
|
|
| `list_workflows` | List all workflows in your n8n instance |
|
|
| `get_workflow` | Get complete workflow details including nodes |
|
|
| `update_workflow` | Modify workflow configuration |
|
|
| `activate_workflow` | Activate a workflow |
|
|
| `deactivate_workflow` | Deactivate a workflow |
|
|
| `execute_workflow` | Manually trigger a workflow |
|
|
| `get_execution` | Get details of a specific execution |
|
|
| `list_executions` | View execution history |
|
|
|
|
## 🧪 Testing
|
|
|
|
Test the connection anytime with:
|
|
```bash
|
|
node test-connection.js
|
|
```
|
|
|
|
Expected output:
|
|
```
|
|
✓ Successfully connected to n8n!
|
|
✓ Found 1 workflow(s)
|
|
```
|
|
|
|
## 📁 Project Structure
|
|
|
|
```
|
|
n8n_vscode_integration/
|
|
├── src/
|
|
│ ├── index.ts # Main MCP server
|
|
│ └── n8n-client.ts # n8n API client
|
|
├── dist/ # Compiled JavaScript
|
|
├── .vscode/
|
|
│ └── settings.json # VS Code MCP configuration
|
|
├── .env # Environment variables (API key)
|
|
├── package.json # Dependencies
|
|
├── README.md # Full documentation
|
|
├── SETUP.md # Setup guide
|
|
└── test-connection.js # Connection test script
|
|
```
|
|
|
|
## 🔒 Security Note
|
|
|
|
Your API key is stored in:
|
|
- `.env` file (for local testing)
|
|
- `.vscode/settings.json` (for MCP server)
|
|
|
|
Both files are in `.gitignore` to prevent accidental commits. Keep your API key secure!
|
|
|
|
## 🛠️ Development
|
|
|
|
If you want to modify the server:
|
|
|
|
```bash
|
|
# Watch for changes and rebuild automatically
|
|
npm run watch
|
|
|
|
# Or build manually
|
|
npm run build
|
|
|
|
# After rebuilding, restart VS Code to reload the MCP server
|
|
```
|
|
|
|
## 📖 Documentation
|
|
|
|
- **README.md** - Complete documentation and API reference
|
|
- **SETUP.md** - Detailed setup instructions
|
|
- **THIS FILE** - Quick start guide
|
|
|
|
## 💡 Example Use Cases
|
|
|
|
1. **Workflow Development**: Ask Copilot to help you understand and modify workflows
|
|
2. **Automation**: Execute workflows directly from VS Code
|
|
3. **Monitoring**: Check execution history and debug failures
|
|
4. **Documentation**: Have Copilot explain what your workflows do
|
|
5. **Batch Operations**: Use Copilot to perform operations on multiple workflows
|
|
|
|
## 🆘 Need Help?
|
|
|
|
If something doesn't work:
|
|
|
|
1. Check that VS Code has been restarted
|
|
2. Verify the connection: `node test-connection.js`
|
|
3. Check VS Code Output panel: View → Output → GitHub Copilot Chat
|
|
4. Review SETUP.md for troubleshooting steps
|
|
|
|
## 🎯 What You Can Ask Copilot
|
|
|
|
- "List all my n8n workflows"
|
|
- "Show me the most recent executions"
|
|
- "Execute workflow X"
|
|
- "What does workflow Y do?" (Copilot will fetch and analyze it)
|
|
- "Activate all inactive workflows"
|
|
- "Show me failed executions"
|
|
- "Update workflow X to change [setting]"
|
|
|
|
---
|
|
|
|
**You're all set! Restart VS Code and start using n8n with GitHub Copilot Chat! 🚀**
|