start
Launch the n8n automation server on a specified port with optional tunnel for webhook testing, replacing the standard n8n start command.
Instructions
Start n8n server - replaces "n8n start" command
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | Port to run n8n on (default: 5678) | |
| tunnel | No | Enable tunnel for webhook testing |
Input Schema (JSON Schema)
{
"properties": {
"port": {
"description": "Port to run n8n on (default: 5678)",
"type": "number"
},
"tunnel": {
"description": "Enable tunnel for webhook testing",
"type": "boolean"
}
},
"type": "object"
}
Implementation Reference
- src/tools/registry.ts:324-339 (schema)Schema definition for the 'start' tool, defining input parameters port and tunnel.name: 'start', description: 'Start n8n server - replaces "n8n start" command', inputSchema: { type: 'object', properties: { port: { type: 'number', description: 'Port to run n8n on (default: 5678)', }, tunnel: { type: 'boolean', description: 'Enable tunnel for webhook testing', }, }, }, },
- src/tools/handler.ts:185-190 (handler)ToolHandler.handleTool switch case that dispatches 'start' tool call to N8nManager.startN8n.case 'start': return await this.n8nManager.startN8n({ port: args?.port as number, tunnel: args?.tunnel as boolean, });
- src/n8n/manager.ts:950-995 (handler)Core implementation of starting n8n server: constructs 'n8n start' command with options, executes it in background, returns success message with URL.async startN8n(options: { port?: number; tunnel?: boolean; } = {}): Promise<any> { try { let command = 'n8n start'; if (options.port) { command = `N8N_PORT=${options.port} ${command}`; } if (options.tunnel) { command += ' --tunnel'; } console.error(`Starting n8n: ${command}`); // Start n8n in background exec(command, (error, stdout, stderr) => { if (error) { console.error(`n8n error: ${error}`); } }); // Give it a moment to start await new Promise(resolve => setTimeout(resolve, 2000)); const port = options.port || 5678; const url = options.tunnel ? 'Check console for tunnel URL' : `http://localhost:${port}`; return { content: [ { type: 'text', text: `π n8n started successfully!\n\n` + `π URL: ${url}\n` + `π§ Port: ${port}\n` + `${options.tunnel ? 'π Tunnel: Enabled\n' : ''}` + `\nUse Ctrl+C to stop n8n when done.`, }, ], }; } catch (error: any) { throw new Error(`Failed to start n8n: ${error.message}`); } }
- src/server/mcflow.ts:76-78 (registration)MCP server registers all tools by calling getToolDefinitions() which includes the 'start' tool schema.this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: getToolDefinitions(), }));