MCP-Server-Endpoint
为了解决因MCP工具众多导致智能体识别不准确以及权限粒度问题,我们提供了MCP-Server输入端。通过规则链配置的方式,用户可以提供一组MCP工具。 一个规则链即代表一个MCP服务器,所有配置和工具的逻辑均在一个规则链中完成,并且能够灵活地实时更新。
# RuleGo-Editor配置MCP服务器
- 下载并运行RuleGo-Server
- 打开RuleGo-Editor: http://localhost:9090/editor
- 新建【规则链】,把【MCP服务器】拖动画布中
- 配置服务器端口(可以复用默认的http服务器端口)
- 配置路由设置。每个路由代表一个MCP工具。
- 点击【新增】按钮,配置一个MCP工具,包括工具标识、工具描述以及输入JsonSchema。
- JsonSchema示例
{
"type": "object",
"properties": {
"scaleFactor": {
"type": "number",
"title": "换算系数",
"default": 1.8
}
},
"required": ["scaleFactor"]
}
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
- 将工具实现的逻辑节点拖入画布中。
- 将工具对应的标识与处理节点连接起来。以下示例配置了两个MCP工具:
- 在【设置】-【集成】中,复制该规则链的MCP SSE地址,用于在MCP客户端进行测试。
- 使用TraeMCP客户端进行测试。配置成功后,所有工具将显示在客户端左侧列表中。
- 配置完成后,您可以在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
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