mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-30 04:15:45 +08:00
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 <[email protected]> Co-authored-by: Junyan Qin <[email protected]>
This commit is contained in:
co-authored by
wangcham
Junyan Qin
parent
2406812b9c
commit
e37ab48921
+14
-10
@@ -153,6 +153,10 @@ export default defineConfig({
|
||||
text: "使用知识库",
|
||||
link: "/zh/deploy/knowledge/readme",
|
||||
},
|
||||
{
|
||||
text: "使用 MCP 服务",
|
||||
link: "zh/deploy/mcp/readme"
|
||||
},
|
||||
{
|
||||
text: "系统环境设置",
|
||||
link: "/zh/deploy/settings",
|
||||
@@ -211,10 +215,6 @@ export default defineConfig({
|
||||
text: "如何实现一个消息平台适配器?",
|
||||
link: "/zh/workshop/impl-platform-adapter",
|
||||
},
|
||||
{
|
||||
text: "在 LangBot 接入完整 MCP 生态",
|
||||
link: "/zh/workshop/mcp-details"
|
||||
},
|
||||
{
|
||||
text: "容器网络配置详解",
|
||||
link: "/zh/workshop/network-details",
|
||||
@@ -406,6 +406,10 @@ export default defineConfig({
|
||||
text: "Using Knowledge Base",
|
||||
link: "/en/deploy/knowledge/readme",
|
||||
},
|
||||
{
|
||||
text: "Using MCP Services",
|
||||
link: "/en/deploy/mcp/readme",
|
||||
},
|
||||
{
|
||||
text: "System Settings",
|
||||
link: "/en/deploy/settings",
|
||||
@@ -463,13 +467,13 @@ export default defineConfig({
|
||||
text: "How to Implement a Message Platform Adapter?",
|
||||
link: "/en/workshop/impl-platform-adapter",
|
||||
},
|
||||
// {
|
||||
// text: "Integrating Complete MCP Ecosystem in LangBot",
|
||||
// link: "/en/workshop/mcp-details"
|
||||
// },
|
||||
{
|
||||
text: "Integrating Complete MCP Ecosystem in LangBot",
|
||||
link: "/en/workshop/mcp-details"
|
||||
},
|
||||
{
|
||||
text: "Container Network Configuration Details",
|
||||
link: "/en/workshop/network-details",
|
||||
text: "Container Network Configuration Details",
|
||||
link: "/en/workshop/network-details",
|
||||
},
|
||||
{
|
||||
text: "Using New API to Transmit Models from Multiple Channels",
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 98 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 91 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 62 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 136 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
@@ -0,0 +1,37 @@
|
||||
# Using MCP Servers
|
||||
|
||||
|
||||
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.
|
||||
|
||||
:::info
|
||||
MCP service only supports SSE mode.
|
||||
- MCP servers recommended acquisition channel: [Composio MCP](https://mcp.composio.dev/)
|
||||
:::
|
||||
|
||||
## Enable Function Calling for Models
|
||||
|
||||
As shown in the image, enable the `Function Calling` feature for the model.
|
||||
|
||||
<img width="400px" src="/assets/image/zh/deploy/mcp/mcp_01.png" alt="enable function call" />
|
||||
|
||||
## Create MCP Server
|
||||
|
||||
Click `Plugin Management`, then `MCP Management`, as shown:
|
||||
|
||||
<img width="1000px" src="/assets/image/zh/deploy/mcp/mcp02.png" alt="server page" />
|
||||
|
||||
Click `Add` in the top right corner, then `Create MCP Server`,
|
||||
|
||||
<img width="400px" src="/assets/image/zh/deploy/mcp/mcp03.png" alt="create new mcp server" />
|
||||
|
||||
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.
|
||||
|
||||
After adding, click the switch on the card to connect to the MCP server. Click the card to view the MCP server details:
|
||||
|
||||
<img width="400px" src="/assets/image/zh/deploy/mcp/mcp05.png" alt="detailed server" />
|
||||
|
||||
## Effect
|
||||
|
||||
You need to select `Local Agent` as the runner in the pipeline settings and use a model that supports function calling.
|
||||
|
||||
<img width="1000px" src="/assets/image/zh/deploy/mcp/mcp04.png" alt="dialog with mcp" />
|
||||
@@ -34,47 +34,6 @@ concurrency:
|
||||
# Single session concurrency
|
||||
session: 1
|
||||
|
||||
# MCP configuration
|
||||
# Should be configurable in WebUI in the future
|
||||
mcp:
|
||||
# MCP server list
|
||||
# Currently supports two protocol MCP servers:
|
||||
# - SSE
|
||||
# - Stdio (Python)
|
||||
#
|
||||
# Format:
|
||||
# SSE mode:
|
||||
# name Server name, self-defined
|
||||
# enable Whether to enable this Server
|
||||
# mode Fixed as sse
|
||||
# url MCP SSE Server access URL
|
||||
# headers Connection headers, optional
|
||||
# timeout Connection timeout
|
||||
#
|
||||
# stdio mode:
|
||||
# name Server name, self-defined
|
||||
# enable Whether to enable this Server
|
||||
# mode Fixed as stdio
|
||||
# command Execution command
|
||||
# args Command parameters
|
||||
# env Command environment variables, optional
|
||||
#
|
||||
# For example:
|
||||
# servers:
|
||||
# - name: 'SSE Server'
|
||||
# enable: true
|
||||
# mode: sse
|
||||
# url: 'http://127.0.0.1:8000/sse'
|
||||
# headers: {}
|
||||
# timeout: 10
|
||||
# - name: 'stdio Server'
|
||||
# enable: true
|
||||
# mode: stdio
|
||||
# command: 'python'
|
||||
# args: ['-m', 'weather']
|
||||
# env: {}
|
||||
servers: []
|
||||
|
||||
# Proxy configuration
|
||||
proxy:
|
||||
# HTTP proxy address
|
||||
|
||||
@@ -20,6 +20,6 @@ There are two types of MCP Servers in the market:
|
||||
|
||||
## Configuring MCP Server
|
||||
|
||||
Please refer to the [System Settings Documentation](/zh/deploy/settings.html)
|
||||
Please refer to the [System Settings Documentation](/en/deploy/settings.html)
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,49 @@
|
||||
# 使用MCP服务器
|
||||
|
||||
|
||||
LangBot 支持 SSE 模式 MCP 服务器,您可以添加 MCP 服务器,使用大语言模型中的工具调用特性,更好的处理 LLM 请求。
|
||||
|
||||
:::info
|
||||
- MCP 服务仅支持 SSE 模式。
|
||||
- MCP 服务器推荐获取渠道:[ModelScope](https://modelscope.cn/mcp)
|
||||
:::
|
||||
|
||||
## 打开模型的函数调用功能
|
||||
|
||||
如图,将模型的`函数调用`功能打开。
|
||||
|
||||
<img width="400px" src="/assets/image/zh/deploy/mcp/mcp_01.png" alt="enable function call" />
|
||||
|
||||
## 创建MCP服务器
|
||||
|
||||
点击`插件管理` -> `MCP管理`,如图所示:
|
||||
|
||||
<img width="1000px" src="/assets/image/zh/deploy/mcp/mcp02.png" alt="server page" />
|
||||
|
||||
点击右上角的`添加`,选择`添加 MCP 服务器`,
|
||||
|
||||
<img width="400px" src="/assets/image/zh/deploy/mcp/mcp03.png" alt="create new mcp server" />
|
||||
|
||||
比如使用 Fetch HTML 服务器,填写对应的 URL,点击`测试`用来测试 MCP 服务器,点`提交`添加此服务器。
|
||||
|
||||
添加完成之后,点击卡片上的开关以连接 MCP 服务器,点击卡片可以看到 MCP 服务器的详情:
|
||||
|
||||
<img width="400px" src="/assets/image/zh/deploy/mcp/mcp05.png" alt="detailed server" />
|
||||
|
||||
## 效果
|
||||
|
||||
需要在流水线设置中选用 `内置 Agent` 作为运行器,并使用支持函数调用的模型。
|
||||
|
||||
<img width="1000px" src="/assets/image/zh/deploy/mcp/mcp04.png" alt="dialog with mcp" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -34,47 +34,6 @@ concurrency:
|
||||
# 单会话并发数
|
||||
session: 1
|
||||
|
||||
# MCP 配置
|
||||
# 后续应该会改为在 WebUI 上可以配置
|
||||
mcp:
|
||||
# MCP 服务器列表
|
||||
# 目前支持两种协议的 MCP 服务器:
|
||||
# - SSE
|
||||
# - Stdio(Python)
|
||||
#
|
||||
# 格式:
|
||||
# SSE 模式:
|
||||
# name 服务器名称,自行定义
|
||||
# enable 是否启用本 Server
|
||||
# mode 固定填写 sse
|
||||
# url MCP SSE Server 的访问 URL
|
||||
# headers 连接时的 headers,可选
|
||||
# timeout 连接超时时间
|
||||
#
|
||||
# stdio 模式:
|
||||
# name 服务器名称,自行定义
|
||||
# enable 是否启用本 Server
|
||||
# mode 固定填写 stdio
|
||||
# command 执行命令
|
||||
# args 执行命令的参数
|
||||
# env 执行命令的环境变量,可选
|
||||
#
|
||||
# 例如:
|
||||
# servers:
|
||||
# - name: 'SSE Server'
|
||||
# enable: true
|
||||
# mode: sse
|
||||
# url: 'http://127.0.0.1:8000/sse'
|
||||
# headers: {}
|
||||
# timeout: 10
|
||||
# - name: 'stdio Server'
|
||||
# enable: true
|
||||
# mode: stdio
|
||||
# command: 'python'
|
||||
# args: ['-m', 'weather']
|
||||
# env: {}
|
||||
servers: []
|
||||
|
||||
# 代理配置
|
||||
proxy:
|
||||
# HTTP 代理地址
|
||||
|
||||
Reference in New Issue
Block a user