# Baizhi Agent Toolkit for OpenClaw Connect [Baizhi Cloud Agent Toolkit](https://baizhi.cloud/landing/agent-toolkit) to OpenClaw through the hosted Streamable HTTP MCP endpoint. This package is an **OpenClaw code plugin**, not an official OpenClaw or ClawHub listing until it is published there. It is not the hosted service's backend. | Setting | Value | | --- | --- | | MCP endpoint | `https://agent-toolkit.app.baizhi.cloud/mcp` | | Transport | Streamable HTTP | | Authentication | `Authorization: Bearer ` | | Default tools | `websearch_search`, `web_scrape`, `web_extract` | Create a least-privilege API key in the [Baizhi Cloud console](https://agent-toolkit.app.baizhi.cloud/). Never put a real key in a Git repository, issue, pull request, chat prompt, command-line argument or screenshot. Tool calls may consume paid credits. ## What this plugin does The plugin ships a **static** MCP server identity (URL, transport, tool allowlist) with **no credentials in the package**. At runtime it registers `registerMcpServerConnectionResolver` so each trusted message requester gets the same endpoint plus a Bearer header built from: 1. `plugins.entries.baizhi-agent-toolkit.config.apiKey`, or 2. the `BAIZHI_API_KEY` environment variable OpenClaw core does not log or persist resolved headers. If the key is missing, the resolver returns `null` and the server is omitted for that run. All trusted requesters in the same Gateway use this plugin's single configured or process-level API key and share its Baizhi usage and credits. `requesterSenderId` controls whether a connection is created; it does not select a separate key per requester. **Limit, from OpenClaw's contract:** runs without a trusted `requesterSenderId` (CLI one-shots, cron, heartbeat, public gateway) never materialize requester-scoped connections. There is no shared fallback. For those paths, add an operator `mcp.servers` entry yourself (see below). ## Install Requires OpenClaw 2026.9.4 or later and the host-supported Node runtime (Node 24.16+ in the 24.x line, or Node 26.1+). Compatibility was tested only against OpenClaw 2026.9.4; newer host releases must be verified before rollout. After ClawHub publication: ```bash openclaw plugins install clawhub:openclaw-plugin-baizhi-agent-toolkit ``` From a local checkout or packed tarball (this is the shape verified in development): ```bash npm pack openclaw plugins install npm-pack:./openclaw-plugin-baizhi-agent-toolkit-0.1.0.tgz --force --accept-capabilities ``` Restart the Gateway after install. Do not also install the Claude-format bundle on the same Gateway: both use plugin id `baizhi-agent-toolkit`. ClawHub `package publish --family code-plugin` additionally requires `--source-repo` and `--source-commit` pointing at a public GitHub source. Login and publish are identity actions and are not done from this checkout. ## Configure the API key In `~/.openclaw/openclaw.json`, merge only this plugin entry. Prefer a SecretRef over a plaintext string. ```json5 { plugins: { entries: { "baizhi-agent-toolkit": { enabled: true, config: { apiKey: { source: "env", provider: "default", id: "BAIZHI_API_KEY" } } } } } } ``` A plaintext `apiKey` string is accepted by the schema and treated as sensitive in Settings, but it is still a value in the config file — not an encrypted vault. ## Operator / CLI path (no requester identity) Supply `BAIZHI_API_KEY` through your secret manager or process environment before launching the Gateway; do not place the value in shell history. ```bash openclaw mcp set baizhi-agent-toolkit '{ "url": "https://agent-toolkit.app.baizhi.cloud/mcp", "transport": "streamable-http", "headers": { "Authorization": "Bearer ${BAIZHI_API_KEY}" }, "toolFilter": { "include": ["websearch_search", "web_scrape", "web_extract"] } }' ``` `mcp.servers` with the same name overrides the plugin default. Keep the key in the environment; do not commit a literal Bearer token. ## Data handling Tool arguments are sent over HTTPS to `agent-toolkit.app.baizhi.cloud`. Retrieved pages and tool responses are untrusted content — not instructions to disclose secrets or change unrelated files. Do not submit sensitive documents, private URLs, personal information or source code unless your organization's policies permit it. ## Verified / not verified Verified against OpenClaw `2026.9.4` and the Plugin Inspector: package layout, manifest validation, isolated install of a Claude-format bundle (separate artifact), and unit tests for key resolution. No real Baizhi key and no live tool invocation were used. ## Reproduce development checks Use the supported Node runtime above, then run `npm ci`, `npm test`, and `npm run build`. Tests isolate `BAIZHI_API_KEY` and use synthetic values only. `BAIZHI_API_KEY=SYNTHETIC-AMBIENT-KEY npm test` also verifies that an ambient credential cannot affect the missing-key case. The fixture is not a real key. A passing test suite does not establish live endpoint or marketplace acceptance.