Skip to main content
Glama

start

Launch the n8n automation server to execute workflows, configure ports, and enable webhook testing tunnels.

Instructions

Start n8n server - replaces "n8n start" command

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portNoPort to run n8n on (default: 5678)
tunnelNoEnable tunnel for webhook testing

Implementation Reference

  • Core implementation of the 'start' tool: executes 'n8n start' CLI command with optional port and tunnel options, starts in background, and 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}`);
      }
    }
  • ToolHandler.handleTool() switch case that routes 'start' tool calls to N8nManager.startN8n() with parsed arguments.
    case 'start':
      return await this.n8nManager.startN8n({
        port: args?.port as number,
        tunnel: args?.tunnel as boolean,
      });
  • Registers the 'start' MCP tool in getToolDefinitions() array with name, description, and inputSchema.
    {
      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',
          },
        },
      },
    },
  • Input schema definition for the 'start' tool validating port (number) and tunnel (boolean) parameters.
    inputSchema: {
      type: 'object',
      properties: {
        port: {
          type: 'number',
          description: 'Port to run n8n on (default: 5678)',
        },
        tunnel: {
          type: 'boolean',
          description: 'Enable tunnel for webhook testing',
        },
      },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mckinleymedia/mcflow-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server