Skip to content

Commit e37ab48

Browse files
wangchamwangchamRockChinQ
authored
Feat/mcp (#66)
* feat: add zh mcp docs * fix: error in docs for mcp * Remove MCP Ecosystem integration link from config Removed the 'Integrating Complete MCP Ecosystem in LangBot' link and commented it out for future reference. * perf: add mcp get method * perf: docs --------- Co-authored-by: wangcham <wangcham@gmail.com> Co-authored-by: Junyan Qin <rockchinq@gmail.com>
1 parent 2406812 commit e37ab48

File tree

11 files changed

+101
-93
lines changed

11 files changed

+101
-93
lines changed

docs/.vitepress/config.mts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ export default defineConfig({
153153
text: "使用知识库",
154154
link: "/zh/deploy/knowledge/readme",
155155
},
156+
{
157+
text: "使用 MCP 服务",
158+
link: "zh/deploy/mcp/readme"
159+
},
156160
{
157161
text: "系统环境设置",
158162
link: "/zh/deploy/settings",
@@ -211,10 +215,6 @@ export default defineConfig({
211215
text: "如何实现一个消息平台适配器?",
212216
link: "/zh/workshop/impl-platform-adapter",
213217
},
214-
{
215-
text: "在 LangBot 接入完整 MCP 生态",
216-
link: "/zh/workshop/mcp-details"
217-
},
218218
{
219219
text: "容器网络配置详解",
220220
link: "/zh/workshop/network-details",
@@ -406,6 +406,10 @@ export default defineConfig({
406406
text: "Using Knowledge Base",
407407
link: "/en/deploy/knowledge/readme",
408408
},
409+
{
410+
text: "Using MCP Services",
411+
link: "/en/deploy/mcp/readme",
412+
},
409413
{
410414
text: "System Settings",
411415
link: "/en/deploy/settings",
@@ -463,13 +467,13 @@ export default defineConfig({
463467
text: "How to Implement a Message Platform Adapter?",
464468
link: "/en/workshop/impl-platform-adapter",
465469
},
470+
// {
471+
// text: "Integrating Complete MCP Ecosystem in LangBot",
472+
// link: "/en/workshop/mcp-details"
473+
// },
466474
{
467-
text: "Integrating Complete MCP Ecosystem in LangBot",
468-
link: "/en/workshop/mcp-details"
469-
},
470-
{
471-
text: "Container Network Configuration Details",
472-
link: "/en/workshop/network-details",
475+
text: "Container Network Configuration Details",
476+
link: "/en/workshop/network-details",
473477
},
474478
{
475479
text: "Using New API to Transmit Models from Multiple Channels",
97.5 KB
Loading
91.1 KB
Loading
62 KB
Loading
136 KB
Loading
33.5 KB
Loading

docs/en/deploy/mcp/readme.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Using MCP Servers
2+
3+
4+
LangBot supports SSE mode MCP servers. You can add MCP servers to leverage the tool calling capabilities in large language models for better handling of LLM requests.
5+
6+
:::info
7+
MCP service only supports SSE mode.
8+
- MCP servers recommended acquisition channel: [Composio MCP](https://mcp.composio.dev/)
9+
:::
10+
11+
## Enable Function Calling for Models
12+
13+
As shown in the image, enable the `Function Calling` feature for the model.
14+
15+
<img width="400px" src="/assets/image/zh/deploy/mcp/mcp_01.png" alt="enable function call" />
16+
17+
## Create MCP Server
18+
19+
Click `Plugin Management`, then `MCP Management`, as shown:
20+
21+
<img width="1000px" src="/assets/image/zh/deploy/mcp/mcp02.png" alt="server page" />
22+
23+
Click `Add` in the top right corner, then `Create MCP Server`,
24+
25+
<img width="400px" src="/assets/image/zh/deploy/mcp/mcp03.png" alt="create new mcp server" />
26+
27+
For example, to use the Fetch HTML server, fill in the corresponding URL, click `Test` to test the MCP server, and click `Submit` to add the server.
28+
29+
After adding, click the switch on the card to connect to the MCP server. Click the card to view the MCP server details:
30+
31+
<img width="400px" src="/assets/image/zh/deploy/mcp/mcp05.png" alt="detailed server" />
32+
33+
## Effect
34+
35+
You need to select `Local Agent` as the runner in the pipeline settings and use a model that supports function calling.
36+
37+
<img width="1000px" src="/assets/image/zh/deploy/mcp/mcp04.png" alt="dialog with mcp" />

docs/en/deploy/settings.md

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -34,47 +34,6 @@ concurrency:
3434
# Single session concurrency
3535
session: 1
3636

37-
# MCP configuration
38-
# Should be configurable in WebUI in the future
39-
mcp:
40-
# MCP server list
41-
# Currently supports two protocol MCP servers:
42-
# - SSE
43-
# - Stdio (Python)
44-
#
45-
# Format:
46-
# SSE mode:
47-
# name Server name, self-defined
48-
# enable Whether to enable this Server
49-
# mode Fixed as sse
50-
# url MCP SSE Server access URL
51-
# headers Connection headers, optional
52-
# timeout Connection timeout
53-
#
54-
# stdio mode:
55-
# name Server name, self-defined
56-
# enable Whether to enable this Server
57-
# mode Fixed as stdio
58-
# command Execution command
59-
# args Command parameters
60-
# env Command environment variables, optional
61-
#
62-
# For example:
63-
# servers:
64-
# - name: 'SSE Server'
65-
# enable: true
66-
# mode: sse
67-
# url: 'http://127.0.0.1:8000/sse'
68-
# headers: {}
69-
# timeout: 10
70-
# - name: 'stdio Server'
71-
# enable: true
72-
# mode: stdio
73-
# command: 'python'
74-
# args: ['-m', 'weather']
75-
# env: {}
76-
servers: []
77-
7837
# Proxy configuration
7938
proxy:
8039
# HTTP proxy address

docs/en/workshop/mcp-details.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ There are two types of MCP Servers in the market:
2020

2121
## Configuring MCP Server
2222

23-
Please refer to the [System Settings Documentation](/zh/deploy/settings.html)
23+
Please refer to the [System Settings Documentation](/en/deploy/settings.html)
2424

2525
After configuration, you can use the `!func` command in chat to view registered MCP tools. When chatting with models that support Function Calling, LangBot will automatically call MCP tools.

docs/zh/deploy/mcp/readme.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# 使用MCP服务器
2+
3+
4+
LangBot 支持 SSE 模式 MCP 服务器,您可以添加 MCP 服务器,使用大语言模型中的工具调用特性,更好的处理 LLM 请求。
5+
6+
:::info
7+
- MCP 服务仅支持 SSE 模式。
8+
- MCP 服务器推荐获取渠道:[ModelScope](https://modelscope.cn/mcp)
9+
:::
10+
11+
## 打开模型的函数调用功能
12+
13+
如图,将模型的`函数调用`功能打开。
14+
15+
<img width="400px" src="/assets/image/zh/deploy/mcp/mcp_01.png" alt="enable function call" />
16+
17+
## 创建MCP服务器
18+
19+
点击`插件管理` -> `MCP管理`,如图所示:
20+
21+
<img width="1000px" src="/assets/image/zh/deploy/mcp/mcp02.png" alt="server page" />
22+
23+
点击右上角的`添加`,选择`添加 MCP 服务器`
24+
25+
<img width="400px" src="/assets/image/zh/deploy/mcp/mcp03.png" alt="create new mcp server" />
26+
27+
比如使用 Fetch HTML 服务器,填写对应的 URL,点击`测试`用来测试 MCP 服务器,点`提交`添加此服务器。
28+
29+
添加完成之后,点击卡片上的开关以连接 MCP 服务器,点击卡片可以看到 MCP 服务器的详情:
30+
31+
<img width="400px" src="/assets/image/zh/deploy/mcp/mcp05.png" alt="detailed server" />
32+
33+
## 效果
34+
35+
需要在流水线设置中选用 `内置 Agent` 作为运行器,并使用支持函数调用的模型。
36+
37+
<img width="1000px" src="/assets/image/zh/deploy/mcp/mcp04.png" alt="dialog with mcp" />
38+
39+
40+
41+
42+
43+
44+
45+
46+
47+
48+
49+

0 commit comments

Comments
 (0)