RuleGo RuleGo
🏠首页
  • 快速入门
  • 规则链
  • 标准组件
  • 扩展组件
  • 自定义组件
  • 可视化
  • RuleGo-Server
  • RuleGo-MCP-Server
  • AOP
  • 触发器
  • 高级主题
  • 性能
  • 标准组件
  • 扩展组件
  • 自定义组件
  • 组件市场
  • 概述
  • 快速入门
  • 路由
  • DSL
  • API
  • Options
  • 组件
🔥编辑器 (opens new window)
  • 可视化编辑器 (opens new window)
  • RuleGo-Server (opens new window)
  • ❓问答

    • FAQ
💖支持
👥加入社区
  • Github (opens new window)
  • Gitee (opens new window)
  • GitCode (opens new window)
  • 更新日志 (opens new window)
  • English
  • 简体中文
🏠首页
  • 快速入门
  • 规则链
  • 标准组件
  • 扩展组件
  • 自定义组件
  • 可视化
  • RuleGo-Server
  • RuleGo-MCP-Server
  • AOP
  • 触发器
  • 高级主题
  • 性能
  • 标准组件
  • 扩展组件
  • 自定义组件
  • 组件市场
  • 概述
  • 快速入门
  • 路由
  • DSL
  • API
  • Options
  • 组件
🔥编辑器 (opens new window)
  • 可视化编辑器 (opens new window)
  • RuleGo-Server (opens new window)
  • ❓问答

    • FAQ
💖支持
👥加入社区
  • Github (opens new window)
  • Gitee (opens new window)
  • GitCode (opens new window)
  • 更新日志 (opens new window)
  • English
  • 简体中文

广告采用随机轮播方式显示 ❤️成为赞助商
  • 快速入门

  • 规则链

  • 标准组件

  • 扩展组件

  • 自定义组件

  • 组件市场

  • 可视化

  • AOP

  • 触发器

  • 高级主题

  • RuleGo-Server

    • RuleGo-Server
    • RuleGo-MCP-Server
    • MCP-Server-Endpoint
    • 问题

    目录

    MCP-Server-Endpoint

    为了解决因MCP工具众多导致智能体识别不准确以及权限粒度问题,我们提供了MCP-Server输入端。通过规则链配置的方式,用户可以提供一组MCP工具。 一个规则链即代表一个MCP服务器,所有配置和工具的逻辑均在一个规则链中完成,并且能够灵活地实时更新。

    # RuleGo-Editor配置MCP服务器

    1. 下载并运行RuleGo-Server
    2. 打开RuleGo-Editor: http://localhost:9090/editor
    3. 新建【规则链】,把【MCP服务器】拖动画布中 mcp_server.png
    4. 配置服务器端口(可以复用默认的http服务器端口) config.png
    5. 配置路由设置。每个路由代表一个MCP工具。 tool_list.png
    6. 点击【新增】按钮,配置一个MCP工具,包括工具标识、工具描述以及输入JsonSchema。 tool_config.png
    7. JsonSchema示例
    {
       "type": "object",
       "properties": {
          "scaleFactor": {
             "type": "number",
             "title": "换算系数",
             "default": 1.8
          }
       },
       "required": ["scaleFactor"]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    1. 将工具实现的逻辑节点拖入画布中。
    2. 将工具对应的标识与处理节点连接起来。以下示例配置了两个MCP工具: tool_link.png
    3. 在【设置】-【集成】中,复制该规则链的MCP SSE地址,用于在MCP客户端进行测试。 sse_url.png
    4. 使用TraeMCP客户端进行测试。配置成功后,所有工具将显示在客户端左侧列表中。 trae_mcp.png
    5. 配置完成后,您可以在AI助手中调用这些工具。

    # 示例规则链 DSL

    {
       "ruleChain": {
          "id": "TAR_5Z82C07p",
          "name": "MCP服务器",
          "debugMode": true,
          "root": true,
          "disabled": false,
          "additionalInfo": {
             "createTime": "2025/04/28 15:28:06",
             "description": "通过规则链提供MCP工具给AI智能体调用",
             "layoutX": "450",
             "layoutY": "770",
             "updateTime": "2025/04/29 13:47:23",
             "username": "admin"
          }
       },
       "metadata": {
          "endpoints": [
             {
                "id": "node_2",
                "additionalInfo": {
                   "layoutX": 380,
                   "layoutY": 190
                },
                "type": "endpoint/mcpServer",
                "name": "MCP服务器",
                "debugMode": false,
                "configuration": {
                   "allowCors": true,
                   "name": "测试MCP服务器",
                   "server": "ref://:9090",
                   "version": "v1.0.0"
                },
                "processors": null,
                "routers": [
                   {
                      "id": "cm2iZUH32xEt",
                      "params": [
                         "传入转换系数转换温度 ",
                         "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"scaleFactor\": {\n      \"type\": \"number\",\n      \"title\": \"换算系数\",\n      \"default\": 1.8\n    }\n  },\n  \"required\": [\"scaleFactor\"]\n}\n"
                      ],
                      "from": {
                         "path": "transformText",
                         "configuration": null,
                         "processors": []
                      },
                      "to": {
                         "path": "TAR_5Z82C07p:node_4",
                         "configuration": null,
                         "wait": false,
                         "processors": []
                      }
                   },
                   {
                      "id": "_PztDG6f5MO7",
                      "params": [
                         "通过url参数获取",
                         "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"url\": {\n      \"type\": \"string\",\n      \"title\": \"URL\"\n    }\n  },\n  \"required\": [\"url\"]\n}\n"
                      ],
                      "from": {
                         "path": "fetchUrl",
                         "configuration": null,
                         "processors": []
                      },
                      "to": {
                         "path": "TAR_5Z82C07p:node_6",
                         "configuration": null,
                         "wait": false,
                         "processors": []
                      }
                   }
                ]
             }
          ],
          "nodes": [
             {
                "id": "node_6",
                "additionalInfo": {
                   "layoutX": 890,
                   "layoutY": 340
                },
                "type": "restApiCall",
                "name": "获取页面内容",
                "debugMode": false,
                "configuration": {
                   "headers": {
                      "Content-Type": "application/json"
                   },
                   "maxParallelRequestsCount": 200,
                   "proxyPort": 0,
                   "readTimeoutMs": 2000,
                   "requestMethod": "GET",
                   "restEndpointUrlPattern": "${msg.url}"
                }
             },
             {
                "id": "node_4",
                "additionalInfo": {
                   "layoutX": 820,
                   "layoutY": 100
                },
                "type": "jsTransform",
                "name": "转换温度",
                "debugMode": false,
                "configuration": {
                   "jsScript": "var newMsg=msg||{}\nnewMsg.value=msg.from||\"test01\"\nreturn {'msg':newMsg,'metadata':metadata,'msgType':msgType};"
                }
             }
          ],
          "connections": []
       }
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    在 GitHub 上编辑此页 (opens new window)
    上次更新: 2025/04/28, 11:45:54
    RuleGo-MCP-Server
    关于规则引擎执行中断恢复

    ← RuleGo-MCP-Server 关于规则引擎执行中断恢复→

    Theme by Vdoing | Copyright © 2023-2025 RuleGo Team | Apache 2.0 License

    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式