minimax-understand-image
Use MiniMax MCP server for image understanding and analysis.
Execution Process (Installation required for first use, directly call at step 4 for subsequent uses)
Step 1: Check and install dependencies
1.1 Check if uvx is available
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)
Temporarily use Tsinghua mirror source for installation:
bash
export UV_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"
curl -LsSf https://astral.sh/uv/install.sh | sh
Or temporarily use 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 Check if MCP server is installed
bash
uvx minimax-coding-plan-mcp --help
Run the command to determine if the MCP server is installed, jump to Step 2 if it is already installed.
1.3 Install MCP server (if not installed)
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)
Temporarily use Tsinghua mirror source:
bash
export UV_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"
uvx install minimax-coding-plan-mcp
Or temporarily use Alibaba Cloud mirror source:
bash
export UV_INDEX_URL="https://mirrors.aliyun.com/pypi/simple/"
uvx install minimax-coding-plan-mcp
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', ''))"
If a non-empty API Key is returned, jump to Step 4.
Step 3: Configure API Key (if not configured)
3.1 Try to get from the configuration file at ~/.openclaw/agents/main/agent/auth-profiles.json
Judge based on the returned result:
- The name contains "minimax" or "MiniMax"
After finding the matching Key, ask the user for confirmation to use it.
3.2 If no Key is found, ask the user for it
Directly ask the user to provide MiniMax API Key.
If you have not purchased MiniMax, the purchase link is:
https://platform.minimaxi.com/subscribe/coding-plan?code=GjuAjhGKqQ&source=link
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
Step 4: Process images with MCP
4.1 Prepare the image
Put the image in an accessible path, for example:
~/.openclaw/workspace/images/your-image-name.jpg
- Or use a URL
4.2 Call understand_image
Call the MCP service with the script:
bash
python3 {curDir}/scripts/understand_image.py <image path or URL> "<question about the image>"
Example:
bash
# Describe image content
python3 {curDir}/scripts/understand_image.py ~/image.jpg "Describe the content of this image in detail"
# Use URL
python3 {curDir}/scripts/understand_image.py "https://example.com/image.jpg" "What does this image show?"
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
Features:
- First read API Key from environment variable , if not present, read from
~/.openclaw/config/minimax.json
- Start MCP server in stdio mode
- Send JSON-RPC request to call tool
- Return formatted JSON result
Error Handling:
- Prompt error when API Key is not configured
- Prompt installation command when uvx is not installed
- Display stderr output when MCP server encounters an error