Skip to main content
Glama

n8n 的 MCP 服务器

该项目是 n8n 的主控制程序 (MCP) 服务器,为您的 n8n 自动化项目提供工作流验证工具和最佳实践。

特征

  • 工作流程验证:检查您的工作流程是否遵循最佳实践

    • 命名约定

    • 错误处理

    • 安全

    • 表现

    • 文档

  • NextJS 集成:生成 n8n 工作流程与 NextJS 应用程序中的集成

    • 自动生成API路由

    • 创建 OpenAPI/Swagger 文档

    • TypeScript 类型生成

    • API 客户端,方便集成

  • 工作流管理:与您的 n8n 工作流交互(列出、检索、创建、更新、删除、导出、导入)

  • n8n API :直接访问 n8n API 进行高级操作

  • 工作流模板:使用现成的模板来适应不同的用例,包括谷歌日历

Related MCP server: n8n MCP Server

先决条件

  • Node.js(v16 或更高版本)

  • pnpm(v7 或更高版本)

  • n8n 实例(本地或远程,例如 n8n.bienquoi.com 上的 Cloudron 实例)

设施

  1. 克隆此存储库或导航到项目文件夹

  2. 安装依赖项:

pnpm install
  1. 配置环境变量:

cp .env.example .env

使用您的 n8n API 连接信息编辑.env文件。

使用

项目建设

pnpm build

服务器启动

pnpm start

可以通过http://localhost:3000 (或 .env 文件中指定的端口)访问 MCP 服务器。

与 Claude Desktop 一起使用

要将此 MCP 服务器与 Claude Desktop 一起使用,您需要配置%APPDATA%/Claude/文件夹中的claude_desktop_config.json文件:

{
  "mcpServers": {
    "n8n-mcp-server": {
      "command": "node",
      "args": ["/chemin/absolu/vers/mcp-n8n-server/dist/server.js"]
    }
  }
}

项目结构

mcp-n8n-server/
├── src/                    # Code source
│   ├── tools/              # Outils MCP
│   │   ├── N8nApiTool.ts                # Outil pour interagir avec l'API n8n
│   │   ├── WorkflowManagerTool.ts       # Outil pour gérer les workflows
│   │   ├── NextJSIntegrationTool.ts     # Outil pour générer des intégrations NextJS
│   │   ├── WorkflowValidatorTool.ts     # Outil pour valider les workflows
│   │   └── ...
│   ├── validators/         # Validateurs de workflows
│   │   ├── naming.js       # Validateur de conventions de nommage
│   │   ├── errorHandling.js # Validateur de gestion des erreurs
│   │   ├── security.js     # Validateur de sécurité
│   │   ├── performance.js  # Validateur de performance
│   │   └── documentation.js # Validateur de documentation
│   ├── resources/          # Ressources partagées
│   └── server.ts           # Point d'entrée du serveur
├── dist/                   # Code compilé
├── public/                 # Fichiers statiques
├── output/                 # Répertoire pour les sorties des outils
├── .env.example            # Exemple de fichier de configuration
└── README.md               # Documentation

可用工具

1. N8nApi工具

直接与 n8n API 交互。

// Exemple d'utilisation
{
  "method": "GET",
  "endpoint": "/workflows",
  "params": "?active=true"
}

2. 工作流管理器工具

管理 n8n 工作流(列出、检索、创建、更新、删除、导出、导入)。

// Exemple d'utilisation
{
  "action": "list",
  "tags": "production"
}

3. NextJS集成工具

为 n8n 工作流生成 NextJS 集成。

// Exemple d'utilisation
{
  "workflowId": "123",
  "outputDir": "./my-nextjs-app/pages/api",
  "generateTypes": true,
  "generateOpenAPI": true
}

4. 工作流验证工具

根据各种标准验证 n8n 工作流程。

// Exemple d'utilisation
{
  "workflow": "{...}",
  "validators": ["naming", "errorHandling", "security"],
  "strictness": "high"
}

贡献

欢迎投稿!请随时提出问题或请求。

执照

麻省理工学院

-
security - not tested
F
license - not found
-
quality - not tested

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/lowprofix/n8n-mcp-server'

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