n8n MCP Tools

MIT License
95
  • Linux
  • Apple

Integrations

  • Supports configuration through environment variables stored in .env files, allowing for flexible deployment and configuration of the MCP server.

  • Provides a complete implementation of n8n's Public API, enabling AI assistants to manage workflows, users, credentials, executions, tags, variables, projects, and audit functionality through natural language interactions.

  • Includes Swagger documentation for the RESTful API server, making the API endpoints discoverable and testable through a web interface.

n8n MCP Tools

A Model Context Protocol (MCP) server implementation for n8n API integration. This project enables seamless integration between n8n workflows and AI assistants using the MCP protocol.

Features

  • Complete implementation of n8n's Public API (v1.1.1)
  • MCP tools for all API endpoints
  • RESTful API server with Swagger documentation
  • Modular architecture for extensibility
  • Authentication middleware

Structure

The project is organized into the following components:

  • api/endpoints/: API endpoint implementations for each resource type
  • api/schemas/: Data model schema definitions
  • api/tools/: MCP tool implementations for each resource type
  • api/index.js: Main server entry point
  • api/config.js: Configuration settings

Getting Started

Prerequisites

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

Installation

As a package

# 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

From source

  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:
    http://localhost:3000/api-docs

MCP Tools

The MCP tools enable AI assistants to interact with n8n through natural language. Here are some example tools:

User Tools

  • get-users: Get 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 Tools

  • get-workflows: Get 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

And many more tools for Credentials, Executions, Tags, Variables, Projects, and Audit functionality.

Configuration

The server can be configured using environment variables or by modifying api/config.js:

  • 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

License

This project is licensed under the MIT License - see the LICENSE file for details.

Publishing

If you're contributing to this package and need to publish a new version:

  1. Update the version in package.json:
    npm version patch # for bug fixes npm version minor # for new features npm version major # for breaking changes
  2. Publish to npm:
    npm publish
  3. The postversion script will automatically push the new version to GitHub.

Contributing

Contributions are welcome! Please see our Contributing Guide for details.

Changelog

See the CHANGELOG.md file for details on the changes for each version.

-
security - not tested
A
license - permissive license
-
quality - not tested

A Model Context Protocol server that enables AI assistants to interact with n8n workflows through natural language, providing access to n8n's complete API functionality including workflow management, user administration, and credential handling.

  1. Features
    1. Structure
      1. Getting Started
        1. Prerequisites
        2. Installation
      2. MCP Tools
        1. User Tools
        2. Workflow Tools
      3. Configuration
        1. License
          1. Publishing
            1. Contributing
              1. Changelog
                ID: 6itt4az3yj