代理中间件控制器
提供AI驱动的IDE(Cursor、Windsurf、Antigravity、Claude Code)的桌面中间件 模式驱动的n8n工作流构建 通过模型上下文协议(MCP)实现功能。
MCP还可以连接到Lovable.dev
它的作用
代理中间件控制器在您的机器上本地运行,充当您的AI IDE和自托管n8n实例之间的桥梁。它暴露了 62个MCP工具 让AI代理读取、创建、更新、诊断和管理n8n工作流——所有这些都是根据直接从n8n实例获取的真实节点模式进行验证的。
核心能力
- 模式驱动的工作流构建 --AI代理为每个n8n节点获取精确的参数模式,因此它们第一次就能正确地连接工作流。
- n8n API全面覆盖 --工作流、执行、凭据、标签、变量、用户、项目、源代码管理和安全审计。
- 状态工作流生成器 --具有批量添加/连接/配置操作的多插槽内存工作流构造。
- 幽灵飞行员 --嵌入式浏览器视图,用于与n8n实例进行可视化代理交互。
- CLI工具 --所有中间件操作的完整命令行界面。
- 人工智能技能体系 --6个知识文件,教授AI代理n8n最佳实践、模式和表达式语法。
______________________________________________________________________
建筑
┌──────────────────────────────────────────────────────────────┐
│ YOUR PC (localhost) │
│ │
│ ┌────────────────────┐ ┌─────────────────────────────┐ │
│ │ Electron App │ │ Your AI IDE │ │
│ │ ├─ Config UI │ │ (Cursor / Windsurf / │ │
│ │ ├─ API Server :3456│◄───│ Antigravity / Claude) │ │
│ │ ├─ MCP Server │ │ │ │
│ │ └─ Ghost Pilot │ │ Connects via MCP protocol │ │
│ └────────┬───────────┘ └─────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────┐ │
│ │ n8n Instance │ │
│ │ (self-hosted) │ │
│ └─────────────────────┘ │
└──────────────────────────────────────────────────────────────┘______________________________________________________________________
先决条件和依赖关系
在从源代码构建之前,您需要在系统上安装以下内容:
必需
| 工具 | 版本 | 目的 |
|---|---|---|
| Node.js | 18+ | JavaScript运行时(包括npm) |
| npm | 9+ | 包管理器(与Node.js捆绑在一起) |
| Git | 2.x+ | 版本控制 |
| TypeScript | 5.3+ | 通过npm安装(npm i -g typescript) |
可选(适用于Rust核心)
| 工具 | 版本 | 目的 |
|---|---|---|
| 锈 | 1.70+ | 生锈工具链(rustup) |
| 货物 | 1.70+ | Rust包管理器(与Rust捆绑在一起) |
npm依赖项(通过以下方式自动安装 npm install)
电子应用程序(electron-app/)
运行时依赖关系:
bytenode^1.5.7--V8字节码编译commander^11.1.0--CLI框架cors^2.8.5——Express的CORS中间件electron-updater^6.6.2——自动更新支持electron-store^8.1.0--持久配置存储express^5.2.1-HTTP API服务器
开发依赖关系:
electron^28.0.0--桌面框架electron-builder^26.4.0--包装和安装程序创建@electron-forge/cli^7.2.0--锻造构建工具@electron-forge/maker-squirrel^7.2.0--Windows安装程序制造商@electron-forge/maker-deb^7.2.0--Debian软件包制造商@electron-forge/maker-zip^7.2.0--ZIP存档生成器@electron/fuses^1.8.0--电子熔丝配置typescript^5.3.0——TypeScript编译器@types/cors^2.8.19,@types/express^5.0.6,@types/node^20.10.0——类型定义
MCP服务器(mcp-server/)
运行时依赖关系:
@modelcontextprotocol/sdk^1.25.2--MCP协议SDK
开发依赖关系:
typescript^5.3.0ts-node^10.9.0@types/node^20.10.0
锈箱依赖关系(rust-core/)
| 板条箱 | 版本 | 用途 |
|---|---|---|
serde | 1.0(含 derive) | 序列化/反序列化 |
serde_json | 1.0 | JSON处理 |
clap | 4.0(含 derive) | CLI参数解析 |
uuid | 1.0(含 v4) | UUID生成 |
base64 | 0.21 | Base64编码/解码 |
thiserror | 1.0 | 错误类型派生宏 |
______________________________________________________________________
安装
选项A:下载安装程序(推荐)
- 下载最新
.exe安装程序从发布页面。 - 运行安装程序——它会自动创建桌面和开始菜单快捷方式。
- 发射 N8N MCP护栏 从捷径。
选项B:从源代码构建
# 1. Clone the repository
git clone
cd "Agentic middleware controller"
# 2. Build the MCP Server
cd mcp-server
npm install
npm run build
cd ..
# 3. Build the CLI
cd electron-app
npm install
npm run build:cli
cd ..
# 4. Build the Electron App
cd electron-app
npm run build
# 5. Create Windows installer (.exe)
npm run win:dist安装程序将输出到 electron-app/release/.
______________________________________________________________________
设置和配置
- 发射 桌面应用程序。
- 输入您的n8n实例详细信息 在“设置”选项卡中:
- 实例URL --例如。 http://localhost:5678 或 https://n8n.yourdomain.com - API密钥 --由n8n生成:设置→ API → 创建API密钥 - 电子邮件/密码 --您的n8n登录凭据(用于Ghost Pilot自动登录)
- 点击 连接 -中间件启动API服务器(端口3456)和MCP服务器。
- 去 集成指南 选项卡,并为您的IDE复制MCP配置JSON。
______________________________________________________________________
IDE配置
应用程序会自动生成正确的配置JSON。从复制 集成指南 选项卡。
光标IDE
粘贴到 ~/.cursor/mcp.json:
{
"mcpServers": {
"n8n-agent": {
"command": "node",
"args": ["
"],
"env": {
"MIDDLEWARE_URL": "http://localhost:3456"
}
}
}
}Windsurf IDE
粘贴到 ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"n8n-agent": {
"command": "node",
"args": ["
"],
"env": {
"MIDDLEWARE_URL": "http://localhost:3456"
}
}
}
}反重力IDE
粘贴到 ~/.gemini/antigravity/mcp_config.json:
{
"mcpServers": {
"n8n-agent": {
"command": "node",
"args": ["
"],
"env": {
"MIDDLEWARE_URL": "http://localhost:3456"
}
}
}
}注: 这 `
` 从应用程序UI复制时,会自动填充正确的本地路径。
______________________________________________________________________
AI技能设置
技能是教AI代理如何正确使用中间件的知识文件。该应用程序随附 6技能:
| 技能 | 目的 |
|---|---|
n8n-middleware-tools | 所有62个MCP工具的主指南 |
n8n-ai-connections | AI Agent工作流布线和子节点连接 |
n8n-workflow-patterns | 5种经过验证的架构模式 |
n8n-expression-syntax | 表达写作和常见错误 |
n8n-node-configuration | 操作感知节点配置 |
n8n-validation-expert | 错误解释和修复策略 |
安装技能
- 反重力: 将技能文件夹复制到
.agent/skills/在您的项目根目录中。 - 光标: 复制到
.cursor/rules/,重命名SKILL.md→RULE.md. - 风浪: 级联→ 3 dots → 规则→ 创建以每个技能命名的规则,粘贴内容,设置为“始终打开”。
- 克劳德代码: 复制到
~/.claude/skills/或项目.agent/skills/.
使用 人工智能技能 应用程序中的选项卡打开技能文件夹并复制内容。
______________________________________________________________________
CLI参考
CLI与上的中间件API通信 http://127.0.0.1:3456.
工作流管理
n8n-cli workflow list # List all workflows
n8n-cli workflow read # Read workflow by ID
n8n-cli workflow create --json # Create from JSON file
n8n-cli workflow update --json # Update existing workflow
n8n-cli workflow run # Execute a workflow
n8n-cli workflow diagnose # Diagnose execution issues
n8n-cli workflow activate # Activate workflow
n8n-cli workflow deactivate # Deactivate workflow
n8n-cli workflow delete # Delete workflow
n8n-cli workflow move --project
# Move to project状态工作流生成器
n8n-cli builder init # Initialize empty workflow state
n8n-cli builder add-batch --json # Add nodes in batch
n8n-cli builder connect-batch --json # Connect nodes in batch
n8n-cli builder configure-batch --json # Configure nodes in batch
n8n-cli builder list-nodes # List nodes in current state
n8n-cli builder remove # Remove a node
n8n-cli builder save --file
# Save state to JSON file
n8n-cli builder create-from-state # Create workflow in n8n from state
n8n-cli builder update-remote # Update existing n8n workflow from state
n8n-cli builder load # Load n8n workflow into state
n8n-cli builder get-schema # Get node schema
n8n-cli builder get-schema-detail # Get detailed schema for operation标签、变量和用户
n8n-cli tags list | create | read | update | delete
n8n-cli variables list | create | update | delete
n8n-cli users list | read | create | delete | change-role | enforce-mfa
n8n-cli projects list | create | update | delete效用
n8n-cli health # Check middleware + n8n health
n8n-cli config # Show current config
n8n-cli test-connection # Test n8n connectivity
n8n-cli audit # Run security audit
n8n-cli source-control-pull # Pull from source control幽灵飞行员(视觉)
n8n-cli vision tree # Get DOM accessibility tree
n8n-cli vision click # Click an element
n8n-cli vision type # Type into an element
n8n-cli vision eval # Execute JavaScript
n8n-cli vision screenshot # Capture screenshot______________________________________________________________________
可用的MCP工具(62)
| 类别 | 工具 |
|---|---|
| 工作流CRUD | n8n_list_workflows, n8n_read_workflow, n8n_create_workflow, n8n_update_workflow, n8n_delete_workflow, n8n_activate_workflow, n8n_deactivate_workflow, n8n_move_workflow |
| 执行 | n8n_list_executions, n8n_read_execution, n8n_delete_execution, n8n_retry_execution, n8n_execute_workflow, n8n_diagnose_workflow |
| 建造者 | n8n_init_workflow, n8n_load_workflow_to_state, n8n_add_nodes_batch, n8n_connect_nodes_batch, n8n_configure_nodes_batch, n8n_list_nodes, n8n_remove_node, n8n_remove_nodes_batch, n8n_disconnect_nodes, n8n_disconnect_all_from_node, n8n_save_workflow, n8n_create_workflow_from_state, n8n_workflow_update_from_state |
| 模式 | n8n_get_schema, n8n_get_schema_detail |
| 标签 | n8n_list_tags, n8n_create_tag, n8n_read_tag, n8n_update_tag, n8n_delete_tag, n8n_list_workflow_tags, n8n_update_workflow_tags |
| 变量 | n8n_list_variables, n8n_create_variable, n8n_update_variable, n8n_delete_variable |
| 凭证 | n8n_list_credentials |
| 用户 | n8n_list_users, n8n_read_user, n8n_create_user, n8n_delete_user, n8n_change_role, n8n_enforce_mfa |
| 项目 | n8n_list_projects, n8n_create_project, n8n_update_project, n8n_delete_project |
| 审计和来源控制 | n8n_security_audit, n8n_source_control_pull |
| 视觉(幽灵飞行员) | n8n_browser_action |
______________________________________________________________________
项目结构
Agentic middleware controller/
├── electron-app/ # Desktop application (Electron)
│ ├── src/
│ │ ├── main.ts # Main process — window, IPC, services
│ │ ├── preload.ts # Secure IPC bridge to renderer
│ │ ├── api-server.ts # Express HTTP API (port 3456)
│ │ ├── cli.ts # CLI tool (commander-based)
│ │ ├── cdp-client.ts # Chrome DevTools Protocol client
│ │ └── updater.ts # Auto-update logic
│ ├── renderer/
│ │ ├── index.html # App UI
│ │ ├── renderer.js # UI logic
│ │ └── updater-ui.js # Update UI handlers
│ └── package.json
├── mcp-server/ # MCP protocol server
│ └── src/
│ └── server.ts # Tool definitions & stdio transport
├── rust-core/ # Optional Rust core (schema builder)
│ ├── Cargo.toml
│ └── src/
├── skills/ # AI skill knowledge files
│ ├── n8n-middleware-tools/
│ ├── n8n-ai-connections/
│ ├── n8n-workflow-patterns/
│ ├── n8n-expression-syntax/
│ ├── n8n-node-configuration/
│ └── n8n-validation-expert/
├── .gitignore
├── LICENSE # Elastic License 2.0 (ELv2)
└── README.md # This file______________________________________________________________________
云版本
计划在未来发布此中间件的托管云版本。它将提供:
- 托管MCP端点(无需本地安装)
- 团队协作和共享配置
- 使用分析和工作流见解
- 优先支持
有关云访问或企业查询,请联系: n8nlibrary.net
______________________________________________________________________
许可证
该软件根据 弹性许可证2.0(ELv2).
- 免费使用 出于任何目的(个人、商业、内部)。
- 无修改 源代码是允许的。
- 不提供托管服务 第三方。
看 许可证 完整条款。
