Skip to content

fix(mcp): 修改环境变量配置方式#8567

Open
NayukiChiba wants to merge 1 commit into
AstrBotDevs:masterfrom
NayukiChiba:docs/mcp-deploy
Open

fix(mcp): 修改环境变量配置方式#8567
NayukiChiba wants to merge 1 commit into
AstrBotDevs:masterfrom
NayukiChiba:docs/mcp-deploy

Conversation

@NayukiChiba
Copy link
Copy Markdown
Contributor

@NayukiChiba NayukiChiba commented Jun 3, 2026

Modifications / 改动点

  • 将环境变量配置工具从 env 修改为 uv 字段
  • 更新 JSON 格式以包含 env 字段
  • 确保 MCP 服务器的环境变量配置更加清晰

close #8494

  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果


Checklist / 检查清单

  • 😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
    / 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。

  • 👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
    / 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”

  • 🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in requirements.txt and pyproject.toml.
    / 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到 requirements.txtpyproject.toml 文件相应位置。

  • 😮 My changes do not introduce malicious code.
    / 我的更改没有引入恶意代码。

Summary by Sourcery

Documentation:

  • Revise English and Chinese MCP usage guides to show configuring server environment variables via the env field and uv command instead of the env CLI tool.

- 将环境变量配置工具从 `env` 修改为 `uv` 字段
- 更新 JSON 格式以包含 `env` 字段
- 确保 MCP 服务器的环境变量配置更加清晰
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. area:core The bug / feature is about astrbot's core, backend labels Jun 3, 2026
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="docs/en/use/mcp.md" line_range="75" />
<code_context>
 ```

-If the MCP server you need requires environment variables to configure something (e.g. access token), you could use the command-line tool `env`:
+If the MCP server you need requires environment variables to configure something (e.g. access token), you could use the `env` field:

 ```json
</code_context>
<issue_to_address>
**nitpick (typo):** Consider adding an article before "access token" for grammatical correctness.

Specifically, update "(e.g. access token)" to "(e.g. an access token)" for clarity.

```suggestion
If the MCP server you need requires environment variables to configure something (e.g. an access token), you could use the `env` field:
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread docs/en/use/mcp.md
```

If the MCP server you need requires environment variables to configure something (e.g. access token), you could use the command-line tool `env`:
If the MCP server you need requires environment variables to configure something (e.g. access token), you could use the `env` field:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick (typo): Consider adding an article before "access token" for grammatical correctness.

Specifically, update "(e.g. access token)" to "(e.g. an access token)" for clarity.

Suggested change
If the MCP server you need requires environment variables to configure something (e.g. access token), you could use the `env` field:
If the MCP server you need requires environment variables to configure something (e.g. an access token), you could use the `env` field:

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates both the English and Chinese documentation for MCP server configuration to demonstrate using the env field in the JSON configuration instead of relying on the env command-line tool. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core The bug / feature is about astrbot's core, backend size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

文档中标注的携带 env 配置 MCP 的方式会提示 MCP stdio command env is not allowed.

1 participant