Get the FREE Ultimate OpenClaw Setup Guide →

bocha-ai

MCP server from yoko19191/bocha-ai-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio yoko19191-bocha-ai-mcp-server node /ABSOLUTE/PATH/bocha-ai-mcp-server/build/index.js \
  --env BOCHA_API_KEY="<YOUR_BOCHA_API_KEY>"

How to use

The Bocha AI Web Search MCP Server exposes a web search capability built around the Bocha AI service. It provides a tool named bocha_web_search that retrieves content from Chinese internet sources, with optional detailed summaries and image results. The output can be delivered in two formats: Markdown for human readability, including links and image previews, or JSON for programmatic processing. To use it, issue a search query through the bocha_web_search tool with parameters such as query, freshness, summary, count, and raw_json to control the output format. The server returns structured results that include web content, summaries, and related images as applicable. If you prefer raw programmatic data, set raw_json to true to receive a JSON structure instead of Markdown.

How to install

Prerequisites:

  • Node.js and npm installed on your machine
  • Access to Bocha AI API and a valid API key

Step-by-step installation:

  1. Clone the MCP server repository: git clone git@github.com:yoko19191/bocha-ai-mcp-server.git
  2. Navigate to the project directory: cd bocha-ai-mcp-server
  3. Copy the sample environment file and configure your API key: cp .env.example .env

    Edit .env and set BOCHA_API_KEY to your Bocha AI API key

  4. Install dependencies: npm install
  5. Build the server (if a build step exists): npm run build
  6. Run the MCP server via Node.js (as described in the Configuration section): node /ABSOLUTE/PATH/bocha-ai-mcp-server/build/index.js

Notes:

  • Ensure your BOCHA_API_KEY is set in the environment where the server runs.
  • The example configuration uses an absolute path to the built server file; adjust as needed for your deployment environment.

Additional notes

Tips and considerations:

  • Ensure the BOCHA_API_KEY is kept secret and not exposed in client-side code.
  • The server supports both Markdown and JSON outputs; use the raw_json flag to switch formats.
  • If you encounter issues with API rate limits or connectivity, verify network access to Bocha AI endpoints and validate your API key.
  • When deploying in production, consider setting up environment-based configuration management and logging to monitorBocha API usage and response times.
  • The mcp.json example uses a single server named bocha-ai-search; you can add additional MCP servers by extending the mcpServers map.

Related MCP Servers

Sponsor this space

Reach thousands of developers