minimax-web-search

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

minimax-web-search

minimax-web-search

使用 MiniMax MCP 服务器进行网络搜索。
Perform web searches using the MiniMax MCP server.

执行流程(首次需要安装,后续直接步骤4调用)

Execution Process (Installation required for first use, directly call Step 4 afterwards)

步骤 1: 检查并安装依赖

Step 1: Check and Install Dependencies

1.1 检查 uvx 是否可用

1.1 Check if uvx is available

bash
which uvx
如果不存在,安装 uv:
方法 1: 使用官方安装脚本(推荐)
bash
curl -LsSf https://astral.sh/uv/install.sh | sh
方法 2: 使用国内镜像加速(如果官方脚本下载失败)
临时使用清华镜像源安装:
bash
export UV_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"
curl -LsSf https://astral.sh/uv/install.sh | sh
或者临时使用阿里云镜像源:
bash
export UV_INDEX_URL="https://mirrors.aliyun.com/pypi/simple/"
curl -LsSf https://astral.sh/uv/install.sh | sh
bash
which uvx
If it does not exist, install uv:
Method 1: Use official installation script (recommended)
bash
curl -LsSf https://astral.sh/uv/install.sh | sh
Method 2: Use domestic mirror for acceleration (if official script download fails)
Install with temporary Tsinghua mirror source:
bash
export UV_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"
curl -LsSf https://astral.sh/uv/install.sh | sh
Or use temporary Alibaba Cloud mirror source:
bash
export UV_INDEX_URL="https://mirrors.aliyun.com/pypi/simple/"
curl -LsSf https://astral.sh/uv/install.sh | sh

1.2 检查 MCP 服务器是否已安装

1.2 Check if MCP server is installed

bash
uvx minimax-coding-plan-mcp --help
执行命令判断是否MCP服务器已安装, 如果安装了跳到步骤 2。
bash
uvx minimax-coding-plan-mcp --help
Run the command to check if the MCP server is installed, if yes, skip to Step 2.

1.3 安装 MCP 服务器(如果未安装)

1.3 Install MCP server (if not installed)

方法 1: 使用默认源安装
bash
uvx install minimax-coding-plan-mcp
方法 2: 使用国内镜像加速(如果默认源下载失败)
临时使用清华镜像源:
bash
export UV_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"
uvx install minimax-coding-plan-mcp
或者临时使用阿里云镜像源:
bash
export UV_INDEX_URL="https://mirrors.aliyun.com/pypi/simple/"
uvx install minimax-coding-plan-mcp
Method 1: Install with default source
bash
uvx install minimax-coding-plan-mcp
Method 2: Use domestic mirror for acceleration (if default source download fails)
Use temporary Tsinghua mirror source:
bash
export UV_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"
uvx install minimax-coding-plan-mcp
Or use temporary Alibaba Cloud mirror source:
bash
export UV_INDEX_URL="https://mirrors.aliyun.com/pypi/simple/"
uvx install minimax-coding-plan-mcp

步骤 2: 检查 API Key 配置

Step 2: Check API Key Configuration

bash
cat ~/.openclaw/config/minimax.json 2>/dev/null | python3 -c "import json,sys; d=json.load(sys.stdin); print(d.get('api_key', ''))"
如果返回非空的 API Key,跳到步骤 4。
bash
cat ~/.openclaw/config/minimax.json 2>/dev/null | python3 -c "import json,sys; d=json.load(sys.stdin); print(d.get('api_key', ''))"
If a non-empty API Key is returned, skip to Step 4.

步骤 3: 配置 API Key(如果未配置)

Step 3: Configure API Key (if not configured)

3.1 尝试从 ~/.openclaw/agents/main/agent/auth-profiles.json 中的配置文件中获取

3.1 Try to get from the configuration file at ~/.openclaw/agents/main/agent/auth-profiles.json

根据返回的判断:
  • 名称包含 "minimax" 或 "MiniMax"
找到匹配的 Key 后,询问用户确认是否使用。
Judge according to the returned result:
  • The name contains "minimax" or "MiniMax"
After finding the matching Key, ask the user to confirm whether to use it.

3.2 如果没有找到 Key,向用户索要

3.2 If no Key is found, ask the user for it

直接询问用户提供 MiniMax API Key。 如果未购买MiniMax,购买地址为: https://platform.minimaxi.com/subscribe/coding-plan?code=GjuAjhGKqQ&source=link
Directly ask the user to provide the MiniMax API Key. If you have not purchased MiniMax, the purchase address is: https://platform.minimaxi.com/subscribe/coding-plan?code=GjuAjhGKqQ&source=link

3.3 保存 API Key

3.3 Save API Key

bash
mkdir -p ~/.openclaw/config
cat > ~/.openclaw/config/minimax.json << EOF
{
  "api_key": "API密钥",
  "output_path": "~/.openclaw/workspace/minimax-output"
}
EOF
bash
mkdir -p ~/.openclaw/config
cat > ~/.openclaw/config/minimax.json << EOF
{
  "api_key": "API密钥",
  "output_path": "~/.openclaw/workspace/minimax-output"
}
EOF

步骤 4: 使用 MCP 进行网络搜索

Step 4: Use MCP for Web Search

4.1 调用 web_search

4.1 Call web_search

使用脚本调用 MCP 服务:
bash
python3 {curDir}/scripts/web_search.py "<搜索查询>"
示例:
bash
undefined
Call MCP service with script:
bash
python3 {curDir}/scripts/web_search.py "<搜索查询>"
Example:
bash
undefined

搜索今日新闻

Search for today's hot news

python3 {curDir}/scripts/web_search.py "今天的热点新闻"
undefined
python3 {curDir}/scripts/web_search.py "今天的热点新闻"
undefined

4.2 API 参数说明

4.2 API Parameter Description

参数说明类型
query搜索查询字符串string (必填)
ParameterDescriptionType
querySearch query stringstring (required)

脚本说明

Script Description

脚本位置:
{curDir}/scripts/web_search.py
功能:
  • 优先从环境变量
    MINIMAX_API_KEY
    读取 API Key,如果没有则从
    ~/.openclaw/config/minimax.json
    读取
  • 通过 stdio 模式启动 MCP 服务器
  • 发送 JSON-RPC 请求调用
    web_search
    工具
  • 返回格式化的 JSON 结果
错误处理:
  • API Key 未配置时提示错误
  • uvx 未安装时提示安装命令
  • MCP 服务器错误时显示 stderr 输出
Script location:
{curDir}/scripts/web_search.py
Functions:
  • Prioritize reading API Key from the environment variable
    MINIMAX_API_KEY
    , if not available, read from
    ~/.openclaw/config/minimax.json
  • Start the MCP server in stdio mode
  • Send JSON-RPC request to call the
    web_search
    tool
  • Return formatted JSON results
Error Handling:
  • Prompt error when API Key is not configured
  • Prompt installation command when uvx is not installed
  • Display stderr output when MCP server error occurs