diff --git a/en/use/mcp.md b/en/use/mcp.md index f28bed5..4aec2c4 100644 --- a/en/use/mcp.md +++ b/en/use/mcp.md @@ -78,6 +78,21 @@ Configure it in the AstrBot WebUI: That's it. +## Environment Variables + +AstrBot supports configuring MCP timeout behavior through environment variables: + +| Environment Variable | Description | Default | +| --- | --- | --- | +| `ASTRBOT_MCP_INIT_TIMEOUT` | MCP server initialization timeout (seconds) | `60` | +| `ASTRBOT_MCP_ENABLE_TIMEOUT` | MCP tool dynamic enable timeout (seconds) | `30` | + +If your MCP server starts slowly, you can increase the `ASTRBOT_MCP_INIT_TIMEOUT` value. For example, to set it to 120 seconds: + +```bash +export ASTRBOT_MCP_INIT_TIMEOUT=120 +``` + Reference links: 1. Learn how to use MCP here: [Model Context Protocol](https://modelcontextprotocol.io/introduction) diff --git a/zh/use/mcp.md b/zh/use/mcp.md index 7167461..6927f78 100644 --- a/zh/use/mcp.md +++ b/zh/use/mcp.md @@ -77,6 +77,21 @@ npx -v 即可。 +## 环境变量配置 + +AstrBot 支持通过环境变量配置 MCP 的超时行为: + +| 环境变量 | 说明 | 默认值 | +| --- | --- | --- | +| `ASTRBOT_MCP_INIT_TIMEOUT` | MCP 服务器初始化超时时间(秒) | `60` | +| `ASTRBOT_MCP_ENABLE_TIMEOUT` | MCP 工具动态启用超时时间(秒) | `30` | + +如果您的 MCP 服务器启动较慢,可以适当增加 `ASTRBOT_MCP_INIT_TIMEOUT` 的值。例如,设置为 120 秒: + +```bash +export ASTRBOT_MCP_INIT_TIMEOUT=120 +``` + 参考链接: 1. 在这里了解如何使用 MCP: [Model Context Protocol](https://modelcontextprotocol.io/introduction)