Skill: mirrorpromax/minimax-cp-search (version 1.1.0)

--- name: minimax-web-search description: 使用 MiniMax Coding Plan API 进行网页搜索和图像理解。当用户要求搜索信息、查找资料、或者询问实时内容时使用搜索功能；当用户要求识图、分析图片、描述图片内容时使用 understand_image 功能。触发词：搜索、查找、search、look up、识图、分析图片、图片里是什么 --- # MiniMax Web Search & Vision 使用 MiniMax Coding Plan MCP 进行网页搜索和图像理解。 ## 搜索 ```bash python3 scripts/mmsearch.py "<搜索关键词>" ``` ## 识图 ```bash python3 scripts/mmvision.py "<提示词>" "<图片路径或URL>" ``` **支持的图片格式**：JPEG, PNG, WebP **示例：** ```bash # 描述图片内容 python3 scripts/mmvision.py "描述这张图片" /path/to/image.png # 提取图片中的文字 python3 scripts/mmvision.py "提取图片中的所有文字" https://example.com/image.jpg # 分析图片内容 python3 scripts/mmvision.py "这张图片里有什么？" image.jpg ``` ## 脚本说明 - `scripts/mmsearch.py` — 调用 `web_search` 工具 - `scripts/mmvision.py` — 调用 `understand_image` 工具 **依赖：** - `uvx` (Python 包运行器) - `minimax-coding-plan-mcp` - `MINIMAX_API_KEY` 环境变量（已内置在脚本中）

path: scripts/mmsearch.py
content: #!/usr/bin/env python3
"""MiniMax MCP Search - Simple CLI wrapper for MiniMax Coding Plan MCP"""

import json
import subprocess
import sys
import os

# Set environment
os.environ["MINIMAX_API_KEY"] = "[REDACTED_SECRET]"
os.environ["MINIMAX_API_HOST"] = "https://api.minimaxi.com"

def call_mcp_tool(tool_name, arguments):
    """Call MCP tool via stdio"""
    
    # Start MCP server
    proc = subprocess.Popen(
        ["uvx", "minimax-coding-plan-mcp", "-y"],
        stdin=subprocess.PIPE,
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
        env=os.environ.copy(),
        text=True,
        bufsize=1
    )
    
    # Initialize
    init_msg = {
        "jsonrpc": "2.0",
        "id": 1,
        "method": "initialize",
        "params": {
            "protocolVersion": "2024-11-05",
            "capabilities": {},
            "clientInfo": {
                "name": "minimax-search",
                "version": "1.0.0"
            }
        }
    }
    
    # Send initialize
    proc.stdin.write(json.dumps(init_msg) + "\n")
    proc.stdin.flush()
    
    # Read response (skip tool list)
    line = proc.stdout.readline()
    while line:
        data = json.loads(line)
        if "result" in data:
            break
        line = proc.stdout.readline()
    
    # Send initialized notification
    proc.stdin.write(json.dumps({"jsonrpc": "2.0", "method": "initialized", "params": {}}) + "\n")
    proc.stdin.flush()
    
    # Call tool
    call_msg = {
        "jsonrpc": "2.0",
        "id": 2,
        "method": "tools/call",
        "params": {
            "name": tool_name,
            "arguments": arguments
        }
    }
    
    proc.stdin.write(json.dumps(call_msg) + "\n")
    proc.stdin.flush()
    
    # Read result
    result = None
    line = proc.stdout.readline()
    while line:
        data = json.loads(line)
        if "result" in data:
            result = data["result"]
            break
        if "error" in data:
            print(json.dumps(data["error"]), file=sys.stderr)
            break
        line = proc.stdout.readline()
    
    proc.terminate()
    proc.wait()
    
    return result

if __name__ == "__main__":
    if len(sys.argv) < 2:
        print("Usage: mmsearch <query>", file=sys.stderr)
        sys.exit(1)
    
    query = " ".join(sys.argv[1:])
    result = call_mcp_tool("web_search", {"query": query})
    
    if result:
        # Extract content from MCP result
        if "content" in result:
            for item in result["content"]:
                if item.get("type") == "text":
                    print(item["text"])
        else:
            print(json.dumps(result, indent=2))
    else:
        print("No result", file=sys.stderr)
        sys.exit(1)


path: scripts/mmvision.py
content: #!/usr/bin/env python3
"""MiniMax MCP Vision - CLI wrapper for MiniMax Coding Plan MCP image understanding"""

import json
import subprocess
import sys
import os

# Set environment
os.environ["MINIMAX_API_KEY"] = "[REDACTED_SECRET]"
os.environ["MINIMAX_API_HOST"] = "https://api.minimaxi.com"

def call_mcp_tool(tool_name, arguments):
    """Call MCP tool via stdio"""
    
    # Start MCP server
    proc = subprocess.Popen(
        ["uvx", "minimax-coding-plan-mcp", "-y"],
        stdin=subprocess.PIPE,
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
        env=os.environ.copy(),
        text=True,
        bufsize=1
    )
    
    # Initialize
    init_msg = {
        "jsonrpc": "2.0",
        "id": 1,
        "method": "initialize",
        "params": {
            "protocolVersion": "2024-11-05",
            "capabilities": {},
            "clientInfo": {
                "name": "minimax-vision",
                "version": "1.0.0"
            }
        }
    }
    
    # Send initialize
    proc.stdin.write(json.dumps(init_msg) + "\n")
    proc.stdin.flush()
    
    # Read response (skip tool list)
    line = proc.stdout.readline()
    while line:
        data = json.loads(line)
        if "result" in data:
            break
        line = proc.stdout.readline()
    
    # Send initialized notification
    proc.stdin.write(json.dumps({"jsonrpc": "2.0", "method": "initialized", "params": {}}) + "\n")
    proc.stdin.flush()
    
    # Call tool
    call_msg = {
        "jsonrpc": "2.0",
        "id": 2,
        "method": "tools/call",
        "params": {
            "name": tool_name,
            "arguments": arguments
        }
    }
    
    proc.stdin.write(json.dumps(call_msg) + "\n")
    proc.stdin.flush()
    
    # Read result
    result = None
    line = proc.stdout.readline()
    while line:
        data = json.loads(line)
        if "result" in data:
            result = data["result"]
            break
        if "error" in data:
            print(json.dumps(data["error"]), file=sys.stderr)
            break
        line = proc.stdout.readline()
    
    proc.terminate()
    proc.wait()
    
    return result

if __name__ == "__main__":
    if len(sys.argv) < 3:
        print("Usage: mmvision <prompt> <image_path_or_url>", file=sys.stderr)
        print("Example: mmvision '描述这张图片' /path/to/image.png", file=sys.stderr)
        print("Example: mmvision '提取图片中的文字' https://example.com/image.jpg", file=sys.stderr)
        sys.exit(1)
    
    prompt = sys.argv[1]
    image_source = sys.argv[2]
    
    result = call_mcp_tool("understand_image", {
        "prompt": prompt,
        "image_source": image_source
    })
    
    if result:
        # Extract content from MCP result
        if "content" in result:
            for item in result["content"]:
                if item.get("type") == "text":
                    print(item["text"])
        else:
            print(json.dumps(result, indent=2))
    else:
        print("No result", file=sys.stderr)
        sys.exit(1)


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)