@tencent-ai/agent-sdk 0.3.98 → 0.3.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/CHANGELOG.md +50 -0
- package/cli/dist/codebuddy-headless.js +137 -108
- package/cli/dist/web-ui/assets/index-BoMlEqUE.js +439 -0
- package/cli/dist/web-ui/assets/index-Dt1puyHn.css +32 -0
- package/cli/dist/web-ui/docs/cn/cli/acp.md +152 -0
- package/cli/dist/web-ui/docs/cn/cli/agent-teams.md +327 -0
- package/cli/dist/web-ui/docs/cn/cli/bash-sandboxing.md +290 -0
- package/cli/dist/web-ui/docs/cn/cli/best-practices.md +554 -0
- package/cli/dist/web-ui/docs/cn/cli/channels-reference.md +293 -0
- package/cli/dist/web-ui/docs/cn/cli/channels.md +215 -0
- package/cli/dist/web-ui/docs/cn/cli/checkpointing.md +51 -0
- package/cli/dist/web-ui/docs/cn/cli/cli-reference.md +187 -0
- package/cli/dist/web-ui/docs/cn/cli/common-workflows.md +1013 -0
- package/cli/dist/web-ui/docs/cn/cli/costs.md +174 -0
- package/cli/dist/web-ui/docs/cn/cli/devcontainer.md +553 -0
- package/cli/dist/web-ui/docs/cn/cli/env-vars.md +326 -0
- package/cli/dist/web-ui/docs/cn/cli/gitlab-ci-cd.md +357 -0
- package/cli/dist/web-ui/docs/cn/cli/headless.md +258 -0
- package/cli/dist/web-ui/docs/cn/cli/hooks-guide.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/hooks.md +805 -0
- package/cli/dist/web-ui/docs/cn/cli/iam.md +530 -0
- package/cli/dist/web-ui/docs/cn/cli/ide-integrations.md +92 -0
- package/cli/dist/web-ui/docs/cn/cli/installation.md +291 -0
- package/cli/dist/web-ui/docs/cn/cli/interactive-mode.md +233 -0
- package/cli/dist/web-ui/docs/cn/cli/mcp.md +739 -0
- package/cli/dist/web-ui/docs/cn/cli/memory.md +436 -0
- package/cli/dist/web-ui/docs/cn/cli/models.md +356 -0
- package/cli/dist/web-ui/docs/cn/cli/overview.md +100 -0
- package/cli/dist/web-ui/docs/cn/cli/plugin-marketplaces.md +533 -0
- package/cli/dist/web-ui/docs/cn/cli/plugins-reference.md +774 -0
- package/cli/dist/web-ui/docs/cn/cli/plugins.md +689 -0
- package/cli/dist/web-ui/docs/cn/cli/quickstart.md +249 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/README.md +199 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.10.0.md +23 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.10.1.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.11.0.md +24 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.12.0.md +21 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.13.0.md +20 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.14.0.md +22 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.14.1.md +8 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.15.0.md +18 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.15.1.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.16.0.md +20 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.17.0.md +29 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.18.0.md +17 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.19.0.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.19.1.md +14 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.19.2.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.20.0.md +23 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.20.1.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.21.0.md +13 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.22.0.md +16 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.23.0.md +20 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.23.2.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.23.3.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.23.4.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.23.5.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.24.0.md +17 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.25.0.md +18 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.25.1.md +21 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.26.0.md +18 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.27.0.md +16 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.27.1.md +16 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.27.2.md +7 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.27.3.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.28.0.md +26 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.28.1.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.29.0.md +35 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.3.1.md +16 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.30.0.md +19 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.30.1.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.31.0.md +51 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.31.1.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.31.2.md +16 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.32.0.md +19 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.33.0.md +28 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.33.1.md +7 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.36.3.md +17 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.0.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.1.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.10.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.11.md +8 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.12.md +14 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.13.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.14.md +24 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.15.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.16.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.17.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.18.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.19.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.2.md +28 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.20.md +8 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.3.md +22 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.4.md +19 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.5.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.6.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.7.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.8.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.9.md +8 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.38.0.md +22 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.38.1.md +6 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.38.2.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.39.0.md +18 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.4.0.md +19 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.40.0.md +20 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.40.1.md +6 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.0.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.1.md +6 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.2.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.3.md +8 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.4.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.5.md +10 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.6.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.7.md +14 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.8.md +18 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.42.0.md +39 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.42.1.md +8 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.42.3.md +18 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.43.0.md +27 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.43.1.md +27 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.44.0.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.44.1.md +22 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.45.0.md +34 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.45.1.md +7 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.46.0.md +12 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.47.0.md +20 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.48.0.md +32 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.48.1.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.0.md +26 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.1.md +14 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.2.md +39 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.3.md +7 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.5.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.6.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.7.md +7 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.5.0.md +24 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.0.md +25 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.1.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.2.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.3.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.4.md +17 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.5.md +16 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.6.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.7.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.51.0.md +24 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.51.1.md +17 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.51.2.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.0.md +30 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.1.md +28 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.2.md +12 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.3.md +13 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.4.md +27 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.5.md +21 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.6.md +7 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.53.0.md +29 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.54.0.md +26 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.55.0.md +21 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.55.1.md +13 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.56.0.md +20 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.56.1.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.57.0.md +32 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.57.1.md +10 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.58.0.md +34 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.59.0.md +28 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.6.0.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.6.1.md +10 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.60.0.md +20 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.61.0.md +29 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.61.1.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.61.2.md +6 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.61.3.md +13 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.62.0.md +21 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.62.1.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.0.md +19 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.1.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.2.md +7 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.3.md +6 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.4.md +8 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.5.md +6 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.64.0.md +37 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.64.1.md +6 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.64.2.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.65.0.md +19 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.65.1.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.66.0.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.66.1.md +14 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.66.2.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.67.0.md +33 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.7.0.md +16 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.0.md +18 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.1.md +17 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.2.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.3.md +14 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.4.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.5.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.6.md +14 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.9.0.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/remote-control.md +247 -0
- package/cli/dist/web-ui/docs/cn/cli/sandboxing.md +316 -0
- package/cli/dist/web-ui/docs/cn/cli/scheduled-tasks.md +161 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-custom-tools.md +1195 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-demos.md +347 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-hooks.md +803 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-mcp.md +643 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-permissions.md +501 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-python.md +783 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-sessions.md +332 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-typescript.md +759 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk.md +1105 -0
- package/cli/dist/web-ui/docs/cn/cli/security.md +387 -0
- package/cli/dist/web-ui/docs/cn/cli/settings.md +602 -0
- package/cli/dist/web-ui/docs/cn/cli/skills.md +448 -0
- package/cli/dist/web-ui/docs/cn/cli/slash-commands.md +397 -0
- package/cli/dist/web-ui/docs/cn/cli/statusline.md +525 -0
- package/cli/dist/web-ui/docs/cn/cli/sub-agents.md +634 -0
- package/cli/dist/web-ui/docs/cn/cli/terminal-config.md +77 -0
- package/cli/dist/web-ui/docs/cn/cli/tools-reference.md +99 -0
- package/cli/dist/web-ui/docs/cn/cli/troubleshooting.md +190 -0
- package/cli/dist/web-ui/docs/cn/cli/web-ui.md +164 -0
- package/cli/dist/web-ui/docs/cn/cli/wecom-bot-setup.md +274 -0
- package/cli/dist/web-ui/docs/cn/cli/worktree.md +660 -0
- package/cli/dist/web-ui/docs/en/cli/acp.md +126 -0
- package/cli/dist/web-ui/docs/en/cli/agent-teams.md +327 -0
- package/cli/dist/web-ui/docs/en/cli/bash-sandboxing.md +357 -0
- package/cli/dist/web-ui/docs/en/cli/best-practices.md +554 -0
- package/cli/dist/web-ui/docs/en/cli/channels-reference.md +293 -0
- package/cli/dist/web-ui/docs/en/cli/channels.md +215 -0
- package/cli/dist/web-ui/docs/en/cli/checkpointing.md +53 -0
- package/cli/dist/web-ui/docs/en/cli/cli-reference.md +187 -0
- package/cli/dist/web-ui/docs/en/cli/common-workflows.md +1011 -0
- package/cli/dist/web-ui/docs/en/cli/costs.md +174 -0
- package/cli/dist/web-ui/docs/en/cli/devcontainer.md +553 -0
- package/cli/dist/web-ui/docs/en/cli/env-vars.md +326 -0
- package/cli/dist/web-ui/docs/en/cli/gitlab-ci-cd.md +357 -0
- package/cli/dist/web-ui/docs/en/cli/headless.md +258 -0
- package/cli/dist/web-ui/docs/en/cli/hooks-guide.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/hooks.md +801 -0
- package/cli/dist/web-ui/docs/en/cli/iam.md +526 -0
- package/cli/dist/web-ui/docs/en/cli/ide-integrations.md +92 -0
- package/cli/dist/web-ui/docs/en/cli/installation.md +266 -0
- package/cli/dist/web-ui/docs/en/cli/interactive-mode.md +233 -0
- package/cli/dist/web-ui/docs/en/cli/mcp.md +739 -0
- package/cli/dist/web-ui/docs/en/cli/memory.md +436 -0
- package/cli/dist/web-ui/docs/en/cli/models.md +355 -0
- package/cli/dist/web-ui/docs/en/cli/overview.md +100 -0
- package/cli/dist/web-ui/docs/en/cli/plugin-marketplaces.md +534 -0
- package/cli/dist/web-ui/docs/en/cli/plugins-reference.md +774 -0
- package/cli/dist/web-ui/docs/en/cli/plugins.md +688 -0
- package/cli/dist/web-ui/docs/en/cli/quickstart.md +249 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/README.md +193 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.10.0.md +23 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.10.1.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.11.0.md +24 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.12.0.md +21 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.13.0.md +20 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.14.0.md +22 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.14.1.md +8 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.15.0.md +18 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.15.1.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.16.0.md +20 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.17.0.md +29 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.18.0.md +17 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.19.0.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.19.1.md +14 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.19.2.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.20.0.md +23 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.20.1.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.21.0.md +13 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.22.0.md +16 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.23.0.md +41 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.23.2.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.23.3.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.23.4.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.23.5.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.24.0.md +17 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.25.0.md +18 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.25.1.md +21 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.26.0.md +18 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.27.0.md +16 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.27.1.md +16 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.27.2.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.27.3.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.28.0.md +26 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.28.1.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.29.0.md +35 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.3.1.md +16 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.30.0.md +19 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.30.1.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.31.0.md +51 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.31.1.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.31.2.md +16 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.32.0.md +19 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.33.0.md +28 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.33.1.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.34.0.md +27 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.34.1.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.35.0.md +22 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.36.0.md +23 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.36.1.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.36.2.md +22 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.36.3.md +17 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.0.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.1.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.10.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.11.md +8 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.12.md +14 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.13.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.14.md +24 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.15.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.16.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.17.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.18.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.19.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.2.md +28 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.20.md +8 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.3.md +22 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.4.md +19 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.5.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.6.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.7.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.8.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.9.md +8 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.38.0.md +22 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.38.1.md +6 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.38.2.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.39.0.md +18 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.4.0.md +19 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.40.0.md +20 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.40.1.md +6 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.0.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.1.md +6 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.2.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.3.md +8 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.4.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.5.md +10 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.6.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.7.md +14 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.8.md +18 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.42.0.md +39 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.42.1.md +8 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.42.3.md +18 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.43.0.md +27 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.43.1.md +27 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.44.0.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.44.1.md +22 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.45.0.md +34 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.45.1.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.46.0.md +12 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.47.0.md +20 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.48.0.md +32 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.48.1.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.0.md +26 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.1.md +14 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.2.md +39 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.3.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.5.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.6.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.7.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.5.0.md +24 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.0.md +25 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.1.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.2.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.3.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.4.md +17 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.5.md +16 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.6.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.7.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.51.0.md +24 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.51.1.md +17 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.51.2.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.0.md +30 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.1.md +28 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.2.md +12 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.3.md +13 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.4.md +27 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.5.md +21 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.6.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.53.0.md +29 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.54.0.md +26 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.55.0.md +21 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.55.1.md +13 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.56.0.md +20 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.56.1.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.57.0.md +32 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.57.1.md +10 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.58.0.md +34 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.59.0.md +28 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.6.0.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.6.1.md +10 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.60.0.md +20 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.61.0.md +29 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.61.1.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.61.2.md +6 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.61.3.md +13 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.62.0.md +21 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.62.1.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.0.md +19 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.1.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.2.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.3.md +6 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.4.md +8 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.5.md +6 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.64.0.md +37 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.64.1.md +6 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.64.2.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.65.0.md +19 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.65.1.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.66.0.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.66.1.md +14 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.66.2.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.67.0.md +33 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.7.0.md +16 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.0.md +18 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.1.md +17 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.2.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.3.md +14 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.4.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.5.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.6.md +14 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.9.0.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/remote-control.md +247 -0
- package/cli/dist/web-ui/docs/en/cli/sandboxing.md +316 -0
- package/cli/dist/web-ui/docs/en/cli/scheduled-tasks.md +160 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-custom-tools.md +1131 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-demos.md +347 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-hooks.md +813 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-mcp.md +645 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-permissions.md +461 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-python.md +797 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-sessions.md +340 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-typescript.md +770 -0
- package/cli/dist/web-ui/docs/en/cli/sdk.md +1103 -0
- package/cli/dist/web-ui/docs/en/cli/security.md +388 -0
- package/cli/dist/web-ui/docs/en/cli/settings.md +602 -0
- package/cli/dist/web-ui/docs/en/cli/skills.md +448 -0
- package/cli/dist/web-ui/docs/en/cli/slash-commands.md +397 -0
- package/cli/dist/web-ui/docs/en/cli/statusline.md +525 -0
- package/cli/dist/web-ui/docs/en/cli/sub-agents.md +621 -0
- package/cli/dist/web-ui/docs/en/cli/terminal-config.md +77 -0
- package/cli/dist/web-ui/docs/en/cli/tools-reference.md +99 -0
- package/cli/dist/web-ui/docs/en/cli/troubleshooting.md +190 -0
- package/cli/dist/web-ui/docs/en/cli/web-ui.md +164 -0
- package/cli/dist/web-ui/docs/en/cli/wecom-bot-setup.md +274 -0
- package/cli/dist/web-ui/docs/en/cli/worktree.md +660 -0
- package/cli/dist/web-ui/docs/search-index-en.json +1 -0
- package/cli/dist/web-ui/docs/search-index-zh.json +1 -0
- package/cli/dist/web-ui/docs/sidebar-en.json +1 -0
- package/cli/dist/web-ui/docs/sidebar-zh.json +1 -0
- package/cli/dist/web-ui/index.html +2 -2
- package/cli/package.json +1 -1
- package/cli/product.cloudhosted.json +4 -3
- package/cli/product.internal.json +4 -3
- package/cli/product.ioa.json +4 -3
- package/cli/product.json +13 -6
- package/cli/product.selfhosted.json +4 -3
- package/package.json +1 -1
- package/cli/dist/web-ui/assets/index-4SCgPWnj.css +0 -32
- package/cli/dist/web-ui/assets/index-BijmmKDe.js +0 -391
|
@@ -0,0 +1,739 @@
|
|
|
1
|
+
# MCP (Model Context Protocol) 使用文档
|
|
2
|
+
|
|
3
|
+
## 概述
|
|
4
|
+
|
|
5
|
+
MCP (Model Context Protocol) 是一个开放标准,允许 CodeBuddy 与外部工具和数据源进行集成。通过 MCP,您可以扩展 CodeBuddy 的功能,连接到各种外部服务、数据库、API 等。
|
|
6
|
+
|
|
7
|
+
## 核心概念
|
|
8
|
+
|
|
9
|
+
### MCP 服务器
|
|
10
|
+
|
|
11
|
+
MCP 服务器是提供工具、资源和提示的独立进程,CodeBuddy 通过不同的传输协议与这些服务器通信。
|
|
12
|
+
|
|
13
|
+
### MCP Prompts 集成
|
|
14
|
+
|
|
15
|
+
MCP 服务器可以提供 Prompts(提示模板),这些 Prompts 会自动转换为 CodeBuddy 的斜杠命令。当 MCP 服务器连接后:
|
|
16
|
+
|
|
17
|
+
- 服务器提供的 Prompts 会自动注册为斜杠命令
|
|
18
|
+
- 命令名称格式为: `/服务器名:prompt名称`
|
|
19
|
+
- 支持动态参数,通过交互式界面收集用户输入
|
|
20
|
+
- 命令执行时会调用 MCP 服务器的 `prompts/get` 接口获取完整内容
|
|
21
|
+
- 支持实时监听配置变更,自动更新可用命令列表
|
|
22
|
+
|
|
23
|
+
### 传输类型
|
|
24
|
+
|
|
25
|
+
- **STDIO**:通过标准输入输出与本地进程通信
|
|
26
|
+
- **SSE**:通过 Server-Sent Events 与远程服务通信
|
|
27
|
+
- **HTTP**:通过 HTTP 流式传输与远程服务通信
|
|
28
|
+
|
|
29
|
+
### 配置作用域
|
|
30
|
+
|
|
31
|
+
- **user**:全局用户配置,应用于所有项目
|
|
32
|
+
- **project**:项目级配置,应用于特定项目
|
|
33
|
+
- **local**:本地配置,仅应用于当前会话或工作区
|
|
34
|
+
|
|
35
|
+
对于同名服务(即在多个作用域有同名配置),生效的优先级为:`local > project > user`
|
|
36
|
+
|
|
37
|
+
### 安全审批机制
|
|
38
|
+
|
|
39
|
+
项目作用域的 MCP 服务器在首次连接时需要用户审批,以确保安全性。系统会显示服务器详细信息,用户可以选择批准或拒绝连接。
|
|
40
|
+
|
|
41
|
+
#### 非交互模式(-p/--print)下的审批
|
|
42
|
+
|
|
43
|
+
在非交互模式(如使用 `-p/--print` 参数)下,由于无法通过 UI 进行审批,需要通过 `--settings` 参数预先配置允许的 MCP 服务器:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# 方式 1:允许所有项目 MCP 服务器
|
|
47
|
+
codebuddy --settings '{"enableAllProjectMcpServers": true}' -p "your prompt"
|
|
48
|
+
|
|
49
|
+
# 方式 2:允许特定的 MCP 服务器
|
|
50
|
+
codebuddy --settings '{"enabledMcpjsonServers": ["server-name-1", "server-name-2"]}' -p "your prompt"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 工具权限管理
|
|
54
|
+
|
|
55
|
+
MCP 工具支持完整的权限管理系统,可以精确控制哪些工具可以被使用:
|
|
56
|
+
|
|
57
|
+
#### 权限规则类型
|
|
58
|
+
|
|
59
|
+
权限系统支持三种规则类型(按优先级排序):
|
|
60
|
+
|
|
61
|
+
1. **拒绝规则 (deny)** - 阻止使用指定工具(最高优先级)
|
|
62
|
+
2. **询问规则 (ask)** - 使用工具前需要用户确认(覆盖允许规则)
|
|
63
|
+
3. **允许规则 (allow)** - 允许工具使用而无需手动批准
|
|
64
|
+
|
|
65
|
+
#### MCP 权限规则格式
|
|
66
|
+
|
|
67
|
+
**重要**:MCP 权限不支持通配符 (*)
|
|
68
|
+
|
|
69
|
+
##### 服务器级权限
|
|
70
|
+
```
|
|
71
|
+
mcp__服务器名
|
|
72
|
+
```
|
|
73
|
+
- 匹配指定服务器提供的任何工具
|
|
74
|
+
- 服务器名是在 CodeBuddy 中配置的名称
|
|
75
|
+
|
|
76
|
+
##### 工具级权限
|
|
77
|
+
```
|
|
78
|
+
mcp__服务器名__工具名
|
|
79
|
+
```
|
|
80
|
+
- 匹配指定服务器的特定工具
|
|
81
|
+
|
|
82
|
+
#### 配置示例
|
|
83
|
+
|
|
84
|
+
##### 批准服务器的所有工具
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"permissions": {
|
|
88
|
+
"allow": [
|
|
89
|
+
"mcp__github"
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
##### 仅批准特定工具
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"permissions": {
|
|
99
|
+
"allow": [
|
|
100
|
+
"mcp__github__get_issue",
|
|
101
|
+
"mcp__github__list_issues"
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
##### 拒绝特定工具
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"permissions": {
|
|
111
|
+
"deny": [
|
|
112
|
+
"mcp__dangerous_server__delete_file"
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## 配置文件
|
|
119
|
+
|
|
120
|
+
### 配置文件位置
|
|
121
|
+
|
|
122
|
+
配置文件使用优先级机制,系统会按优先级顺序查找第一个存在的文件进行读取。写入时,如果文件已存在,会写入第一个存在的文件;如果都不存在,会创建最高优先级的文件。
|
|
123
|
+
|
|
124
|
+
#### USER 作用域
|
|
125
|
+
|
|
126
|
+
优先级顺序(从高到低):
|
|
127
|
+
1. `~/.codebuddy/.mcp.json`(推荐)
|
|
128
|
+
2. `~/.codebuddy/mcp.json`(已废弃)
|
|
129
|
+
3. `~/.codebuddy.json`(旧版配置文件)
|
|
130
|
+
|
|
131
|
+
**读取规则**:系统会按上述顺序查找第一个存在的文件并读取其内容。
|
|
132
|
+
|
|
133
|
+
**写入规则**:
|
|
134
|
+
- 如果上述文件中存在任意一个,写入第一个存在的文件
|
|
135
|
+
- 如果都不存在,创建 `~/.codebuddy/.mcp.json`(最高优先级)
|
|
136
|
+
|
|
137
|
+
#### PROJECT 作用域
|
|
138
|
+
|
|
139
|
+
优先级顺序(从高到低):
|
|
140
|
+
1. `<项目根目录>/.mcp.json`(推荐)
|
|
141
|
+
2. `<项目根目录>/mcp.json`(已废弃)
|
|
142
|
+
|
|
143
|
+
**读取规则**:系统会按上述顺序查找第一个存在的文件并读取其内容。
|
|
144
|
+
|
|
145
|
+
**写入规则**:
|
|
146
|
+
- 如果上述文件中存在任意一个,写入第一个存在的文件
|
|
147
|
+
- 如果都不存在,创建 `<项目根目录>/.mcp.json`(最高优先级)
|
|
148
|
+
|
|
149
|
+
#### LOCAL 作用域
|
|
150
|
+
|
|
151
|
+
local 作用域的配置实际上保存在 user 作用域的配置文件中,通过 `projects` 字段来区分不同项目的 local 配置。
|
|
152
|
+
|
|
153
|
+
文件路径:`~/.codebuddy.json#/projects/<workspace_path>`
|
|
154
|
+
|
|
155
|
+
`#/projects/<workspace_path>` 使用的是 JSON Pointer 语法,用于指向 JSON 文档中的特定位置。关于 JSON Pointer 的详细说明,请参考:https://datatracker.ietf.org/doc/html/rfc6901
|
|
156
|
+
|
|
157
|
+
**注意**:
|
|
158
|
+
- 系统不会合并同一个作用域的多个配置文件内容,只会使用第一个存在的文件
|
|
159
|
+
|
|
160
|
+
示例见下方配置文件格式说明。
|
|
161
|
+
|
|
162
|
+
### 配置文件格式
|
|
163
|
+
|
|
164
|
+
MCP 配置文件支持 **JSONC (JSON with Comments)** 格式,允许在配置中添加注释,提升可读性和可维护性。
|
|
165
|
+
|
|
166
|
+
#### JSONC 支持的特性
|
|
167
|
+
|
|
168
|
+
- **单行注释**:使用 `//` 添加行内或行尾注释
|
|
169
|
+
- **多行注释**:使用 `/* */` 添加块注释
|
|
170
|
+
- **尾随逗号**:数组和对象的最后一个元素后可以添加逗号
|
|
171
|
+
|
|
172
|
+
#### 基础配置格式
|
|
173
|
+
|
|
174
|
+
```jsonc
|
|
175
|
+
{
|
|
176
|
+
// MCP 服务器配置
|
|
177
|
+
"mcpServers": {
|
|
178
|
+
"server-name": {
|
|
179
|
+
"type": "stdio|sse|http",
|
|
180
|
+
"command": "命令路径",
|
|
181
|
+
"args": ["参数1", "参数2"],
|
|
182
|
+
"env": {
|
|
183
|
+
"ENV_VAR": "value"
|
|
184
|
+
},
|
|
185
|
+
"url": "http://example.com/mcp",
|
|
186
|
+
"headers": {
|
|
187
|
+
"Authorization": "Bearer token"
|
|
188
|
+
},
|
|
189
|
+
"description": "服务器描述"
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
// projects 字段仅在 user 作用域的文件里有效,用于识别 local 作用域的配置
|
|
193
|
+
"projects": {
|
|
194
|
+
"/path/to/project": {
|
|
195
|
+
"mcpServers": {
|
|
196
|
+
"local-server": {
|
|
197
|
+
"type": "stdio",
|
|
198
|
+
"command": "./local-tool"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
#### 带注释的完整示例
|
|
207
|
+
|
|
208
|
+
```jsonc
|
|
209
|
+
{
|
|
210
|
+
// MCP Server Configuration for CodeBuddy
|
|
211
|
+
// 这个文件配置了项目使用的 MCP 服务器
|
|
212
|
+
|
|
213
|
+
"mcpServers": {
|
|
214
|
+
/*
|
|
215
|
+
* Filesystem Server
|
|
216
|
+
* 提供文件系统访问能力
|
|
217
|
+
* 文档: https://github.com/modelcontextprotocol/servers
|
|
218
|
+
*/
|
|
219
|
+
"filesystem": {
|
|
220
|
+
"type": "stdio",
|
|
221
|
+
"command": "npx",
|
|
222
|
+
"args": [
|
|
223
|
+
"-y",
|
|
224
|
+
"@modelcontextprotocol/server-filesystem",
|
|
225
|
+
"/path/to/workspace", // 工作目录路径
|
|
226
|
+
],
|
|
227
|
+
"env": {
|
|
228
|
+
"DEBUG": "true", // 启用调试模式
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
|
|
232
|
+
// HTTP API 服务器示例
|
|
233
|
+
"api-server": {
|
|
234
|
+
"type": "http",
|
|
235
|
+
"url": "http://localhost:3000/mcp", // 本地开发服务器
|
|
236
|
+
"headers": {
|
|
237
|
+
"Authorization": "Bearer your-token",
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
|
|
242
|
+
// 已禁用的服务器列表(供参考)
|
|
243
|
+
"disabledMcpServers": [
|
|
244
|
+
"deprecated-server",
|
|
245
|
+
],
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
**注意**:
|
|
250
|
+
- 标准 JSON 格式文件仍然完全兼容
|
|
251
|
+
- 解析错误时会提供清晰的错误提示
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
**注意**:`type` 字段是可选的。如果未指定,系统会根据配置内容自动推断:
|
|
255
|
+
- 包含 `command` 字段时,推断为 `stdio` 类型
|
|
256
|
+
- 包含 `url` 字段时,推断为 `http` 类型
|
|
257
|
+
|
|
258
|
+
建议显式指定 `type` 字段以确保配置的准确性。
|
|
259
|
+
|
|
260
|
+
### 环境变量扩展
|
|
261
|
+
|
|
262
|
+
MCP 配置支持环境变量扩展,允许您在配置中引用系统环境变量。这对于在团队间共享配置、管理敏感信息(如 API 密钥、令牌)以及支持环境特定配置(开发、测试、生产)非常有用。
|
|
263
|
+
|
|
264
|
+
#### 支持的语法
|
|
265
|
+
|
|
266
|
+
- **`${VAR_NAME}`** - 展开为环境变量 VAR_NAME 的值
|
|
267
|
+
- **`${VAR_NAME:-default_value}`** - 如果 VAR_NAME 未设置,使用默认值
|
|
268
|
+
|
|
269
|
+
#### 变量命名规则
|
|
270
|
+
|
|
271
|
+
- 变量名必须以大写字母或下划线 `[A-Z_]` 开头
|
|
272
|
+
- 后续字符只能是大写字母、数字或下划线 `[A-Z0-9_]*`
|
|
273
|
+
- 小写字母、混合大小写以及以数字开头的变量不会被展开
|
|
274
|
+
|
|
275
|
+
#### 支持的配置字段
|
|
276
|
+
|
|
277
|
+
环境变量可以在以下配置字段中展开:
|
|
278
|
+
|
|
279
|
+
**STDIO 类型配置**:
|
|
280
|
+
- `command` - 可执行文件路径或命令
|
|
281
|
+
- `args` - 命令行参数列表中的每个参数
|
|
282
|
+
- `env` - 环境变量值(键不会被展开)
|
|
283
|
+
|
|
284
|
+
**SSE/HTTP/Remote 类型配置**:
|
|
285
|
+
- `url` - 服务端点 URL
|
|
286
|
+
- `headers` - HTTP 请求头值(键不会被展开)
|
|
287
|
+
|
|
288
|
+
#### 错误处理
|
|
289
|
+
|
|
290
|
+
**环境变量未设置的行为**:
|
|
291
|
+
- 如果环境变量未设置且**有默认值**,使用默认值
|
|
292
|
+
- 如果环境变量未设置且**无默认值**,保留原始占位符(`${VAR}`),并在诊断中报告 WARNING 消息
|
|
293
|
+
|
|
294
|
+
这意味着配置不会因缺失的环境变量而失败,而是保留占位符并发出警告。
|
|
295
|
+
|
|
296
|
+
#### 示例配置
|
|
297
|
+
|
|
298
|
+
**示例 1:STDIO 类型服务器,使用环境变量**
|
|
299
|
+
```json
|
|
300
|
+
{
|
|
301
|
+
"mcpServers": {
|
|
302
|
+
"python-tools": {
|
|
303
|
+
"type": "stdio",
|
|
304
|
+
"command": "${PYTHON_PATH:-python}",
|
|
305
|
+
"args": [
|
|
306
|
+
"-m",
|
|
307
|
+
"my_mcp_server",
|
|
308
|
+
"--config",
|
|
309
|
+
"${CONFIG_DIR:-/etc/config}"
|
|
310
|
+
],
|
|
311
|
+
"env": {
|
|
312
|
+
"PYTHONPATH": "${PYTHON_LIB_PATH}",
|
|
313
|
+
"DEBUG": "${DEBUG_MODE:-false}",
|
|
314
|
+
"API_KEY": "${API_KEY}"
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
**示例 2:HTTP 类型服务器,使用环境变量和默认值**
|
|
322
|
+
```json
|
|
323
|
+
{
|
|
324
|
+
"mcpServers": {
|
|
325
|
+
"api-server": {
|
|
326
|
+
"type": "http",
|
|
327
|
+
"url": "${API_BASE_URL:-https://api.example.com}/mcp",
|
|
328
|
+
"headers": {
|
|
329
|
+
"Authorization": "Bearer ${API_TOKEN}",
|
|
330
|
+
"X-API-Version": "${API_VERSION:-v1}",
|
|
331
|
+
"User-Agent": "CodeBuddy/${CODEBUDDY_VERSION:-1.0}"
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
#### 常见用例
|
|
339
|
+
|
|
340
|
+
1. **团队共享配置**
|
|
341
|
+
```bash
|
|
342
|
+
# 在 .mcp.json 中使用环境变量
|
|
343
|
+
# 每个团队成员在本地设置环境变量
|
|
344
|
+
export API_TOKEN="their-personal-token"
|
|
345
|
+
export LOCAL_TOOL_PATH="/home/user/tools"
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
2. **环境特定配置**
|
|
349
|
+
```bash
|
|
350
|
+
# 开发环境
|
|
351
|
+
export API_BASE_URL="http://localhost:3000"
|
|
352
|
+
|
|
353
|
+
# 生产环境
|
|
354
|
+
export API_BASE_URL="https://api.production.com"
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
3. **管理敏感信息**
|
|
358
|
+
```json
|
|
359
|
+
{
|
|
360
|
+
"headers": {
|
|
361
|
+
"Authorization": "Bearer ${MY_API_KEY}"
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
```
|
|
365
|
+
将 API 密钥存储在环境变量中,不要直接写在配置文件中。
|
|
366
|
+
|
|
367
|
+
#### 诊断和调试
|
|
368
|
+
|
|
369
|
+
当配置中的环境变量展开时,您可以通过以下方式了解展开结果:
|
|
370
|
+
|
|
371
|
+
1. 如果某个环境变量未设置且无默认值,系统会发出 WARNING 诊断
|
|
372
|
+
2. 可以通过 `/mcp` 命令查看 MCP 服务器配置和诊断信息
|
|
373
|
+
3. 诊断消息会列出所有缺失的环境变量
|
|
374
|
+
|
|
375
|
+
**示例诊断消息**:
|
|
376
|
+
```
|
|
377
|
+
Missing environment variables: API_TOKEN, DATABASE_URL
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
### 配置结构详解
|
|
381
|
+
|
|
382
|
+
根据不同的传输类型,MCP 服务器配置具有不同的结构:
|
|
383
|
+
|
|
384
|
+
#### STDIO 类型配置
|
|
385
|
+
|
|
386
|
+
通过标准输入输出与本地进程通信。
|
|
387
|
+
|
|
388
|
+
| 字段 | 类型 | 必填 | 说明 |
|
|
389
|
+
|------|------|------|------|
|
|
390
|
+
| `type` | string | 是 | 固定值 `"stdio"` |
|
|
391
|
+
| `command` | string | 是 | 可执行文件路径或命令 |
|
|
392
|
+
| `args` | Array<string> | 否 | 命令行参数列表 |
|
|
393
|
+
| `env` | Object | 否 | 环境变量键值对 |
|
|
394
|
+
| `defer_loading` | boolean | 否 | 是否延迟加载工具(默认 false)|
|
|
395
|
+
| `tools` | Object | 否 | 工具级别配置,可覆盖服务器级别设置 |
|
|
396
|
+
|
|
397
|
+
**示例**:
|
|
398
|
+
```json
|
|
399
|
+
{
|
|
400
|
+
"type": "stdio",
|
|
401
|
+
"command": "python",
|
|
402
|
+
"args": ["-m", "my_mcp_server"],
|
|
403
|
+
"env": {
|
|
404
|
+
"PYTHONPATH": "/path/to/tools",
|
|
405
|
+
"DEBUG": "true"
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
#### SSE 类型配置
|
|
411
|
+
|
|
412
|
+
通过 Server-Sent Events 与远程服务通信。
|
|
413
|
+
|
|
414
|
+
| 字段 | 类型 | 必填 | 说明 |
|
|
415
|
+
|------|------|------|------|
|
|
416
|
+
| `type` | string | 是 | 固定值 `"sse"` |
|
|
417
|
+
| `url` | string | 是 | SSE 服务端点 URL |
|
|
418
|
+
| `headers` | Object | 否 | HTTP 请求头键值对 |
|
|
419
|
+
| `defer_loading` | boolean | 否 | 是否延迟加载工具(默认 false)|
|
|
420
|
+
| `tools` | Object | 否 | 工具级别配置,可覆盖服务器级别设置 |
|
|
421
|
+
|
|
422
|
+
**示例**:
|
|
423
|
+
```json
|
|
424
|
+
{
|
|
425
|
+
"type": "sse",
|
|
426
|
+
"url": "https://api.example.com/mcp/sse",
|
|
427
|
+
"headers": {
|
|
428
|
+
"Authorization": "Bearer your-api-token",
|
|
429
|
+
"X-API-Version": "v1"
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
#### HTTP 类型配置
|
|
435
|
+
|
|
436
|
+
通过 HTTP 流式传输与远程服务通信。
|
|
437
|
+
|
|
438
|
+
| 字段 | 类型 | 必填 | 说明 |
|
|
439
|
+
|------|------|------|------|
|
|
440
|
+
| `type` | string | 是 | 固定值 `"http"` |
|
|
441
|
+
| `url` | string | 是 | HTTP 服务端点 URL |
|
|
442
|
+
| `headers` | Object | 否 | HTTP 请求头键值对 |
|
|
443
|
+
| `defer_loading` | boolean | 否 | 是否延迟加载工具(默认 false)|
|
|
444
|
+
| `tools` | Object | 否 | 工具级别配置,可覆盖服务器级别设置 |
|
|
445
|
+
|
|
446
|
+
**示例**:
|
|
447
|
+
```json
|
|
448
|
+
{
|
|
449
|
+
"type": "http",
|
|
450
|
+
"url": "https://mcp.example.com/api/v1",
|
|
451
|
+
"headers": {
|
|
452
|
+
"Authorization": "Bearer secret-token",
|
|
453
|
+
"Content-Type": "application/json"
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
### 延迟加载 (defer_loading)
|
|
459
|
+
|
|
460
|
+
当 MCP 服务器提供大量工具时,可以使用 `defer_loading` 配置来延迟加载工具,减少上下文消耗并提高模型工具选择的准确性。
|
|
461
|
+
|
|
462
|
+
#### 工作原理
|
|
463
|
+
|
|
464
|
+
- 设置 `defer_loading: true` 的工具不会在初始请求时加载到模型上下文
|
|
465
|
+
- 模型可以通过 `ToolSearch` 工具搜索这些延迟加载的工具
|
|
466
|
+
- 搜索到的工具会被激活,并在后续请求中可用
|
|
467
|
+
- 激活状态在当前会话中保持
|
|
468
|
+
|
|
469
|
+
#### 服务器级别配置
|
|
470
|
+
|
|
471
|
+
将服务器的所有工具设为延迟加载:
|
|
472
|
+
|
|
473
|
+
```json
|
|
474
|
+
{
|
|
475
|
+
"mcpServers": {
|
|
476
|
+
"my-server": {
|
|
477
|
+
"type": "stdio",
|
|
478
|
+
"command": "my-mcp-server",
|
|
479
|
+
"defer_loading": true
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
#### 工具级别配置
|
|
486
|
+
|
|
487
|
+
可以为单个工具覆盖服务器级别的设置:
|
|
488
|
+
|
|
489
|
+
```json
|
|
490
|
+
{
|
|
491
|
+
"mcpServers": {
|
|
492
|
+
"my-server": {
|
|
493
|
+
"type": "stdio",
|
|
494
|
+
"command": "my-mcp-server",
|
|
495
|
+
"defer_loading": true,
|
|
496
|
+
"tools": {
|
|
497
|
+
"frequently_used_tool": {
|
|
498
|
+
"defer_loading": false
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
#### 继承规则
|
|
507
|
+
|
|
508
|
+
| 服务器 defer_loading | 工具 defer_loading | 最终结果 |
|
|
509
|
+
|---------------------|-------------------|---------|
|
|
510
|
+
| true | 未设置 | true(继承) |
|
|
511
|
+
| true | false | false(覆盖) |
|
|
512
|
+
| false/未设置 | 未设置 | false |
|
|
513
|
+
| false/未设置 | true | true(覆盖) |
|
|
514
|
+
|
|
515
|
+
#### 使用场景
|
|
516
|
+
|
|
517
|
+
- **工具数量多**:当 MCP 服务器提供超过 30 个工具时
|
|
518
|
+
- **减少成本**:减少每次请求的 token 消耗
|
|
519
|
+
- **提高准确性**:让模型在更少的工具中做出更准确的选择
|
|
520
|
+
|
|
521
|
+
## 命令行使用
|
|
522
|
+
|
|
523
|
+
### 添加 MCP 服务器
|
|
524
|
+
|
|
525
|
+
#### STDIO 服务器
|
|
526
|
+
|
|
527
|
+
```bash
|
|
528
|
+
# 添加本地可执行文件
|
|
529
|
+
codebuddy mcp add --scope user my-tool -- /path/to/tool arg1 arg2
|
|
530
|
+
|
|
531
|
+
# 添加 Python 脚本
|
|
532
|
+
codebuddy mcp add --scope project python-tool -- python /path/to/script.py
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
#### SSE 服务器
|
|
536
|
+
|
|
537
|
+
```bash
|
|
538
|
+
# 添加 SSE 服务器
|
|
539
|
+
codebuddy mcp add --scope user --transport sse sse-server https://example.com/mcp/sse
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
#### HTTP 服务器
|
|
543
|
+
|
|
544
|
+
```bash
|
|
545
|
+
# 添加 HTTP 流式服务器
|
|
546
|
+
codebuddy mcp add --scope project --transport http http-server https://example.com/mcp/http
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
### 使用 JSON 配置添加服务器
|
|
550
|
+
|
|
551
|
+
```bash
|
|
552
|
+
# 添加 STDIO 类型服务器
|
|
553
|
+
codebuddy mcp add-json --scope user my-server '{"type":"stdio","command":"/usr/local/bin/tool","args":["--verbose"]}'
|
|
554
|
+
|
|
555
|
+
# 添加 HTTP 类型服务器
|
|
556
|
+
codebuddy mcp add-json --scope user http-server '{"type":"http","url":"https://example.com/mcp","headers":{"Authorization":"Bearer token"}}'
|
|
557
|
+
|
|
558
|
+
# 添加 SSE 类型服务器
|
|
559
|
+
codebuddy mcp add-json --scope project sse-server '{"type":"sse","url":"https://api.example.com/mcp/sse","headers":{"X-API-Key":"your-api-key"}}'
|
|
560
|
+
|
|
561
|
+
# 添加带环境变量的 STDIO 服务器
|
|
562
|
+
codebuddy mcp add-json --scope user python-tool '{"type":"stdio","command":"python","args":["-m","my_mcp_server"],"env":{"PYTHONPATH":"/path/to/tools"}}'
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
### 管理 MCP 服务器
|
|
566
|
+
|
|
567
|
+
#### 列出所有服务器
|
|
568
|
+
|
|
569
|
+
```bash
|
|
570
|
+
# 列出所有作用域的服务器
|
|
571
|
+
codebuddy mcp list
|
|
572
|
+
```
|
|
573
|
+
|
|
574
|
+
#### 查看服务器详情
|
|
575
|
+
|
|
576
|
+
```bash
|
|
577
|
+
# 查看特定服务器信息
|
|
578
|
+
codebuddy mcp get my-server
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
#### 移除服务器
|
|
582
|
+
|
|
583
|
+
```bash
|
|
584
|
+
# 移除特定服务器
|
|
585
|
+
codebuddy mcp remove my-server
|
|
586
|
+
|
|
587
|
+
# 移除特定作用域的服务器
|
|
588
|
+
codebuddy mcp remove my-server --scope user
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
## 最佳实践
|
|
592
|
+
|
|
593
|
+
### 1. 作用域选择
|
|
594
|
+
|
|
595
|
+
- 使用 **user** 作用域存储个人工具和全局服务
|
|
596
|
+
- 使用 **project** 作用域存储项目特定的工具
|
|
597
|
+
- 使用 **local** 作用域存储临时或实验性工具
|
|
598
|
+
|
|
599
|
+
### 2. 安全考虑
|
|
600
|
+
|
|
601
|
+
- 避免在配置文件中存储敏感信息
|
|
602
|
+
- **使用环境变量传递认证信息**:利用 MCP 的环境变量扩展功能(`${API_TOKEN}` 或 `${API_TOKEN:-default}`)来管理 API 密钥、令牌等敏感数据
|
|
603
|
+
- 定期审查和更新服务器配置
|
|
604
|
+
- 项目作用域的 MCP 服务器需要用户审批后才能连接,确保安全性
|
|
605
|
+
- OAuth 授权 URL 会在打开前进行安全验证,仅支持 http/https 协议
|
|
606
|
+
- 将包含环境变量引用的配置文件提交到版本控制系统,但在 `.gitignore` 中排除实际的环境变量文件
|
|
607
|
+
|
|
608
|
+
### 3. 性能优化
|
|
609
|
+
|
|
610
|
+
- 合理配置服务器超时时间
|
|
611
|
+
- 避免同时运行过多的 STDIO 服务器
|
|
612
|
+
- 使用缓存机制减少重复连接
|
|
613
|
+
|
|
614
|
+
### 4. 错误处理
|
|
615
|
+
|
|
616
|
+
- 监控服务器连接状态
|
|
617
|
+
- 实现重连机制
|
|
618
|
+
- 记录和分析错误日志
|
|
619
|
+
|
|
620
|
+
## 故障排除
|
|
621
|
+
|
|
622
|
+
### 常见问题
|
|
623
|
+
|
|
624
|
+
#### 服务器连接失败
|
|
625
|
+
|
|
626
|
+
1. 检查命令路径是否正确
|
|
627
|
+
2. 验证参数和环境变量
|
|
628
|
+
3. 确认网络连接(对于远程服务器)
|
|
629
|
+
4. 查看服务器日志输出
|
|
630
|
+
|
|
631
|
+
#### 工具不可用
|
|
632
|
+
|
|
633
|
+
1. 确认服务器已成功连接
|
|
634
|
+
2. 检查工具权限设置
|
|
635
|
+
3. 验证工具兼容性
|
|
636
|
+
|
|
637
|
+
#### 配置不生效
|
|
638
|
+
|
|
639
|
+
1. 检查配置文件语法
|
|
640
|
+
2. 确认作用域优先级
|
|
641
|
+
3. 重启 CodeBuddy 应用
|
|
642
|
+
|
|
643
|
+
## 示例配置
|
|
644
|
+
|
|
645
|
+
### Python 工具服务器
|
|
646
|
+
|
|
647
|
+
```json
|
|
648
|
+
{
|
|
649
|
+
"mcpServers": {
|
|
650
|
+
"python-tools": {
|
|
651
|
+
"type": "stdio",
|
|
652
|
+
"command": "python",
|
|
653
|
+
"args": ["-m", "my_mcp_server"],
|
|
654
|
+
"env": {
|
|
655
|
+
"PYTHONPATH": "/path/to/tools"
|
|
656
|
+
},
|
|
657
|
+
"description": "Python 工具集合"
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
```
|
|
662
|
+
|
|
663
|
+
### 远程 API 服务器
|
|
664
|
+
|
|
665
|
+
```json
|
|
666
|
+
{
|
|
667
|
+
"mcpServers": {
|
|
668
|
+
"api-server": {
|
|
669
|
+
"type": "sse",
|
|
670
|
+
"url": "https://api.example.com/mcp/sse",
|
|
671
|
+
"headers": {
|
|
672
|
+
"Authorization": "Bearer your-token",
|
|
673
|
+
"X-API-Version": "v1"
|
|
674
|
+
},
|
|
675
|
+
"description": "远程 API 服务"
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
```
|
|
680
|
+
|
|
681
|
+
### Node.js 本地服务器
|
|
682
|
+
|
|
683
|
+
```json
|
|
684
|
+
{
|
|
685
|
+
"mcpServers": {
|
|
686
|
+
"node-server": {
|
|
687
|
+
"type": "stdio",
|
|
688
|
+
"command": "node",
|
|
689
|
+
"args": ["./mcp-server.js"],
|
|
690
|
+
"env": {
|
|
691
|
+
"NODE_ENV": "production"
|
|
692
|
+
},
|
|
693
|
+
"description": "Node.js MCP 服务器"
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
```
|
|
698
|
+
|
|
699
|
+
## 扩展开发
|
|
700
|
+
|
|
701
|
+
### 创建自定义 MCP 服务器
|
|
702
|
+
|
|
703
|
+
1. **选择实现语言**: Python、Node.js、Go 等
|
|
704
|
+
2. **实现 MCP 协议**:使用官方 SDK 或自行实现
|
|
705
|
+
3. **定义工具接口**:描述工具功能和参数
|
|
706
|
+
4. **处理请求**:接收和处理来自 CodeBuddy 的请求
|
|
707
|
+
5. **返回结果**:按 MCP 格式返回执行结果
|
|
708
|
+
|
|
709
|
+
### SDK 和库
|
|
710
|
+
|
|
711
|
+
- **Python**: `FastMCP`
|
|
712
|
+
- **TypeScript/JavaScript**: `@modelcontextprotocol/sdk`
|
|
713
|
+
- **其他语言**:参考官方文档实现
|
|
714
|
+
|
|
715
|
+
## 配置示例
|
|
716
|
+
|
|
717
|
+
### TAPD
|
|
718
|
+
|
|
719
|
+
```bash
|
|
720
|
+
codebuddy mcp add --scope user --transport http --header "X-Tapd-Access-Token: TAPD_ACCESS_TOKEN" -- tapd_mcp_http https://mcp-oa.tapd.woa.com/mcp
|
|
721
|
+
```
|
|
722
|
+
|
|
723
|
+
### Chrome Devtools
|
|
724
|
+
|
|
725
|
+
```bash
|
|
726
|
+
codebuddy mcp add --scope user chrome-devtools -- npx -y chrome-devtools-mcp@latest
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
### iWiki
|
|
730
|
+
|
|
731
|
+
```bash
|
|
732
|
+
codebuddy mcp add --scope user iwiki -- npx -y mcp-remote@latest https://prod.mcp.it.woa.com/app_iwiki_mcp/mcp3
|
|
733
|
+
```
|
|
734
|
+
|
|
735
|
+
## 相关链接
|
|
736
|
+
|
|
737
|
+
- [MCP 官方文档](https://modelcontextprotocol.io/)
|
|
738
|
+
- [MCP GitHub 仓库](https://github.com/modelcontextprotocol)
|
|
739
|
+
- [CodeBuddy 官方文档](https://cnb.cool/codebuddy/codebuddy-code/-/blob/main/docs)
|