Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
159 changes: 159 additions & 0 deletions content/docs/mcp_servers/baizhi_agent_toolkit.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
---
title: Baizhi Agent Toolkit
icon: Blocks
description: Configure Baizhi Agent Toolkit in LibreChat with Streamable HTTP and a separate API key for each user.
---

[Baizhi Agent Toolkit](https://baizhi.cloud/landing/agent-toolkit) is a hosted MCP service for web
search, page scraping, and structured extraction. This guide uses LibreChat's existing per-user
credential interface; it does not require a LibreChat plugin or a shared administrator API key.

The [official integration repository](https://github.com/chaitin/baizhi-agent-toolkit) contains
client configuration, documentation, and tests. It does not contain the hosted service's backend
source code. Its open-source license does not replace the online service's terms or pricing.

<Callout type="warning" title="Account, credentials, and costs">
Each user needs a Baizhi Cloud account and their own API key. Tool calls can consume service
credits. Review permissions and current pricing in the
[Baizhi console](https://agent-toolkit.app.baizhi.cloud/) before enabling tools. Do not paste a
real key into `librechat.yaml`, chat messages, source control, issues, or screenshots.
</Callout>

## Prerequisites

- A running LibreChat deployment with [MCP support](/docs/features/mcp), a tool-capable model, and
access to the Agent Builder.
- Permission to edit that deployment's `librechat.yaml` and restart it, or an administrator who can
do so. The server definition below is deployment-level configuration; credentials are per user.
- A dedicated API key created in the [Baizhi console](https://agent-toolkit.app.baizhi.cloud/),
restricted to the tools you intend to use where the service permits it.
- Network access from the LibreChat server to `agent-toolkit.app.baizhi.cloud` over HTTPS.

## Add the server definition

Merge this entry into the existing `mcpServers` section of `librechat.yaml`. Keep other server
entries and the rest of your configuration unchanged; do not add a second top-level `mcpServers`
key.

```yaml filename="librechat.yaml"
mcpServers:
baizhi-agent-toolkit:
title: 'Baizhi Agent Toolkit'
description: 'Web search, page scraping, and structured extraction'
type: streamable-http
url: 'https://agent-toolkit.app.baizhi.cloud/mcp'
headers:
Authorization: 'Bearer {{BAIZHI_API_KEY}}'
customUserVars:
BAIZHI_API_KEY:
title: 'Baizhi API Key'
description: "Enter your personal key from <a href='https://agent-toolkit.app.baizhi.cloud/' target='_blank' rel='noopener noreferrer'>the Baizhi console</a>, without the Bearer prefix."
sensitive: true
requiresOAuth: false
startup: false
chatMenu: false
```

- `customUserVars` gives each user a separate credential input. `sensitive: true` masks it in the
interface; the example contains only a placeholder, not a shared key.
- `requiresOAuth: false` skips OAuth discovery. Baizhi expects the key in an
`Authorization: Bearer ...` header.
- `startup: false` prevents an automatic connection at application startup. Users initialize the
server after entering their credentials.
- `chatMenu: false` keeps the whole server out of the regular chat picker. This guide uses the
Agent Builder to select a small set of tools instead. It does not restrict the API key's
server-side permissions.

If your deployment configures
[`mcpSettings.allowedDomains`](/docs/configuration/librechat_yaml/object_structure/mcp_settings),
merge `agent-toolkit.app.baizhi.cloud` into that allowlist. Preserve existing entries and do not
disable the policy.

Restart LibreChat using the normal procedure for your deployment so it reloads the configuration.

## Enter your key and connect

1. Open **MCP Settings** in LibreChat's right sidebar.
2. Select **Baizhi Agent Toolkit** and enter your key in **Baizhi API Key**. Enter the key itself;
do not include the `Bearer ` prefix.
3. Save the credential, then initialize or reinitialize the server using its connection control.
4. Confirm that the server is connected and that tools are available before using an Agent.

These values are associated with the individual user and server in LibreChat. Only enter a key
into a deployment you trust: masking an input does not make the credential browser-only or prevent
the LibreChat server from using it to authenticate to Baizhi.

For interface details, see
[user-provided credentials](/docs/features/mcp#user-provided-credentials) and
[server initialization](/docs/features/mcp#server-initialization).

## Select tools for an Agent

Create or edit an Agent, open **Add tools**, select **MCP**, and choose **Baizhi Agent Toolkit**.
Expand the server and enable only the tools the Agent needs. A recommended initial selection is:

| Tool | Purpose |
| ------------------ | ------------------------------------------- |
| `websearch_search` | Search the web. |
| `web_scrape` | Read the text of a web page. |
| `web_extract` | Extract structured information from a page. |

This is a recommended initial selection, not an enforced LibreChat allowlist. The tools actually
returned by the server depend on its current catalog and your key's permissions. Review the
discovered list, disable unneeded tools in the Agent, and save the Agent. Enabling a tool in
LibreChat does not grant permissions that the API key lacks.

## Verify the setup

First verify the connected status and discovered tool list without asking the Agent to execute a
tool. A successful connection does not prove that a particular tool call will succeed.

After reviewing service costs, use a public, non-sensitive test with the Agent, such as:

> Use `websearch_search` to find the official LibreChat MCP documentation. Return the source URL.

Confirm that LibreChat actually invokes the selected MCP tool and displays its result. Do not
treat an answer produced from model knowledge as proof of integration. Test additional tools only
when needed, and keep any available tool approval controls enabled.

## Update or remove credentials

Use the server's credential dialog to replace a key, save, and reinitialize the connection. To
stop using a key, remove or revoke the saved value in LibreChat and revoke the key in the Baizhi
console. Removing a local credential does not revoke it at the service.

To remove the integration, an administrator can remove only `baizhi-agent-toolkit` from
`mcpServers`, remove its tools from affected Agents, and restart LibreChat. Do not delete unrelated
server definitions or credentials.

## Troubleshooting

| Symptom | What to check |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Server is not visible | Confirm that LibreChat loaded the edited configuration and was restarted. Check your MCP access permissions. |
| Missing credential or HTTP 401 | Save your key in the per-user dialog, omit the `Bearer ` prefix, and check whether the key was revoked or expired. |
| HTTP 403 or an unavailable tool | Check the account and API key permissions in the Baizhi console; do not replace a user's key with a shared administrator key. |
| OAuth prompt appears | Confirm `requiresOAuth: false` is present and that no conflicting OAuth configuration was added. |
| Connection is blocked or times out | Check outbound HTTPS access and any `mcpSettings.allowedDomains` policy from the LibreChat server, not just from your browser. |
| Connected, but Agent has no tools | Select the MCP server and its individual tools in the Agent Builder, save the Agent, and confirm the model supports tool calls. |

## Data and security

- Tool arguments are sent over HTTPS to the hosted Baizhi service. Tool results may also be sent
to your selected model provider as part of the conversation. Check organizational policy before
sending private URLs, personal data, source code, or confidential documents.
- Service permissions, costs, and any underlying provider use are governed by Baizhi's current
terms and console settings. This guide does not promise a particular retention period or data
residency.
- Treat web content and tool results as untrusted input, not instructions to reveal credentials,
change unrelated configuration, or approve additional actions.
- Report integration problems to the
[Baizhi integration repository](https://github.com/chaitin/baizhi-agent-toolkit/issues) with the
LibreChat version and a redacted error. Never include a key or a complete authorization header.

## Related pages

- [MCP overview](/docs/features/mcp)
- [MCP server configuration](/docs/configuration/librechat_yaml/object_structure/mcp_servers)
- [Access control](/docs/features/access_control)
- [Baizhi Agent Toolkit integration repository](https://github.com/chaitin/baizhi-agent-toolkit)
3 changes: 3 additions & 0 deletions content/docs/mcp_servers/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ description: Step-by-step guides for configuring specific MCP servers in LibreCh
Use these guides to configure specific MCP servers with the right transport, OAuth callbacks, scopes, environment variables, and LibreChat settings.

<Cards num={3}>
<Cards.Card title="Baizhi Agent Toolkit" href="/docs/mcp_servers/baizhi_agent_toolkit" arrow>
Configure the hosted MCP service with Streamable HTTP and a separate API key for each user.
</Cards.Card>
<Cards.Card title="Google Workspace MCP" href="/docs/mcp_servers/google_workspace" arrow>
Configure Gmail, Drive, Calendar, People, and Chat remote MCP servers with Google OAuth.
</Cards.Card>
Expand Down
2 changes: 1 addition & 1 deletion content/docs/mcp_servers/meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title": "MCP Servers",
"icon": "Blocks",
"pages": ["index", "google_workspace", "salesforce"]
"pages": ["index", "baizhi_agent_toolkit", "google_workspace", "salesforce"]
}