Cover image
Try Now
2025-03-10

完整用于光标中N8N工作流程管理的MCP服务器

3 years

Works with Finder

1

Github Watches

3

Github Forks

6

Github Stars

n8n MCP Server

A Model Context Protocol (MCP) server that enables seamless management of n8n workflows directly within LLMs and AI agents through the Smithery Model Context Protocol.

MCP Compatible npm version

Features

  • List available workflows from n8n
  • View workflow details
  • Execute workflows
  • Monitor workflow executions
  • Pass parameters to workflows
  • MCP-compatible interface for AI agents

Getting Started

Quick Start

  1. Install the package

    npm install @dopehunter/n8n-mcp-server
    
  2. Create a .env file

    cp .env.example .env
    
  3. Configure your n8n connection Edit the .env file and set:

    • N8N_BASE_URL: URL to your n8n instance (e.g., http://localhost:5678/api)
    • N8N_API_KEY: Your n8n API key (generate this in n8n settings)
  4. Start the server

    npm start
    
  5. Test the server

    curl -X POST http://localhost:3000/mcp -H "Content-Type: application/json" \
      -d '{"jsonrpc":"2.0","id":"1","method":"mcp.tools.list","params":{}}'
    

Common Issues and Troubleshooting

  • Connection Refused Errors: Make sure your n8n instance is running and accessible at the URL specified in N8N_BASE_URL
  • API Key Issues: Verify your n8n API key is correct and has appropriate permissions
  • Docker Issues: Ensure Docker is running before attempting to build or run the Docker image

For more detailed troubleshooting, see the Troubleshooting Guide.

Components

Tools

  • n8n_list_workflows

    • List all workflows in the n8n instance
    • Input: None
  • n8n_get_workflow

    • Get details of a specific workflow
    • Input: workflowId (string, required): ID of the workflow to retrieve
  • n8n_execute_workflow

    • Execute an n8n workflow
    • Inputs:
      • workflowId (string, required): ID of the workflow to execute
      • data (object, optional): Data to pass to the workflow
  • n8n_get_executions

    • Get execution history for a workflow
    • Inputs:
      • workflowId (string, required): ID of the workflow to get executions for
      • limit (number, optional): Maximum number of executions to return
  • n8n_activate_workflow

    • Activate a workflow
    • Input: workflowId (string, required): ID of the workflow to activate
  • n8n_deactivate_workflow

    • Deactivate a workflow
    • Input: workflowId (string, required): ID of the workflow to deactivate

Prerequisites

  • Node.js (v14+)
  • n8n instance with API access
  • An LLM or AI agent that supports the Model Context Protocol

Configuration Options

Docker Configuration

{
  "mcpServers": {
    "n8n": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "--init", "-e", "N8N_API_KEY=$N8N_API_KEY", "-e", "N8N_BASE_URL=$N8N_BASE_URL", "mcp/n8n-mcp-server"]
    }
  }
}

NPX Configuration

{
  "mcpServers": {
    "n8n": {
      "command": "npx",
      "args": ["-y", "@dopehunter/n8n-mcp-server"]
    }
  }
}

Installation

NPM

npm install @dopehunter/n8n-mcp-server

Direct Usage with npx

npx @dopehunter/n8n-mcp-server

From Source

git clone https://github.com/dopehunter/n8n_MCP_server_complete.git
cd n8n_MCP_server_complete
npm install
cp .env.example .env
# Edit the .env file with your n8n API details

Development

Start the development server:

npm run start:dev

Build the project:

npm run build

Run tests:

npm test

Usage With Claude or Other LLMs

  1. Start the MCP server:

    npm start
    
  2. Configure your LLM client to use the MCP server:

    • For Claude Desktop, use the configuration from the "Configuration Options" section.
    • For other clients, point to the server URL (e.g., http://localhost:3000/mcp).
  3. Your LLM can now use n8n workflows directly through MCP commands.

Building Docker Image

docker build -t mcp/n8n-mcp-server .

API Documentation

See the API Documentation for details on the available MCP functions.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the ISC License.

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • Khalid kalib
  • Write professional emails

  • ANGEL LEON
  • A world class elite tech co-founder entrepreneur, expert in software development, entrepreneurship, marketing, coaching style leadership and aligned with ambition for excellence, global market penetration and worldy perspectives.

  • INFOLAB OPERATIONS 2
  • A medical specialist offering assistance grounded in clinical guidelines. Disclaimer: This is intended for research and is NOT safe for clinical use!

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

  • zhaoyunxing92
  • MCP(消息连接器协议)服务

    Reviews

    3 (1)
    Avatar
    user_xhAyh6sZ
    2025-04-17

    As a dedicated user of the n8n_MCP_server_complete, I am truly impressed by its functionality and ease of use. Developed by the talented dopehunter, this server is extremely reliable and integrates smoothly with my projects. The detailed documentation and comprehensive features make automation tasks effortless. Highly recommend checking it out at https://github.com/dopehunter/n8n_MCP_server_complete!