Implement n8n-MCP integration
This commit adds a complete integration between n8n workflow automation and the Model Context Protocol (MCP): Features: - MCP server that exposes n8n workflows as tools, resources, and prompts - Custom n8n node for connecting to MCP servers from workflows - Bidirectional bridge for data format conversion - Token-based authentication and credential management - Comprehensive error handling and logging - Full test coverage for core components Infrastructure: - TypeScript/Node.js project setup with proper build configuration - Docker support with multi-stage builds - Development and production docker-compose configurations - Installation script for n8n custom node deployment Documentation: - Detailed README with usage examples and API reference - Environment configuration templates - Troubleshooting guide 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
50
scripts/install-n8n-node.sh
Executable file
50
scripts/install-n8n-node.sh
Executable file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script to install the MCP node into n8n
|
||||
|
||||
set -e
|
||||
|
||||
echo "Installing n8n MCP node..."
|
||||
|
||||
# Build the project
|
||||
echo "Building project..."
|
||||
npm run build
|
||||
|
||||
# Create custom nodes directory if it doesn't exist
|
||||
N8N_CUSTOM_DIR="${N8N_CUSTOM_DIR:-$HOME/.n8n/custom}"
|
||||
mkdir -p "$N8N_CUSTOM_DIR/nodes/n8n-mcp"
|
||||
|
||||
# Copy node files
|
||||
echo "Copying node files to n8n custom directory..."
|
||||
cp dist/n8n/MCPNode.node.js "$N8N_CUSTOM_DIR/nodes/n8n-mcp/"
|
||||
cp dist/n8n/MCPApi.credentials.js "$N8N_CUSTOM_DIR/nodes/n8n-mcp/"
|
||||
|
||||
# Copy utils for the node to work
|
||||
mkdir -p "$N8N_CUSTOM_DIR/nodes/n8n-mcp/utils"
|
||||
cp -r dist/utils/* "$N8N_CUSTOM_DIR/nodes/n8n-mcp/utils/"
|
||||
|
||||
# Create package.json for the custom node
|
||||
cat > "$N8N_CUSTOM_DIR/nodes/n8n-mcp/package.json" << EOF
|
||||
{
|
||||
"name": "n8n-nodes-mcp",
|
||||
"version": "1.0.0",
|
||||
"description": "MCP integration for n8n",
|
||||
"n8n": {
|
||||
"n8nNodesApiVersion": 1,
|
||||
"credentials": [
|
||||
"dist/n8n/MCPApi.credentials.js"
|
||||
],
|
||||
"nodes": [
|
||||
"dist/n8n/MCPNode.node.js"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@modelcontextprotocol/sdk": "^1.12.1"
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
echo "MCP node installed successfully!"
|
||||
echo "Please restart n8n for the changes to take effect."
|
||||
echo ""
|
||||
echo "Custom node location: $N8N_CUSTOM_DIR/nodes/n8n-mcp"
|
||||
Reference in New Issue
Block a user