n8n MCP server

Integrates with n8n to enable workflow automation, credential management, and execution control through Node.js and Express endpoints
Back to servers
Provider
Suleman Manji
Release date
Mar 25, 2025
Language
TypeScript
Package
Stats
152 downloads

The n8n MCP Tools server enables seamless integration between n8n workflows and AI assistants using the Model Context Protocol (MCP). This implementation provides access to n8n's complete Public API through a set of specialized tools that AI assistants can use via natural language.

Installation

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn
  • An n8n instance with an API key

Installing as a Package

The easiest way to get started is to install the package globally:

# Install globally
npm install -g n8n-mcp-tools

# Create a .env file in your working directory
echo "N8N_API_BASE_URL=https://your-n8n-instance.com/api/v1
N8N_API_KEY=your-api-key
PORT=3000" > .env

# Start the MCP server
n8n-mcp-server

Installing from Source

Alternatively, you can clone and set up the repository directly:

  1. Clone the repository:

    git clone https://github.com/yourusername/n8n-mcp-tools.git
    cd n8n-mcp-tools
    
  2. Install dependencies:

    npm install
    
  3. Create a .env file with your configuration:

    N8N_API_BASE_URL=https://your-n8n-instance.com/api/v1
    N8N_API_KEY=your-api-key
    PORT=3000
    
  4. Start the server:

    npm start
    
  5. Access the API documentation at:

    http://localhost:3000/api-docs
    

Configuration Options

The server can be configured using environment variables:

  • N8N_API_BASE_URL: Base URL for the n8n API
  • N8N_API_KEY: API key for authentication
  • PORT: Port to run the server on
  • HOST: Host to bind the server to
  • LOG_LEVEL: Logging level (info, error, debug)
  • MCP_SOCKET_PATH: Path for the MCP socket (for STDIO transport)
  • MCP_USE_TCP: Whether to use TCP for MCP transport
  • MCP_TCP_PORT: TCP port for MCP transport
  • MCP_TCP_HOST: TCP host for MCP transport

Available MCP Tools

The server provides multiple tool categories that enable AI assistants to interact with n8n:

User Management

  • get-users: Retrieve all users from n8n instance
  • get-user: Get a specific user by ID or email
  • create-users: Create one or more users
  • delete-user: Delete a user by ID or email
  • change-user-role: Change a user's global role

Workflow Management

  • get-workflows: Retrieve all workflows from n8n instance
  • get-workflow: Get a specific workflow by ID
  • create-workflow: Create a new workflow
  • update-workflow: Update an existing workflow
  • delete-workflow: Delete a workflow by ID
  • activate-workflow: Activate a workflow
  • deactivate-workflow: Deactivate a workflow
  • get-workflow-tags: Get tags for a workflow
  • update-workflow-tags: Update tags for a workflow
  • transfer-workflow: Transfer a workflow to another project

Additional Tools

The server also includes tools for:

  • Credentials management
  • Execution control
  • Tag management
  • Variable management
  • Project organization
  • Audit functionality

Usage Examples

Retrieving Workflows

To fetch all workflows from your n8n instance using an AI assistant:

Ask the AI: "Get all my workflows from n8n"

Behind the scenes, the AI assistant will use the get-workflows tool provided by the MCP server.

Creating a New Workflow

To create a new workflow:

Ask the AI: "Create a new workflow called 'Email Notification' with the tag 'communication'"

The AI assistant will use the create-workflow tool, passing the appropriate parameters.

Activating a Workflow

To activate a specific workflow:

Ask the AI: "Activate the workflow with ID 5"

The assistant will utilize the activate-workflow tool to perform this action.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later