n8n
Connect n8n workflows to 2LY
n8n workflows connect to 2LY through the MCP Client Tool node, providing access to your configured tools via the MCP protocol.
Overview
Integration uses n8n's MCP Client Tool node to:
- Discover and load tools from 2LY runtime
- Execute tool calls through MCP protocol
- Handle authentication and routing automatically
Quick Start
Prerequisites
# Ensure 2LY is running
npm run start
# n8n installed and running
# Visit http://localhost:5678Add MCP Client Tool Node
- Open your n8n workflow
- Add MCP Client Tool node from the sidebar
- Configure the MCP server:
{
"type": "mcp",
"server": "http://localhost:7801",
"runtime": "@2ly/runtime"
}- Connect the MCP node to your workflow components
Basic Workflow
Trigger → MCP Client Tool → Process Data → OutputThe MCP Client Tool node discovers all tools from your 2LY workspace and makes them available within the workflow.
Configuration
MCP Server Settings
- Type: Must be "mcp"
- Server URL: Your 2LY MCP endpoint (default:
http://localhost:7801) - Runtime: Package name
@2ly/runtime
Environment Variables
export NATS_SERVERS="nats://localhost:4222"
export WORKSPACE_ID="my-workspace"Example Workflow
Automated File Processing
Schedule Trigger → MCP: read_file →
Process Content → MCP: write_file →
Send Notification- Schedule Trigger: Run workflow on schedule
- MCP: read_file: Read file using 2LY filesystem tool
- Process Content: Transform or analyze data
- MCP: write_file: Save results using 2LY filesystem tool
- Send Notification: Alert via email/Slack
Troubleshooting
MCP Connection Failed
# Verify 2LY services
docker-compose ps
# Check runtime endpoint
curl http://localhost:7801/healthTools Not Loading
- Verify server URL in MCP Client Tool node
- Check tools are configured in 2LY dashboard
- Ensure 2LY runtime is connected
Workflow Execution Issues
- Check n8n execution logs
- Verify tool permissions in 2LY dashboard
- Test tools individually in 2LY playground
Next Steps
- Tool Configuration - Add tools to workspace
- Capabilities - Group and manage tools
- Universal MCP - Custom adapter guide