From 66e6cfe75fb686d9fc96dc31dc6eb2239f66aea2 Mon Sep 17 00:00:00 2001 From: LiAlH4 Date: Thu, 19 Feb 2026 14:57:55 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=B8=AD=E6=96=87=E6=96=87=E6=A1=A3?= =?UTF-8?q?=EF=BC=9A=E9=9C=80=E8=A6=81=E9=85=8D=E7=BD=AE=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E7=9A=84mcp=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh/use/mcp.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/zh/use/mcp.md b/zh/use/mcp.md index 7167461..79e3757 100644 --- a/zh/use/mcp.md +++ b/zh/use/mcp.md @@ -71,6 +71,24 @@ npx -v } ``` +如果要使用的 MCP 服务器需要通过环境变量配置 Token 等信息,可以使用 `env` 这个工具: + +```json +{ + "command": "env", + "args": [ + "XXX_RESOURCE_FROM=local", + "XXX_API_URL=https://xxx.com", + "XXX_API_TOKEN=sk-xxxxx", + "uv", + "tool", + "run", + "xxx-mcp-server", + "--storage-path", "data/res" + ] +} +``` + 在 AstrBot WebUI 中设置: ![image](https://files.astrbot.app/docs/zh/use/image-2.png) From 8fafea7477353495ee9513f19d35d8252a2a4900 Mon Sep 17 00:00:00 2001 From: LiAlH4 Date: Thu, 19 Feb 2026 15:04:54 +0800 Subject: [PATCH 2/3] Eng doc: Manual for MCP servers which needs env vars --- en/use/mcp.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/en/use/mcp.md b/en/use/mcp.md index f28bed5..d60be03 100644 --- a/en/use/mcp.md +++ b/en/use/mcp.md @@ -72,6 +72,24 @@ We extract the necessary information: } ``` +If the MCP server you need requires environment variables to configure something (e.g. access token), you could use commandline tool `env`: + +```json +{ + "command": "env", + "args": [ + "XXX_RESOURCE_FROM=local", + "XXX_API_URL=https://xxx.com", + "XXX_API_TOKEN=sk-xxxxx", + "uv", + "tool", + "run", + "xxx-mcp-server", + "--storage-path", "data/res" + ] +} +``` + Configure it in the AstrBot WebUI: ![image](https://files.astrbot.app/docs/en/use/image-2.png) From 3ea12078ffa851fcbe889316bcd59f9b075b3b18 Mon Sep 17 00:00:00 2001 From: LiAlH4 Date: Thu, 19 Feb 2026 15:07:03 +0800 Subject: [PATCH 3/3] Update en/use/mcp.md Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- en/use/mcp.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/use/mcp.md b/en/use/mcp.md index d60be03..1681d31 100644 --- a/en/use/mcp.md +++ b/en/use/mcp.md @@ -72,7 +72,7 @@ We extract the necessary information: } ``` -If the MCP server you need requires environment variables to configure something (e.g. access token), you could use commandline tool `env`: +If the MCP server you need requires environment variables to configure something (e.g. access token), you could use the command-line tool `env`: ```json {