diff --git a/en/use/mcp.md b/en/use/mcp.md index f28bed5..1681d31 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 the command-line 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) 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)