Use the MiniMax MCP server for image understanding and analysis.
Execution flow (installation is required the first time; afterwards, directly call in step 4)
Step 1: Check and install dependencies
1.1 Check whether uvx is available
which uvx
If it does not exist, install uv:
Method 1: Use the official installation script (recommended)
curl -LsSf https://astral.sh/uv/install.sh | sh
Method 2: Use a domestic mirror for acceleration (if the official script download fails)
Temporarily use the Tsinghua mirror source for installation:
export UV_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"
curl -LsSf https://astral.sh/uv/install.sh | sh
Or temporarily use the Alibaba Cloud mirror source:
export UV_INDEX_URL="https://mirrors.aliyun.com/pypi/simple/"
curl -LsSf https://astral.sh/uv/install.sh | sh
1.2 Check whether the MCP server is already installed
uvx minimax-coding-plan-mcp --help
Run the command to determine whether the MCP server is already installed. If it is installed, skip to step 2.
1.3 Install the MCP server (if not installed)
Method 1: Install using the default source
uvx install minimax-coding-plan-mcp
Method 2: Use a domestic mirror for acceleration (if the default source download fails)
Temporarily use the Tsinghua mirror source:
export UV_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"
uvx install minimax-coding-plan-mcp
Or temporarily use the Alibaba Cloud mirror source:
export UV_INDEX_URL="https://mirrors.aliyun.com/pypi/simple/"
uvx install minimax-coding-plan-mcp
Step 2: Check the API Key configuration
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.
Step 3: Configure the API Key (if not configured)
3.1 Get the API Key from environment variables
echo $MINIMAX_API_KEY
If a non-empty API Key is returned, skip to step 3.3
3.2 If no Key is found, ask the user for one
Directly ask the user to provide the MiniMax API Key. If MiniMax has not been purchased, the purchase address is: https://platform.minimaxi.com/subscribe/coding-plan?code=GjuAjhGKqQ&source=link
3.3 Save the API Key
mkdir -p ~/.openclaw/config
cat > ~/.openclaw/config/minimax.json << EOF
{
"api_key": "API密钥",
"output_path": "~/.openclaw/workspace/minimax-output"
}
EOF
Step 4: Use MCP to process the image
4.1 Prepare the image
Place the image in an accessible path, for example:
~/.openclaw/workspace/images/图片名.jpg- Or use a URL
4.2 Call understand_image
Use the script to call the MCP service:
python3 {curDir}/scripts/understand_image.py <图片路径或URL> "<对图片的提问>"
Example:
# 描述图片内容
python3 {curDir}/scripts/understand_image.py ~/image.jpg "详细描述这张图片的内容"
# 使用 URL
python3 {curDir}/scripts/understand_image.py "https://example.com/image.jpg "这张图片展示了什么?"
4.3 API parameter description
| Parameter | Description | Type |
|---|---|---|
| image | Image path or URL | string (required) |
| prompt | Question about the image | string (required) |
Script description
Script location:{curDir}/scripts/understand_image.py
Function:
- Preferentially read the API Key from the environment variable
MINIMAX_API_KEY; if not present, read it from~/.openclaw/config/minimax.jsonRead - Start the MCP server in stdio mode
- Send a JSON-RPC request to call the
understand_imagetool - Return the formatted JSON result
Error handling:
- Prompt an error when the API Key is not configured
- Prompt the installation command when uvx is not installed
- Display stderr output when the MCP server errors