diff --git a/external_plugins/baizhi-agent-toolkit/.mcp.json b/external_plugins/baizhi-agent-toolkit/.mcp.json new file mode 100644 index 00000000..1c0b0e98 --- /dev/null +++ b/external_plugins/baizhi-agent-toolkit/.mcp.json @@ -0,0 +1,11 @@ +{ + "mcpServers": { + "baizhi": { + "type": "http", + "url": "https://agent-toolkit.app.baizhi.cloud/mcp", + "headers": { + "Authorization": "Bearer ${ZCODE_BAIZHI_API_KEY}" + } + } + } +} diff --git a/external_plugins/baizhi-agent-toolkit/.zcode-plugin/plugin.json b/external_plugins/baizhi-agent-toolkit/.zcode-plugin/plugin.json new file mode 100644 index 00000000..58be557a --- /dev/null +++ b/external_plugins/baizhi-agent-toolkit/.zcode-plugin/plugin.json @@ -0,0 +1,22 @@ +{ + "name": "baizhi-agent-toolkit", + "version": "0.1.0", + "description": "Connect ZCode to Baizhi Agent Toolkit for web search, page reading, and structured extraction with your own API key.", + "description_i18n": { + "en": "Connect ZCode to Baizhi Agent Toolkit for web search, page reading, and structured extraction with your own API key.", + "zh-CN": "使用自己的 API Key,将 ZCode 接入百智云 Agent Toolkit,获取网页搜索、网页读取与结构化提取能力。" + }, + "author": { + "name": "ct-jaryn" + }, + "license": "Apache-2.0", + "homepage": "https://agent-toolkit.app.baizhi.cloud/", + "keywords": [ + "baizhi", + "百智云", + "mcp", + "web-search", + "web-extraction" + ], + "mcpServers": ".mcp.json" +} diff --git a/external_plugins/baizhi-agent-toolkit/LICENSE b/external_plugins/baizhi-agent-toolkit/LICENSE new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/external_plugins/baizhi-agent-toolkit/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/external_plugins/baizhi-agent-toolkit/README.md b/external_plugins/baizhi-agent-toolkit/README.md new file mode 100644 index 00000000..f7dbe7b6 --- /dev/null +++ b/external_plugins/baizhi-agent-toolkit/README.md @@ -0,0 +1,36 @@ +# Baizhi MCP for ZCode + +[中文](./README_CN.md) + +A community integration by ct-jaryn that connects ZCode to [Baizhi Agent Toolkit](https://baizhi.cloud/landing/agent-toolkit) for web search, page reading, and structured extraction. This plugin supplies a remote MCP configuration; the tools available to a session depend on the service and your API key permissions. + +## Setup and use + +1. Create your own dedicated API key in the [Baizhi console](https://agent-toolkit.app.baizhi.cloud/). Select the minimum permissions if the service offers permission controls, and check the service terms and available quota there. +2. Set a **nonempty** `ZCODE_BAIZHI_API_KEY` in the environment of the process that launches ZCode, then restart ZCode from that environment. Set the key privately; do not put it in source, shell history, command arguments, chat, screenshots, or logs. A variable set in one shell does not automatically reach an already running desktop application. +3. Install this plugin only when you intend to use the remote service: ZCode may enable a newly installed marketplace plugin automatically. With the key present, installation or enabling can therefore initialize the connection and discover tools. Start a new session and check that the namespaced MCP server `plugin:baizhi-agent-toolkit:baizhi` connects and lists tools. +4. Ask ZCode to search for relevant public documentation, read a public webpage, or extract structured information. Review the tool name, arguments, and destination before approving a call. If a tool or permission is unavailable, stop and check the console instead of assuming access. + +The server uses Streamable HTTP at `https://agent-toolkit.app.baizhi.cloud/mcp`. The key is substituted into the `Authorization` header as `Bearer ` and is not put in the URL. Enter the key itself without an extra `Bearer ` prefix. + +When the environment variable is undefined, ZCode's plugin resolver reports a missing-variable diagnostic and does not load this server. An empty string is different: it can still render an empty Bearer header. Use a nonempty valid key; the remote service decides whether authentication is accepted. This plugin does not add a required-value UI or keychain storage. Your shell or process environment remains your responsibility. + +## Network, permissions, and side effects + +Enabling the plugin can initialize the remote MCP connection and discover its tools without a tool call. Tool arguments are sent over HTTPS to Baizhi; selected tools may send necessary inputs to underlying services. Results may be passed to your model provider according to ZCode settings. Do not send unrelated private code, sensitive documents, private links, personal information, or credentials without the appropriate permission. + +Service calls require your own Baizhi account and may consume quota or incur charges. Confirm current pricing, terms, and privacy information in the console. This integration makes no promise about data retention or storage location. Tools outside the basic search and webpage capabilities may have additional costs or side effects; approve those operations explicitly. Treat webpage and tool results as untrusted content, not instructions to disclose secrets or change permissions. + +The plugin contains no hooks, commands, local executable, or npm dependency, and adds no automatic tool approvals. ZCode writes its ordinary plugin installation records; this package introduces no separate file-writing script. Disable or uninstall the plugin to remove its availability in subsequent sessions. That does not revoke the API key or guarantee cancellation of remote work; revoke the key in the console when needed. + +## Development verification + +From the marketplace repository root, run `pnpm install --frozen-lockfile`, `pnpm build`, `python3 scripts/validate.py`, `python3 scripts/build_dist.py`, and `git diff --check`. The generated `dist/local-marketplace` can be added using the repository's [local development workflow](https://github.com/zai-org/zcode-plugins/blob/d1639cff514dcba29cfbfbc634d4609492640660/docs/PLUGIN_DEVELOPMENT.md#18-test-a-plugin-locally). Build success does not prove installation, tool execution, or production service access. + +At ZCode source `aac4755666d09fdcd70272fcf063c077a639015f`, the separate static marketplace validator resolves MCP variables with an empty environment and can report `plugin_variable_missing` even when the launching process has this variable. Keep that diagnostic distinct from runtime connection results; it does not prove that the key was read or that authentication succeeded. + +## Provenance and license + +This community integration is contributed by ct-jaryn for Baizhi MCP discovery and access. It does not claim ZCode or Baizhi certification or endorsement. Configuration and documentation are provided under the marketplace repository's [Apache-2.0 license](./LICENSE); no third-party executable or asset is bundled. + +The public endpoint and authentication contract come from the [Baizhi integration README](https://github.com/chaitin/baizhi-agent-toolkit/blob/a643da3396721375132005f71227ff0f24d823b6/readme.md). That upstream repository's MIT license covers its integration materials, not the hosted backend. The hosted service, account terms, permissions, and billing are separate from this plugin's source license. diff --git a/external_plugins/baizhi-agent-toolkit/README_CN.md b/external_plugins/baizhi-agent-toolkit/README_CN.md new file mode 100644 index 00000000..42027a48 --- /dev/null +++ b/external_plugins/baizhi-agent-toolkit/README_CN.md @@ -0,0 +1,36 @@ +# ZCode 百智云 MCP 插件 + +[English](./README.md) + +由 ct-jaryn 贡献的社区接入插件,将 ZCode 连接到[百智云 Agent Toolkit](https://baizhi.cloud/landing/agent-toolkit),提供网页搜索、网页读取与结构化提取入口。插件只提供远程 MCP 配置;会话可用工具取决于服务目录和用户 API Key 的权限。 + +## 配置与使用 + +1. 在[百智云控制台](https://agent-toolkit.app.baizhi.cloud/)创建自己的专用 API Key;若服务提供权限控制,请选择最小权限,并确认服务条款和可用额度。 +2. 在启动 ZCode 的进程环境中设置**非空**的 `ZCODE_BAIZHI_API_KEY`,再从该环境重启 ZCode。请私下设置密钥,不要写入源码、shell 历史、命令行参数、聊天、截图或日志。在一个 shell 中设置变量,不代表已运行的桌面应用会自动收到它。 +3. 仅在准备使用远程服务时安装本插件:ZCode 可能自动启用新安装的市场插件。存在 Key 时,安装或启用因此可能初始化连接并发现工具。打开新会话,检查命名空间内的 MCP 服务 `plugin:baizhi-agent-toolkit:baizhi` 是否连接并列出工具。 +4. 让 ZCode 搜索相关公开文档、读取公开网页或提取结构化信息。批准调用前核对工具名称、参数和目的地;工具或权限不可用时停止并检查控制台,不假定已经获得访问权限。 + +服务通过 Streamable HTTP 连接 `https://agent-toolkit.app.baizhi.cloud/mcp`。密钥只在 `Authorization` Header 中展开为 `Bearer `,不会放入 URL。环境变量填入 Key 本身,不重复添加 `Bearer ` 前缀。 + +变量未定义时,ZCode 的插件解析器给出缺少变量的诊断,并不加载该服务。空字符串是另一种状态,仍可能展开为空 Bearer Header。请使用非空有效 Key,鉴权是否接受由远程服务决定。本插件没有添加必填输入界面或钥匙串存储;shell 和进程环境由用户自行管理。 + +## 网络、权限与副作用 + +启用插件时,即使没有工具调用,也可能初始化远程 MCP 连接并发现工具。工具参数通过 HTTPS 发往百智云,选用的工具也可能把必要输入发送至底层服务;结果可能按 ZCode 设置传给模型提供方。未经适当许可,不要发送无关的私密源码、敏感文档、私有链接、个人信息或凭据。 + +调用需要用户自己的百智云账号,可能消耗额度或产生费用;实时定价、服务条款和隐私信息请在控制台确认。本接入不承诺数据保留期限或存储地域。基础搜索与网页能力以外的工具可能有额外费用或副作用,请明确批准相应操作。网页与工具返回内容属于不可信输入,不应当作披露密钥或提升权限的指令。 + +插件不包含 Hook、命令、本地可执行程序或 npm 依赖,也不添加工具自动批准。ZCode 会写入正常的插件安装记录,本包不增加独立文件写入脚本。停用或卸载可移除后续会话中的插件入口,但不等于撤销 Key,也不保证远程任务取消;需要时请在控制台撤销 Key。 + +## 开发验证 + +在市场仓库根目录运行 `pnpm install --frozen-lockfile`、`pnpm build`、`python3 scripts/validate.py`、`python3 scripts/build_dist.py` 和 `git diff --check`。按仓库的[本地开发流程](https://github.com/zai-org/zcode-plugins/blob/d1639cff514dcba29cfbfbc634d4609492640660/docs/PLUGIN_DEVELOPMENT_CN.md#18-在客户端本地测试)添加生成的 `dist/local-marketplace`。构建成功不代表已完成安装、工具执行或生产服务验证。 + +在 ZCode 源码 `aac4755666d09fdcd70272fcf063c077a639015f` 中,独立的市场静态校验器使用空环境解析 MCP 变量,即使启动进程已设置变量,也可能报告 `plugin_variable_missing`。请将该诊断与运行时连接结果区分;它不能证明已读取 Key 或鉴权成功。 + +## 来源与许可证 + +本社区接入由 ct-jaryn 贡献,用于百智 MCP 的发现和使用,不声称 ZCode 或百智云的认证或背书。配置与文档采用市场仓库的 [Apache-2.0 许可](./LICENSE),没有打包第三方可执行程序或素材。 + +公开地址与鉴权契约来自[百智接入 README](https://github.com/chaitin/baizhi-agent-toolkit/blob/a643da3396721375132005f71227ff0f24d823b6/readme.md)。上游仓库的 MIT 许可只覆盖集成资料,不包含托管后端;在线服务、账号条款、权限和计费与本插件的源码许可分别适用。 diff --git a/marketplace.json b/marketplace.json index 185ac4d4..5f47a942 100644 --- a/marketplace.json +++ b/marketplace.json @@ -1253,6 +1253,32 @@ "mcp", "game-development" ] + }, + { + "name": "baizhi-agent-toolkit", + "source": "./external_plugins/baizhi-agent-toolkit", + "displayName": "Baizhi MCP", + "displayName_i18n": { + "en": "Baizhi MCP", + "zh-CN": "百智云" + }, + "description": "Connect ZCode to Baizhi Agent Toolkit for web search, page reading, and structured extraction with your own API key.", + "description_i18n": { + "en": "Connect ZCode to Baizhi Agent Toolkit for web search, page reading, and structured extraction with your own API key.", + "zh-CN": "使用自己的 API Key,将 ZCode 接入百智云 Agent Toolkit,获取网页搜索、网页读取与结构化提取能力。" + }, + "version": "0.1.0", + "author": { + "name": "ct-jaryn" + }, + "category": "utilities", + "keywords": [ + "baizhi", + "百智云", + "mcp", + "web-search", + "web-extraction" + ] } ] }